/* Robots & Me Official CSS Stylesheet */

/* Design Tokens & Custom Properties */
:root {
  --color-blue: #4a90e2;
  --color-blue-dark: #2a68b5;
  --color-yellow: #ffd54f;
  --color-yellow-dark: #f5b014;
  --color-red: #ff5722;
  --color-red-dark: #d83b0a;
  --color-green: #00e676;
  --color-green-dark: #00b85c;
  --color-orange: #ff9100;
  --color-orange-dark: #cc7400;
  --color-teal: #00b0ff;
  
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f1f5f9;
  
  --font-heading: 'Fredoka', sans-serif;
  --font-body: 'Lexend', sans-serif;
  
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --box-shadow-lego: 0 6px 0 rgba(0, 0, 0, 0.15);
}

/* Reset & Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  background-color: rgba(74, 144, 226, 0.15);
  color: var(--color-blue);
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 2px solid rgba(74, 144, 226, 0.3);
}

.badge-shop {
  background-color: rgba(255, 213, 79, 0.15);
  color: var(--color-orange-dark);
  border-color: rgba(255, 213, 79, 0.3);
  display: inline-block;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px auto;
}

.section-title {
  font-size: 2.5rem;
  color: #0f172a;
  margin-bottom: 16px;
  position: relative;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Background Decorative Gears */
.gear-bg {
  position: absolute;
  color: rgba(74, 144, 226, 0.04);
  z-index: -1;
  pointer-events: none;
}

.gear-1 {
  top: 10%;
  right: -50px;
  width: 250px;
  animation: spin 30s linear infinite;
}

.gear-2 {
  top: 45%;
  left: -80px;
  width: 320px;
  animation: spin-reverse 45s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Header & Navigation */
.header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 4px solid var(--text-light);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--color-blue);
  animation: logo-wiggle 6s ease-in-out infinite;
}

.main-site-logo {
  height: 38px !important;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease, filter 0.3s ease;
}

img.logo-dark {
  display: none !important;
}

img.logo-light {
  display: block !important;
}

body.dark-theme img.logo-light {
  display: none !important;
}

body.dark-theme img.logo-dark {
  display: block !important;
}

.footer-logo .main-site-logo {
  height: 30px !important;
  max-width: 160px;
}

.logo:hover .main-site-logo {
  transform: scale(1.04);
}

.nav-list {
  display: flex;
  gap: 28px;
}

@media (max-width: 1200px) {
  .nav-list {
    gap: 16px;
  }
}

.nav-link {
  font-weight: 500;
  color: #475569;
  position: relative;
  padding: 8px 4px;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--color-blue);
  border-radius: 2px;
}

.shop-nav-highlight {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.2) 0%, rgba(255, 87, 34, 0.1) 100%);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 87, 34, 0.2);
}

.shop-nav-highlight:hover {
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.3) 0%, rgba(255, 87, 34, 0.2) 100%);
  color: var(--color-red) !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-crm {
  background-color: var(--color-blue);
  color: white;
  box-shadow: 0 4px 0 var(--color-blue-dark);
}

.btn-crm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--color-blue-dark);
}

.btn-crm:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-blue-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #0f172a;
  border-radius: 2px;
  transition: var(--transition-smooth);
}

/* Lego-Theme Buttons */
.btn-lego {
  display: inline-block;
  position: relative;
  padding: 16px 32px 20px 32px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  border-radius: 12px;
  border: 3px solid #333;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
  text-align: center;
}

.lego-studs {
  position: absolute;
  top: -8px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}

.lego-studs span {
  display: block;
  width: 14px;
  height: 8px;
  border: 3px solid #333;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  box-sizing: border-box;
}

/* Red Lego Button */
.btn-lego-red {
  background-color: var(--color-red);
  box-shadow: 0 8px 0 var(--color-red-dark), 0 8px 12px rgba(0,0,0,0.15);
}
.btn-lego-red .lego-studs span { background-color: var(--color-red); }
.btn-lego-red:hover { background-color: #ff7043; }
.btn-lego-red:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--color-red-dark), 0 2px 4px rgba(0,0,0,0.1);
}

/* Yellow Lego Button */
.btn-lego-yellow {
  background-color: var(--color-yellow);
  color: #333;
  box-shadow: 0 8px 0 var(--color-yellow-dark), 0 8px 12px rgba(0,0,0,0.15);
}
.btn-lego-yellow .lego-studs span { background-color: var(--color-yellow); }
.btn-lego-yellow:hover { background-color: #ffe082; }
.btn-lego-yellow:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--color-yellow-dark), 0 2px 4px rgba(0,0,0,0.1);
}

/* Blue Lego Button */
.btn-lego-blue {
  background-color: var(--color-blue);
  box-shadow: 0 8px 0 var(--color-blue-dark), 0 8px 12px rgba(0,0,0,0.15);
}
.btn-lego-blue .lego-studs span { background-color: var(--color-blue); }
.btn-lego-blue:hover { background-color: #64b5f6; }
.btn-lego-blue:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--color-blue-dark), 0 2px 4px rgba(0,0,0,0.1);
}

/* Green Lego Button */
.btn-lego-green {
  background-color: var(--color-green);
  box-shadow: 0 8px 0 var(--color-green-dark), 0 8px 12px rgba(0,0,0,0.15);
}
.btn-lego-green .lego-studs span { background-color: var(--color-green); }
.btn-lego-green:hover { background-color: #69f0ae; }
.btn-lego-green:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--color-green-dark), 0 2px 4px rgba(0,0,0,0.1);
}

/* Orange Lego Button */
.btn-lego-orange {
  background-color: var(--color-orange);
  box-shadow: 0 8px 0 var(--color-orange-dark), 0 8px 12px rgba(0,0,0,0.15);
}
.btn-lego-orange .lego-studs span { background-color: var(--color-orange); }
.btn-lego-orange:hover { background-color: #ffab40; }
.btn-lego-orange:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--color-orange-dark), 0 2px 4px rgba(0,0,0,0.1);
}

.w-100 {
  width: 100%;
}

/* Hero Section Styling */
.hero {
  padding: 80px 0 100px 0;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 80% 20%, rgba(74, 144, 226, 0.05) 0%, transparent 50%);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero-title {
  font-size: 3.5rem;
  color: #0f172a;
  margin-bottom: 24px;
}

.hero-title span {
  display: inline-block;
}

.emoji-bounce {
  animation: emoji-bounce 2s ease-in-out infinite;
}

@keyframes emoji-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.hero-buttons {
  display: flex;
  gap: 24px;
}

.hero-image-container {
  position: relative;
}

.image-wrapper {
  position: relative;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 4px solid var(--text-light);
}

.hero-img {
  border-radius: calc(var(--border-radius-lg) - 8px);
}

.hero-float {
  position: absolute;
  padding: 10px 20px;
  background-color: white;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--text-light);
  animation: float 4s ease-in-out infinite;
}

.float-1 {
  top: 10%;
  left: -20px;
  animation-delay: 0s;
  color: var(--color-red);
}

.float-2 {
  bottom: 15%;
  right: -10px;
  animation-delay: 1.5s;
  color: var(--color-blue);
}

.float-3 {
  bottom: -15px;
  left: 20%;
  animation-delay: 0.7s;
  color: var(--color-orange);
}

.float-4 {
  top: -15px;
  right: 25%;
  animation-delay: 2.2s;
  color: var(--color-green);
}

.float-5 {
  top: 50%;
  left: -40px;
  animation-delay: 0.9s;
  color: #8b5cf6;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Achievements / Statistics */
.achievements {
  padding: 100px 0;
  background-color: var(--bg-secondary);
  border-top: 4px solid var(--text-light);
  border-bottom: 4px solid var(--text-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  padding: 32px 24px;
  text-align: center;
  border: 3px solid #333;
  box-shadow: var(--box-shadow-lego);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  border: 3px solid #333;
}

.icon-blue { background-color: var(--color-blue); color: white; }
.icon-yellow { background-color: var(--color-yellow); color: #333; }
.icon-red { background-color: var(--color-red); color: white; }
.icon-teal { background-color: var(--color-teal); color: white; }

.stat-number {
  font-size: 2.8rem;
  color: #0f172a;
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Lego / Robotics Shop Promo Section */
.shop-promo {
  padding: 100px 0;
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.08) 0%, rgba(255, 87, 34, 0.05) 100%);
  position: relative;
}

.shop-promo-container {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 60px;
}

.shop-image-wrapper {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 4px solid var(--text-light);
  overflow: hidden;
}

.shop-img {
  border-radius: calc(var(--border-radius-lg) - 8px);
  transition: transform 0.5s ease;
  width: 100%;
}

.shop-image-wrapper:hover .shop-img {
  transform: scale(1.03);
}

.shop-logo-header {
  margin: 10px 0 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-brand-logo {
  max-height: 80px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.shop-brand-logo:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.14));
}

.shop-title {
  font-size: 2.6rem;
  color: #0f172a;
  margin-bottom: 20px;
}

.shop-text {
  font-size: 1.15rem;
  color: #475569;
  margin-bottom: 30px;
}

.shop-features {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shop-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #334155;
}

.feature-icon {
  font-size: 1.5rem;
}

/* Courses Section */
.courses {
  padding: 100px 0;
  background-color: var(--bg-secondary);
  border-top: 4px solid var(--text-light);
  border-bottom: 4px solid var(--text-light);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.course-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  border: 4px solid #333;
  box-shadow: var(--box-shadow-lego);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 0 rgba(0, 0, 0, 0.15);
}

.course-header {
  padding: 32px 24px;
  border-bottom: 4px solid #333;
  text-align: center;
  color: white;
  position: relative;
}

.lego-card-studs {
  position: absolute;
  top: -6px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}

.lego-card-studs span {
  display: block;
  width: 16px;
  height: 6px;
  border: 3px solid #333;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  box-sizing: border-box;
}

.card-green { background-color: var(--color-green); }
.card-green .lego-card-studs span { background-color: var(--color-green); }
.card-orange { background-color: var(--color-orange); }
.card-orange .lego-card-studs span { background-color: var(--color-orange); }
.card-blue { background-color: var(--color-blue); }
.card-blue .lego-card-studs span { background-color: var(--color-blue); }
.card-red { background-color: var(--color-red); }
.card-red .lego-card-studs span { background-color: var(--color-red); }
.card-yellow { background-color: var(--color-yellow); }
.card-yellow .lego-card-studs span { background-color: var(--color-yellow); }

.course-age {
  display: inline-block;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.course-body {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.course-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-grow: 1;
  font-size: 1rem;
}

.course-details {
  margin-bottom: 32px;
  border-top: 2px dashed rgba(0, 0, 0, 0.1);
  padding-top: 20px;
}

.course-details li {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.course-details li strong {
  color: #334155;
}

/* Robot Constructor Game */
.constructor-section {
  padding: 100px 0;
  background: radial-gradient(circle at 10% 80%, rgba(0, 230, 118, 0.05) 0%, transparent 45%);
}

.constructor-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr;
  gap: 32px;
  align-items: stretch;
}

.constructor-panel, .constructor-preview, .constructor-result {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 4px solid #333;
  box-shadow: var(--box-shadow-lego);
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.panel-title, .result-title {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 24px;
  text-align: center;
  border-bottom: 3px solid var(--text-light);
  padding-bottom: 12px;
}

.control-group {
  margin-bottom: 24px;
}

.control-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 10px;
  color: #475569;
}

.control-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.control-btn {
  padding: 10px 6px;
  border-radius: var(--border-radius-sm);
  border: 2px solid #cbd5e1;
  background-color: #f8fafc;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.control-btn:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.control-btn.active {
  background-color: var(--color-blue);
  color: white;
  border-color: #333;
}

.color-picker-grid {
  display: flex;
  gap: 12px;
}

.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 2px #cbd5e1;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.color-btn.active {
  box-shadow: 0 0 0 3px #333;
  transform: scale(1.1);
}

/* Preview Canvas */
.constructor-preview {
  justify-content: center;
  align-items: center;
  background-color: #edf2f7;
  min-height: 380px;
  position: relative;
}

.constructor-preview::before {
  content: 'PREVIEW';
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: #94a3b8;
}

.robot-canvas-box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* SVG Animations inside Constructor */
.spinning-core {
  transform-origin: 100px 115px;
  animation: spin 3s linear infinite;
}

.glowing-eye {
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from { fill: #00e676; filter: drop-shadow(0 0 2px #00e676); }
  to { fill: #00b0ff; filter: drop-shadow(0 0 6px #00b0ff); }
}

/* Result Section */
.result-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
}

.robot-badge {
  display: inline-block;
  padding: 8px 20px;
  background-color: var(--color-red);
  color: white;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  border-radius: 50px;
  border: 3px solid #333;
  box-shadow: 0 4px 0 #333;
  margin-bottom: 24px;
}

.recommendation-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-grow: 1;
}

.recommendation-intro {
  font-size: 1rem;
  color: var(--text-muted);
}

.course-match-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  border: 3px solid #333;
  padding: 20px;
  position: relative;
  text-align: left;
  width: 100%;
  margin-bottom: 12px;
}

.match-score {
  position: absolute;
  top: -12px;
  right: 16px;
  background-color: var(--color-green);
  color: white;
  border: 2px solid #333;
  padding: 2px 10px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
}

.matched-course-info h4 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #0f172a;
}

.matched-course-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Why Choose Us features */
.why-us {
  padding: 100px 0;
  background-color: var(--bg-secondary);
  border-top: 4px solid var(--text-light);
  border-bottom: 4px solid var(--text-light);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-item {
  background-color: var(--bg-primary);
  padding: 40px 32px;
  border-radius: var(--border-radius-lg);
  border: 3px solid #333;
  box-shadow: var(--box-shadow-lego);
  transition: var(--transition-smooth);
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-icon-box {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 24px;
  border: 3px solid #333;
}

.box-red { background-color: var(--color-red); }
.box-yellow { background-color: var(--color-yellow); }
.box-blue { background-color: var(--color-blue); }

.feature-title {
  font-size: 1.4rem;
  color: #0f172a;
  margin-bottom: 12px;
}

.feature-desc {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Testimonials */
.testimonials {
  padding: 100px 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.testimonial-card {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 4px solid #333;
  padding: 32px;
  box-shadow: var(--box-shadow-lego);
  position: relative;
}

.stars {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.testimonial-text {
  font-size: 1rem;
  color: #475569;
  font-style: italic;
  margin-bottom: 24px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 2px dashed var(--text-light);
  padding-top: 20px;
}

.author-avatar {
  font-size: 2.2rem;
  width: 50px;
  height: 50px;
  background-color: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #333;
}

.author-info h4 {
  font-size: 1.1rem;
  color: #0f172a;
}

.author-relation {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Contact & Control Panel Form */
.contact-section {
  padding: 100px 0;
  background-color: var(--bg-secondary);
  border-top: 4px solid var(--text-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.contact-title {
  font-size: 2.8rem;
  color: #0f172a;
  margin-bottom: 20px;
}

.contact-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.contact-details-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.detail-icon {
  font-size: 1.8rem;
  width: 54px;
  height: 54px;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #333;
}

.detail-content h4 {
  font-size: 1.1rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.detail-content p, .detail-content a {
  color: var(--text-muted);
}

/* Styled Robotics Control Location Panel */
.contact-location-panel {
  background-color: #1e293b;
  border-radius: var(--border-radius-lg);
  border: 5px solid #0f172a;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.35), 0 0 25px rgba(0, 230, 118, 0.2);
  overflow: hidden;
  position: relative;
}

.live-status-pill {
  margin-left: auto;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  color: #00e676;
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid #00e676;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
  animation: pulsePill 2s infinite alternate;
}

@keyframes pulsePill {
  0% { box-shadow: 0 0 4px rgba(0, 230, 118, 0.2); }
  100% { box-shadow: 0 0 14px rgba(0, 230, 118, 0.6); }
}

.location-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.location-map-wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #334155;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.map-radar-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.08) 0%, transparent 70%);
  z-index: 2;
}

.cyber-map-iframe {
  display: block;
  width: 100%;
  border: none;
  filter: contrast(105%) brightness(95%);
}

.location-pin-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background-color: rgba(15, 23, 42, 0.9);
  border: 2px solid #00e676;
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.location-details-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #0f172a;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #334155;
}

.loc-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.loc-icon {
  font-size: 1.3rem;
  min-width: 28px;
}

.loc-txt {
  line-height: 1.4;
  color: #cbd5e1;
}

.loc-txt strong {
  color: #00e676;
}

.location-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-form-panel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.panel-header {
  background-color: #1e293b;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.panel-lights {
  display: flex;
  gap: 8px;
}

.panel-lights span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.panel-lights span:nth-child(1) { background-color: var(--color-red); animation: blink 1s infinite alternate; }
.panel-lights span:nth-child(2) { background-color: var(--color-yellow); animation: blink 1.2s infinite alternate 0.2s; }
.panel-lights span:nth-child(3) { background-color: var(--color-green); animation: blink 0.8s infinite alternate 0.4s; }

@keyframes blink {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.panel-form-title {
  color: white;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.lead-form {
  padding: 32px;
}

.lead-form .form-group {
  margin-bottom: 24px;
}

.lead-form label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.lead-form input, .lead-form select {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--border-radius-sm);
  border: 3px solid #1e293b;
  background-color: #475569;
  color: white;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.lead-form input:focus, .lead-form select:focus {
  outline: none;
  border-color: var(--color-blue);
  background-color: #1e293b;
}

.lead-form input::placeholder {
  color: #94a3b8;
}

.form-status {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: bold;
}

.form-status.success {
  color: var(--color-green);
}

.form-status.error {
  color: var(--color-red);
}

/* Footer Styling */
.footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 80px 0 0 0;
  border-top: 6px solid #1e293b;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 60px;
}

.footer-logo .logo-text {
  color: white;
}

.footer-desc {
  margin-top: 20px;
  line-height: 1.7;
}

.footer-links h4, .footer-socials h4 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: white;
  padding-left: 4px;
}

.social-icons {
  display: flex;
  gap: 16px;
}

.social-btn {
  width: 48px;
  height: 48px;
  background-color: #1e293b;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  border: 2px solid #334155;
  transition: var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
}

.social-btn.social-telegram:hover {
  background-color: #229ED9;
  color: white;
  border-color: #229ED9;
  box-shadow: 0 0 15px rgba(34, 158, 217, 0.5);
  transform: translateY(-3px);
}

.social-btn.social-instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
  border-color: #e6683c;
  box-shadow: 0 0 15px rgba(225, 48, 108, 0.5);
  transform: translateY(-3px);
}

.social-btn.social-admin:hover {
  background-color: #00e676;
  color: #0f172a;
  border-color: #00e676;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 30px 0;
  font-size: 0.9rem;
}

.footer-bottom-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom a {
  color: var(--color-blue);
  font-weight: bold;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* Animations for Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-content {
    order: 1;
  }
  .hero-image-container {
    order: 2;
    max-width: 500px;
    margin: 0 auto;
  }
  .hero-buttons {
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .shop-promo-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .shop-image {
    max-width: 500px;
    margin: 0 auto;
  }
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .constructor-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: white;
    border-bottom: 4px solid var(--text-light);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    padding: 20px 0;
  }
  
  .nav.active {
    display: block;
  }
  
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .header-actions .btn-crm {
    display: none; /* Keep header clean on mobile, link is in hamburger nav if needed */
  }
  
  .hero-title {
    font-size: 2.8rem;
  }
  
  .courses-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin: 0 auto;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin: 0 auto;
  }
  
  .testimonials-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin: 0 auto;
  }
  
  .footer-bottom-container {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
  }
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-socials {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* ==========================================================================
   Creative Hanging Lamp & Lightbulb Theme Switcher
   ========================================================================== */
.lamp-container {
  position: fixed;
  top: 0;
  right: 120px;
  z-index: 1000;
  pointer-events: none;
  overflow: visible;
}

#theme-lamp-svg {
  pointer-events: none;
  overflow: visible !important;
}

#pull-chain-handle {
  pointer-events: auto;
  transition: transform 0.1s ease-out;
}

#pull-chain-handle:active {
  cursor: grabbing;
}

.bulb-glow-circle {
  transition: opacity 0.3s ease;
}

body:not(.dark-theme) .bulb-glow-circle {
  opacity: 1;
}

body.dark-theme .bulb-glow-circle {
  opacity: 0;
}

.bulb-glass-body {
  fill: rgba(255, 255, 255, 0.85);
  transition: fill 0.3s ease;
}

body:not(.dark-theme) .bulb-glass-body {
  fill: rgba(255, 249, 196, 0.5);
  filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.4));
}

body.dark-theme .bulb-glass-body {
  fill: rgba(255, 255, 255, 0.03);
  stroke: #64748b;
}

body.dark-theme #theme-lamp-svg line,
body.dark-theme #theme-lamp-svg rect,
body.dark-theme #pull-chain-handle path {
  stroke: #64748b;
}

body.dark-theme .bulb-wire-support {
  stroke: #475569;
}

.bulb-filament-wire {
  transition: stroke 0.3s ease, filter 0.3s ease;
}

body:not(.dark-theme) .bulb-filament-wire {
  stroke: #ff5722;
  filter: drop-shadow(0 0 4px #ff5722);
}

body.dark-theme .bulb-filament-wire {
  stroke: #64748b;
}


/* ==========================================================================
   Dark Theme Overrides
   ========================================================================== */
body.dark-theme {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #334155;
  background-color: var(--bg-primary);
  color: var(--text-main);
}

body.dark-theme .header {
  background-color: rgba(30, 41, 59, 0.95);
  border-bottom-color: #334155;
}

body.dark-theme .logo-text {
  color: white;
}

body.dark-theme .nav-link {
  color: #cbd5e1;
}

body.dark-theme .nav-link:hover, body.dark-theme .nav-link.active {
  color: var(--color-blue);
}

body.dark-theme .btn-crm {
  box-shadow: 0 4px 0 #1e293b;
}

body.dark-theme .hero-title,
body.dark-theme .contact-title,
body.dark-theme .section-title {
  color: white;
}

body.dark-theme .stat-card {
  background-color: #1e293b;
  border-color: #475569;
}
body.dark-theme .stat-number {
  color: white;
}

body.dark-theme .course-card {
  background-color: #1e293b;
  border-color: #475569;
}
body.dark-theme .course-details {
  border-top-color: rgba(255, 255, 255, 0.1);
}
body.dark-theme .course-details li strong {
  color: #cbd5e1;
}

body.dark-theme .constructor-panel, 
body.dark-theme .constructor-preview, 
body.dark-theme .constructor-result {
  background-color: #1e293b;
  border-color: #475569;
}
body.dark-theme .constructor-preview {
  background-color: #0f172a;
}
body.dark-theme .panel-title, body.dark-theme .result-title {
  color: white;
  border-bottom-color: #334155;
}
body.dark-theme .control-btn {
  background-color: #334155;
  border-color: #475569;
  color: #cbd5e1;
}
body.dark-theme .control-btn:hover {
  background-color: #475569;
}
body.dark-theme .control-btn.active {
  background-color: var(--color-blue);
  color: white;
  border-color: #475569;
}
body.dark-theme .course-match-card {
  background-color: #0f172a;
  border-color: #475569;
}
body.dark-theme .matched-course-info h4 {
  color: white;
}

body.dark-theme .main-site-logo {
  filter: none !important;
}

body.dark-theme .feature-item {
  background-color: #1e293b;
  border-color: #475569;
}
body.dark-theme .feature-title {
  color: white;
}

body.dark-theme .testimonial-card {
  background-color: #1e293b;
  border-color: #475569;
}
body.dark-theme .testimonial-text {
  color: #cbd5e1;
}
body.dark-theme .author-avatar {
  background-color: #334155;
  border-color: #475569;
}
body.dark-theme .author-info h4 {
  color: white;
}

body.dark-theme .detail-icon {
  background-color: #1e293b;
  border-color: #475569;
}
body.dark-theme .detail-content h4 {
  color: white;
}

body.dark-theme .shop-image-wrapper {
  background-color: #1e293b;
  border-color: #334155;
}
body.dark-theme .shop-brand-logo {
  filter: drop-shadow(0 4px 15px rgba(255, 255, 255, 0.2));
}
body.dark-theme .shop-title {
  color: white;
}
body.dark-theme .shop-text {
  color: #cbd5e1;
}
body.dark-theme .shop-features li {
  color: #cbd5e1;
}

body.dark-theme .image-wrapper {
  background-color: #1e293b;
  border-color: #334155;
}
body.dark-theme .hero-float {
  background-color: #1e293b;
  border-color: #334155;
}

/* Adjust position of switch for mobile */
@media (max-width: 768px) {
  .lamp-container {
    right: 70px;
  }
  .lamp-rope {
    height: 40px;
  }
  .lamp-cord-line {
    height: 60px;
  }
}

/* ==========================================================================
   Playful Quiz Section (Robototexnika yoqadimi?)
   ========================================================================== */
.quiz-section {
  padding: 80px 0;
  background-color: var(--bg-secondary);
  border-top: 4px solid var(--text-light);
  border-bottom: 4px solid var(--text-light);
}

.quiz-container {
  display: flex;
  justify-content: center;
}

.quiz-box {
  background-color: var(--bg-primary);
  border: 4px solid #333;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lego);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  text-align: center;
  position: relative;
}

.quiz-question {
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 30px;
}

body.dark-theme .quiz-question {
  color: white;
}

.switch-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.switch-label {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  user-select: none;
}

.label-yes {
  color: var(--color-green-dark);
}

.label-no {
  color: var(--color-red);
  cursor: pointer;
}

.quiz-switch {
  width: 140px;
  height: 50px;
  background-color: #cbd5e1;
  border: 4px solid #333;
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 4px 6px rgba(0,0,0,0.15);
  overflow: visible;
  transition: background-color 0.25s ease;
}

body.dark-theme .quiz-switch {
  background-color: #475569;
  border-color: #1e293b;
}

.quiz-switch.no-selected {
  background-color: #fecaad;
}

.quiz-switch-knob {
  width: 36px;
  height: 36px;
  background-color: var(--color-yellow);
  border: 3px solid #333;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 4px;
  box-shadow: 0 4px 0 var(--color-yellow-dark);
  transition: left 0.2s cubic-bezier(0.25, 0.8, 0.25, 1.2), background-color 0.25s ease;
  z-index: 2;
}

body.dark-theme .quiz-switch-knob {
  border-color: #1e293b;
}

.quiz-switch.no-selected .quiz-switch-knob {
  left: 92px;
  background-color: var(--color-red);
  box-shadow: 0 4px 0 var(--color-red-dark);
}

.quiz-switch-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 320px;
  height: 180px;
  margin: 0 auto;
  overflow: visible;
}

#quiz-switch-svg {
  overflow: visible;
}

.quiz-feedback {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-blue);
  min-height: 35px;
  transition: opacity 0.2s ease;
  margin-top: 15px;
}

body.dark-theme .quiz-feedback {
  color: var(--color-teal);
}

/* Quiz Switcher Dark Theme Overrides */
body.dark-theme #panel {
  fill: #1e293b;
  stroke: #64748b;
}

body.dark-theme #toggle {
  stroke: #1e293b;
}

body.dark-theme #quiz-switch-svg path,
body.dark-theme #quiz-switch-svg rect,
body.dark-theme #quiz-switch-svg polyline {
  stroke: #1e293b;
}

body.dark-theme .robotHand path,
body.dark-theme .robotHand rect,
body.dark-theme #robotThumbArm path,
body.dark-theme #robotThumb path,
body.dark-theme #quiz-switch-svg polyline {
  stroke: #1e293b !important; /* Keep crisp dark boundaries for robot hand details */
}

/* ==========================================================================
   Playful Gear Language Switcher
   ========================================================================== */
.lang-switcher-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.lang-gear-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: transform 0.2s ease;
}

.lang-gear-btn:hover {
  transform: scale(1.1) rotate(15deg);
}

.lang-gear-btn:active {
  transform: scale(0.95);
}

.lang-gear-svg {
  overflow: visible;
}

/* Note: Rotations for #lang-gear-rotator and .flag-icon are animated smoothly using GSAP in JS */

/* Dark Theme Overrides for Language switcher */
body.dark-theme .lang-gear-svg circle:first-child {
  fill: #334155;
  stroke: #64748b;
}

body.dark-theme .lang-gear-svg path {
  stroke: #64748b;
}

body.dark-theme .lang-gear-svg circle:nth-child(3) {
  fill: #475569;
  stroke: #64748b;
}

body.dark-theme .flag-icon circle {
  fill: #1e293b;
  stroke: #64748b;
}

/* ==========================================================================
   Course Card Visuals & Interactive Details
   ========================================================================== */
.course-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--text-light);
}

.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-card:hover .course-image img {
  transform: scale(1.08);
}

.btn-more-details {
  background: none;
  border: 2px solid var(--text-light);
  border-radius: 8px;
  color: var(--text-dark);
  font-weight: 700;
  padding: 10px 16px;
  width: 100%;
  margin-top: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 0.9em;
  font-family: inherit;
}

.btn-more-details:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-dark);
}

.btn-more-details:active {
  transform: scale(0.98);
}

.btn-more-details .arrow {
  font-size: 0.8em;
  display: inline-block;
  transition: transform 0.3s ease;
}

.btn-more-details.active .arrow {
  transform: rotate(180deg);
}

.course-expanded-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--bg-secondary);
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid transparent;
}

.course-expanded-content.active {
  max-height: 380px; /* enough space for all items */
  border-color: var(--text-light);
  margin-bottom: 10px;
}

.expanded-inner {
  padding: 16px;
  text-align: left;
}

.expanded-inner h5 {
  font-size: 0.92em;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.expanded-inner h5:not(:first-child) {
  margin-top: 14px;
}

.expanded-inner ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.expanded-inner ul li {
  font-size: 0.88em;
  margin-bottom: 6px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.project-tags .tag {
  background-color: white;
  border: 2px solid var(--text-light);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--text-dark);
  box-shadow: 2px 2px 0px var(--text-light);
}

/* Dark Mode Overrides */
body.dark-theme .course-image {
  background-color: #0f172a;
  border-bottom-color: #334155;
}

body.dark-theme .btn-more-details {
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-theme .btn-more-details:hover {
  background-color: #1e293b;
  border-color: #64748b;
}

body.dark-theme .course-expanded-content {
  background-color: #1e293b;
}

body.dark-theme .course-expanded-content.active {
  border-color: #334155;
}

body.dark-theme .project-tags .tag {
  background-color: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
  box-shadow: 2px 2px 0px #334155;
}

/* ==========================================================================
   5-Level Educational Mini-Games Suite
   ========================================================================== */
.game-tabs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}

.game-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background-color: var(--bg-secondary);
  padding: 8px;
  border-radius: 50px;
  border: 2px solid var(--text-light);
}

.random-mission-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-lego-purple {
  background-color: #9c27b0;
  color: white;
}

.btn-lego-yellow {
  background-color: #f59e0b;
  color: white;
}

.game-tab-btn {
  background: none;
  border: 2px solid transparent;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-tab-btn.active {
  background-color: white;
  border-color: var(--text-dark);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.game-tab-btn[data-level="1"].active { color: var(--color-green); }
.game-tab-btn[data-level="2"].active { color: var(--color-orange); }
.game-tab-btn[data-level="3"].active { color: var(--color-red); }
.game-tab-btn[data-level="4"].active { color: var(--color-yellow); }
.game-tab-btn[data-level="5"].active { color: var(--color-blue); }

.game-workspace-container {
  width: 100%;
  background: white;
  border: 4px solid var(--text-dark);
  border-radius: var(--border-radius-lg);
  box-shadow: 8px 8px 0px var(--text-dark);
  padding: 30px;
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

.game-level-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.game-level-view.active {
  display: block;
}

.level-intro {
  margin-bottom: 24px;
  text-align: center;
}

.level-intro h4 {
  font-size: 1.4rem;
  font-family: var(--font-heading);
  margin-bottom: 8px;
  color: var(--text-dark);
}

.level-intro p {
  font-size: 0.95rem;
  color: #64748b;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Flappy Robo-Bird Styling */
.flappy-game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.flappy-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0f172a;
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid #334155;
  color: white;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

.flappy-score-box span {
  color: #f59e0b;
}

.flappy-high-box span {
  color: #38bdf8;
}

.flappy-canvas-container {
  position: relative;
  width: 100%;
  background-color: #020617;
  border-radius: 16px;
  border: 3px solid var(--text-dark);
  box-shadow: inset 0 0 25px rgba(59, 130, 246, 0.3);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#flappy-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  cursor: pointer;
}

.flappy-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.flappy-overlay.hidden {
  display: none;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.overlay-content h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #f59e0b;
  margin: 0;
}

.overlay-content p {
  font-size: 1rem;
  color: #cbd5e1;
  margin: 0;
}

.flappy-controls-deck {
  display: flex;
  justify-content: center;
}

.btn-large-tap {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

/* LEGO Brick Stacker Styling */
.stacker-game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.stacker-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: #0f172a;
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid #334155;
  color: white;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

.hud-box span {
  color: #f59e0b;
}

.stacker-canvas-container {
  position: relative;
  width: 100%;
  background-color: #0f172a;
  border-radius: 16px;
  border: 3px solid var(--text-dark);
  box-shadow: inset 0 0 25px rgba(245, 158, 11, 0.3);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#stacker-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  cursor: pointer;
}

.stacker-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.stacker-overlay.hidden {
  display: none;
}

.stacker-controls-deck {
  display: flex;
  justify-content: center;
}

/* Cyber Spark Endless Runner Styling */
.spark-game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.spark-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: #0f172a;
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid #334155;
  color: white;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

.spark-canvas-container {
  position: relative;
  width: 100%;
  background-color: #020617;
  border-radius: 16px;
  border: 3px solid var(--text-dark);
  box-shadow: inset 0 0 30px rgba(0, 230, 118, 0.3);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#spark-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  cursor: pointer;
}

.spark-controls-deck {
  display: flex;
  justify-content: center;
}

/* Arduino Signal Catcher Styling */
.arduino-arcade-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.arduino-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: #0f172a;
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid #00878f;
  color: white;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

.arduino-canvas-container {
  position: relative;
  width: 100%;
  background-color: #022c22;
  border-radius: 16px;
  border: 3px solid #00878f;
  box-shadow: inset 0 0 30px rgba(0, 135, 143, 0.4);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#arduino-arcade-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  cursor: pointer;
}

.arduino-controls-deck {
  display: flex;
  justify-content: center;
}

.touch-ctrl-deck {
  display: flex;
  gap: 20px;
}

.arena-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0f172a;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid #334155;
  color: white;
}

.hud-robot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.hud-robot.enemy-hud {
  justify-content: flex-end;
}

.robot-avatar {
  font-size: 2rem;
}

.robot-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.robot-meta.text-right {
  text-align: right;
}

.robot-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
}

.hp-bar-container {
  width: 100%;
  height: 12px;
  background-color: #334155;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #475569;
}

.hp-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.hp-bar-fill.player-hp {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.hp-bar-fill.enemy-hp {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.battle-vs-badge {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 900;
  color: #f59e0b;
  padding: 4px 12px;
  background-color: rgba(245, 158, 11, 0.15);
  border-radius: 20px;
  border: 1px dashed #f59e0b;
}

.arena-canvas-container {
  width: 100%;
  background-color: #020617;
  border-radius: 16px;
  border: 3px solid var(--text-dark);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.2);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#cyber-arena-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
}

.arena-command-deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid var(--text-light);
}

.cmd-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.command-program-queue {
  background-color: white;
  border: 2px solid var(--text-light);
  border-radius: 10px;
  padding: 14px;
  min-height: 80px;
}

.command-action-btns {
  display: flex;
  gap: 12px;
}

/* EV3 Racing Simulator Styling */
.ev3-racing-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.racing-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: #0f172a;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid #334155;
  color: white;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.hud-item span {
  color: #38bdf8;
}

.racing-canvas-container {
  width: 100%;
  background-color: #0f172a;
  border-radius: 16px;
  border: 3px solid var(--text-dark);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.2);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#ev3-racing-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
}

.racing-controls-deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid var(--text-light);
}

.control-sliders-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.slider-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
}

.slider-box input[type="range"] {
  width: 100%;
  accent-color: var(--color-orange);
}

.racing-action-btns {
  display: flex;
  gap: 12px;
}

.wedo-silhouette, .ev3-silhouette {
  width: 320px;
  height: 240px;
  background-color: #f1f5f9;
  border: 3px dashed #cbd5e1;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.silhouette-slot, .ev3-slot {
  position: absolute;
  background-color: rgba(148, 163, 184, 0.15);
  border: 2px dashed #94a3b8;
  border-radius: 6px;
  transition: all 0.3s ease;
}

/* Slots Placement */
.slot-base { bottom: 15px; left: 60px; width: 200px; height: 35px; }
.slot-body { bottom: 50px; left: 80px; width: 140px; height: 70px; }
.slot-neck { bottom: 120px; left: 110px; width: 50px; height: 40px; }
.slot-head { bottom: 160px; left: 100px; width: 90px; height: 55px; }
.slot-eye { bottom: 185px; left: 130px; width: 22px; height: 22px; }

/* EV3 Slots */
.slot-tracks { bottom: 15px; left: 50px; width: 220px; height: 45px; }
.slot-motor { bottom: 60px; left: 80px; width: 140px; height: 60px; }
.slot-brick { bottom: 120px; left: 95px; width: 110px; height: 75px; }
.slot-sensor { bottom: 105px; left: 220px; width: 50px; height: 45px; }

.wedo-toolbox, .ev3-toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  background-color: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--text-light);
  width: 100%;
}

.wedo-brick, .ev3-part {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--text-dark);
  border-radius: 8px;
  font-weight: 700;
  cursor: grab;
  box-shadow: 3px 3px 0 var(--text-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  touch-action: none;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.wedo-brick:hover, .ev3-part:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--text-dark);
}

.wedo-brick:active, .ev3-part:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--text-dark);
}

/* Bricks Colors */
.brick-base { background-color: var(--color-green); color: white; }
.brick-body { background-color: var(--color-orange); color: white; }
.brick-neck { background-color: var(--color-red); color: white; }
.brick-head { background-color: var(--color-yellow); color: var(--text-dark); }
.brick-eye { background-color: white; color: var(--text-dark); }

/* EV3 Parts Colors */
.part-tracks { background-color: #64748b; color: white; }
.part-motor { background-color: #ff5722; color: white; }
.part-brick { background-color: #e2e8f0; color: var(--text-dark); }
.part-sensor { background-color: #00e676; color: white; }

/* Snapped Bricks State */
.wedo-brick.snapped, .ev3-part.snapped {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Filled silhouette slots */
.silhouette-slot.filled, .ev3-slot.filled {
  border: 2px solid var(--text-dark);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4);
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.slot-base.filled { background-color: var(--color-green); }
.slot-body.filled { background-color: var(--color-orange); }
.slot-neck.filled { background-color: var(--color-red); }
.slot-head.filled { background-color: var(--color-yellow); }
.slot-eye.filled { background-color: white; }

.slot-tracks.filled { background-color: #64748b; font-size: 18px; }
.slot-motor.filled { background-color: #ff5722; font-size: 18px; }
.slot-brick.filled { background-color: #e2e8f0; font-size: 18px; }
.slot-sensor.filled { background-color: #00e676; font-size: 18px; }

/* Level 2 (Scratch Grid) */
.scratch-game-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .scratch-game-container {
    grid-template-columns: 1fr;
  }
}

.scratch-grid-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
  background-color: #e2e8f0;
  padding: 8px;
  border-radius: 12px;
  border: 3px solid var(--text-dark);
  aspect-ratio: 1;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.scratch-cell {
  background-color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.scratch-cell.obstacle {
  background-color: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 20%, transparent 20%);
  background-size: 10px 10px;
}

.scratch-cell.target::before {
  content: "⭐";
  animation: pulse 1s infinite alternate;
}

.scratch-cat {
  position: absolute;
  width: 80%;
  height: 80%;
  background-color: var(--color-orange);
  border: 2px solid var(--text-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 5;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.scratch-control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scratch-blocks-toolbox {
  display: flex;
  gap: 12px;
}

.scratch-block-btn {
  flex: 1;
}

.scratch-program-queue {
  background-color: #f8fafc;
  border: 2px solid var(--text-light);
  border-radius: 8px;
  padding: 16px;
  min-height: 120px;
}

.scratch-program-queue h5 {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.program-steps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-item {
  padding: 6px 12px;
  background-color: #e2e8f0;
  border: 1px solid var(--text-light);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.scratch-actions {
  display: flex;
  gap: 12px;
}

.scratch-actions button {
  flex: 1;
}

/* Level 4 (Sxemotexnika Circuit Board) */
/* Level 4 (Sxemotexnika Circuit Schematic Builder) */
.sxema-canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
  width: 100%;
}

.sxema-schematic {
  width: 460px;
  height: 280px;
  background-color: #0f172a;
  background-image: radial-gradient(rgba(51, 65, 85, 0.5) 1px, transparent 0);
  background-size: 16px 16px;
  border: 4px solid var(--text-dark);
  border-radius: 16px;
  box-shadow: 6px 6px 0px var(--text-dark);
  position: relative;
  overflow: hidden;
}

@media (max-width: 576px) {
  .sxema-schematic {
    width: 100%;
    height: 240px;
  }
  .sxema-svg-traces {
    transform: scale(0.8);
    transform-origin: top left;
  }
}

.sxema-svg-traces {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.sxema-slot {
  position: absolute;
  background-color: rgba(30, 41, 59, 0.8);
  border: 2px dashed #475569;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sxema-slot .slot-placeholder {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
}

/* Filled layout states */
.sxema-slot.filled {
  border: 2px solid var(--text-dark);
  background-color: #1e293b;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.sxema-slot.filled .slot-placeholder {
  display: none;
}

/* Specific component filled configurations */
.sxema-slot.slot-battery.filled {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.sxema-slot.slot-battery.filled::after {
  content: "🔋 9V";
  font-size: 1.1rem;
  font-weight: bold;
  color: #10b981;
}

.sxema-slot.slot-resistor.filled {
  background-color: #f59e0b;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 15px, #b45309 15px, #b45309 20px);
}
.sxema-slot.slot-resistor.filled::after {
  content: "〰️ 10kΩ";
  font-size: 0.85rem;
  font-weight: bold;
  color: #78350f;
}

.sxema-slot.slot-led.filled {
  background-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.sxema-slot.slot-led.filled::after {
  content: "🔴 LED";
  font-weight: bold;
  color: white;
  font-size: 0.85rem;
}
.sxema-slot.slot-led.filled.glowing {
  animation: glowPulse 0.8s infinite alternate;
}

.sxema-slot.slot-gnd.filled {
  background-color: #334155;
}
.sxema-slot.slot-gnd.filled::after {
  content: "⏚ GND";
  font-weight: bold;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.sxema-toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--text-light);
  width: 100%;
}

.sxema-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--text-dark);
  border-radius: 8px;
  background-color: white;
  cursor: grab;
  box-shadow: 3px 3px 0 var(--text-dark);
  user-select: none;
  touch-action: none;
  font-family: var(--font-heading);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.sxema-part:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--text-dark);
}

.sxema-part.snapped {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sxema-part .part-sym {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.sxema-part .part-lbl {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 700;
}

#sxema-trace-flow {
  animation: dashFlow 1s linear infinite;
}

/* Animations */
@keyframes glowPulse {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    background-color: #ef4444;
  }
  100% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 1), 0 0 40px rgba(239, 68, 68, 0.6);
    background-color: #f87171;
  }
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -20;
  }
}

/* Level 5 (Arduino Wiring) */
.arduino-workspace {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .arduino-workspace {
    grid-template-columns: 1fr;
  }
}

.arduino-wiring-canvas {
  width: 100%;
  height: 300px;
  background-color: #f8fafc;
  border: 2px solid var(--text-light);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.arduino-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.arduino-component {
  position: absolute;
  background-color: white;
  border: 2px solid var(--text-dark);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.05);
}

#comp-sensor { top: 30px; left: 20px; width: 90px; }
#comp-light { top: 180px; left: 20px; width: 90px; }
#comp-board { top: 70px; right: 20px; width: 140px; height: 160px; background-color: #1b4d3e; color: white; border-color: #0d2b20; }

.comp-icon { font-size: 1.5rem; }
.comp-label { font-size: 0.75rem; font-weight: bold; text-align: center; }

/* LED glow */
.led-bulb {
  filter: grayscale(1);
  transition: filter 0.3s ease;
}
.led-bulb.glow {
  filter: none;
  animation: pulse 1s infinite alternate;
}

.board-virtual {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.board-logo {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 1px;
  opacity: 0.7;
}

.board-pins {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.board-pin-slot {
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  position: relative;
}

/* Pin Nodes */
.connection-pin {
  width: 12px;
  height: 12px;
  background-color: #ef4444;
  border: 2px solid var(--text-dark);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.connection-pin:hover, .board-pin-slot:hover {
  transform: scale(1.3);
  background-color: #f59e0b;
}

.arduino-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--text-light);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-group label {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-dark);
}

.slider-group input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.code-terminal {
  background-color: #0f172a;
  color: #38bdf8;
  padding: 12px;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  overflow-x: auto;
}

.code-terminal h5 {
  color: #94a3b8;
  margin-bottom: 6px;
  font-size: 0.75rem;
}

/* Victory confetty canvas & screen */
.victory-confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
  display: none;
}

.game-victory-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.game-victory-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.victory-message {
  text-align: center;
  background: white;
  border: 4px solid var(--text-dark);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: 6px 6px 0 var(--text-dark);
  max-width: 380px;
  animation: popScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-message h3 {
  font-size: 2rem;
  font-family: var(--font-heading);
  margin-bottom: 12px;
  color: var(--color-green);
}

.victory-message p {
  font-size: 1rem;
  color: #475569;
  margin-bottom: 24px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popScale {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Dark Mode support for Games */
body.dark-theme .game-workspace-container {
  background-color: #1e293b;
  border-color: #334155;
  box-shadow: 8px 8px 0px #334155;
}

body.dark-theme .game-tab-btn {
  color: #cbd5e1;
}

body.dark-theme .game-tab-btn.active {
  background-color: #0f172a;
  border-color: #475569;
}

body.dark-theme .level-intro h4 {
  color: white;
}

body.dark-theme .level-intro p {
  color: #94a3b8;
}

body.dark-theme .wedo-canvas .wedo-silhouette,
body.dark-theme .ev3-canvas .ev3-silhouette {
  background-color: #0f172a;
  border-color: #334155;
}

body.dark-theme .silhouette-slot,
body.dark-theme .ev3-slot {
  background-color: rgba(51, 65, 85, 0.3);
  border-color: #475569;
}

body.dark-theme .wedo-toolbox,
body.dark-theme .ev3-toolbox {
  background-color: #0f172a;
  border-color: #334155;
}

body.dark-theme .scratch-grid-map {
  background-color: #0f172a;
  border-color: #334155;
}

body.dark-theme .scratch-cell {
  background-color: #1e293b;
  border-color: #334155;
}

body.dark-theme .scratch-cell.obstacle {
  background-color: #0f172a;
  background-image: radial-gradient(#334155 20%, transparent 20%);
}

body.dark-theme .scratch-program-queue {
  background-color: #0f172a;
  border-color: #334155;
}

body.dark-theme .scratch-program-queue h5 {
  color: white;
}

body.dark-theme .step-item {
  background-color: #334155;
  border-color: #475569;
  color: #cbd5e1;
}

body.dark-theme .arduino-wiring-canvas {
  background-color: #0f172a;
  border-color: #334155;
}

body.dark-theme .arduino-component {
  background-color: #1e293b;
  border-color: #334155;
}

body.dark-theme .arduino-controls {
  background-color: #0f172a;
  border-color: #334155;
}

body.dark-theme .slider-group label {
  color: white;
}

body.dark-theme .game-victory-overlay {
  background-color: rgba(15, 23, 42, 0.95);
}

body.dark-theme .victory-message {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 6px 6px 0 #334155;
}

body.dark-theme .victory-message p {
  color: #94a3b8;
}

/* Hero Interactive Circuit Canvas */
.hero {
  position: relative;
  overflow: hidden;
}

#hero-circuit-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

.hero-container {
  position: relative;
  z-index: 2;
}

/* 3D Hologram Tilt Cards */
.tilt-card {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.2s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
}

.tilt-card:hover {
  box-shadow: 0 16px 32px rgba(0, 230, 118, 0.25), 0 0 20px rgba(0, 230, 118, 0.15);
}

/* Interactive Floating Cyber Robo Mascot Widget */
.robo-mascot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.robo-speech-bubble {
  position: relative;
  background-color: #0f172a;
  border: 2px solid #00e676;
  color: white;
  padding: 12px 36px 12px 16px;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 230, 118, 0.3);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  max-width: 260px;
  opacity: 0;
  transform: scale(0.8) translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.robo-speech-bubble.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.bubble-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px;
}

.bubble-close:hover {
  color: #ef4444;
}

.robo-avatar-container {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 3px solid #00e676;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 230, 118, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: mascotFloat 3s ease-in-out infinite;
}

.robo-avatar-container svg {
  pointer-events: none;
}

.robo-avatar-container:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(0, 230, 118, 0.6);
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.robo-antenna {
  width: 4px;
  height: 10px;
  background-color: #64748b;
  position: relative;
  border-radius: 2px;
}

.antenna-light {
  width: 8px;
  height: 8px;
  background-color: #00e676;
  border-radius: 50%;
  position: absolute;
  top: -6px;
  left: -2px;
  box-shadow: 0 0 10px #00e676;
  animation: antennaBlink 1.2s ease-in-out infinite alternate;
}

@keyframes antennaBlink {
  0% { opacity: 0.3; box-shadow: 0 0 2px #00e676; }
  100% { opacity: 1; box-shadow: 0 0 12px #00e676; }
}

.robo-head {
  width: 44px;
  height: 36px;
  background-color: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
}

.robo-eyes {
  display: flex;
  gap: 8px;
}

.robo-eye {
  width: 12px;
  height: 12px;
  background-color: #020617;
  border: 1px solid #38bdf8;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pupil {
  width: 6px;
  height: 6px;
  background-color: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
  transition: transform 0.05s ease-out;
}

.robo-mouth {
  width: 16px;
  height: 3px;
  background-color: #00e676;
  border-radius: 2px;
  box-shadow: 0 0 4px #00e676;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsiveness Overhaul (<= 768px & <= 480px)
   ========================================================================== */

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  /* Header & Navigation Fixes */
  .header-container {
    padding: 12px 16px;
  }
  
  .nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    border-bottom: 4px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 24px 16px;
    z-index: 9999;
  }
  
  .nav.active {
    display: block;
  }
  
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .nav-list a {
    font-size: 1.1rem;
    color: var(--text-dark);
    padding: 8px 16px;
  }

  /* Hero Section Responsiveness */
  .hero {
    padding: 40px 0 60px 0;
  }

  .hero-title {
    font-size: 2.2rem;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    gap: 12px;
  }

  .hero-buttons .btn-lego {
    width: 100%;
  }

  /* Game Constructor Section Fixes */
  .constructor-header {
    margin-bottom: 20px;
  }

  .game-tabs-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    width: 100%;
  }

  .game-tab-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
    border-radius: 8px;
    flex: 1 1 auto;
    text-align: center;
    min-width: 90px;
  }

  /* Hanging Lamp Lightbulb Position on Mobile */
  .lamp-container {
    right: 12px !important;
    top: 4px !important;
    transform: scale(0.6) !important;
    transform-origin: top right !important;
    z-index: 1001 !important;
  }

  /* Scratch Game Mobile Grid & Toolbox Fixes */
  .scratch-game-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 4px;
  }

  .scratch-grid-map {
    max-width: 270px !important;
    gap: 4px !important;
    padding: 6px !important;
    margin: 0 auto !important;
  }

  .scratch-cell {
    font-size: 1.1rem !important;
  }

  .scratch-blocks-toolbox {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .scratch-block-btn {
    flex: 1 1 calc(45% - 4px) !important;
    min-width: 105px !important;
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
  }

  .scratch-program-queue {
    padding: 12px;
    min-height: 90px;
  }

  .scratch-actions {
    display: flex;
    gap: 8px;
  }

  .scratch-actions .btn-lego {
    flex: 1;
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  /* Canvases Responsiveness */
  #wedo-flappy-canvas,
  #scratch-maze-canvas,
  #lego-stacker-canvas,
  #spark-canvas,
  #arduino-arcade-canvas {
    width: 100% !important;
    max-width: 290px !important;
    height: auto !important;
    max-height: 360px !important;
    margin: 0 auto !important;
    touch-action: none;
  }

  .flappy-hud, .spark-hud, .arduino-hud {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .touch-ctrl-deck {
    margin-top: 10px;
    gap: 8px;
  }

  .touch-btn {
    padding: 12px 18px;
    font-size: 1rem;
  }

  /* Floating Robo Mascot Fixes for Mobile */
  .robo-mascot-widget {
    bottom: 12px;
    right: 12px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }

  .robo-speech-bubble {
    max-width: 220px;
    font-size: 0.8rem;
    padding: 10px 28px 10px 12px;
  }

  /* Contact & Location Panel Fixes */
  .contact-location-panel {
    border-width: 3px;
  }

  .location-card-body {
    padding: 14px;
    gap: 12px;
  }

  .cyber-map-iframe {
    height: 180px;
  }

  .loc-detail-row {
    font-size: 0.82rem;
  }

  .location-actions .btn-lego {
    font-size: 0.85rem;
    padding: 12px;
  }

  /* Playful Quiz Section Mobile Fixes */
  .quiz-section {
    padding: 40px 0;
  }

  .quiz-box {
    padding: 20px 12px !important;
    border-width: 3px !important;
    max-width: 100% !important;
  }

  .quiz-question {
    font-size: 1.25rem !important;
    margin-bottom: 16px !important;
  }

  .switch-area {
    gap: 4px !important;
    margin-bottom: 16px !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .switch-label {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    padding: 4px 6px !important;
    flex: 0 0 auto !important;
  }

  #quiz-switch-svg {
    width: 170px !important;
    height: auto !important;
    max-width: 180px !important;
  }

  .quiz-feedback {
    font-size: 0.85rem !important;
    padding: 8px 12px !important;
  }

  /* Fixed Lightbulb Lamp on Mobile - Position at top header area so it stays off game/quiz cards */
  .lamp-container {
    position: absolute !important;
    top: 6px !important;
    right: 12px !important;
    transform: scale(0.55) !important;
    transform-origin: top right !important;
    z-index: 99 !important;
    pointer-events: none !important;
  }

  /* Footer Responsiveness */
  .footer {
    padding: 50px 0 0 0;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-socials {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .game-tab-btn {
    font-size: 0.75rem;
    padding: 6px 8px;
    min-width: 75px;
  }

  .robo-mascot-widget {
    bottom: 8px;
    right: 8px;
    transform: scale(0.75);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #quiz-switch-svg {
    width: 145px !important;
  }
  
  .switch-label {
    font-size: 0.78rem !important;
  }
}
