/* robotics.css — Robotics & Arduino Course Page */

:root {
  --color-bg: #FAFBFF;
  --color-surface: #FFFFFF;
  --color-surface-2: #F5F3FF;
  --color-surface-offset: #EDE9FE;
  --color-surface-offset-2: #DDD6FE;
  --color-surface-dynamic: #C4B5FD;
  --color-divider: #E5E7EB;
  --color-border: #D1D5DB;
  --color-text: #1F2937;
  --color-text-muted: #6B7280;
  --color-text-faint: #9CA3AF;
  --color-text-inverse: #FFFFFF;
  --color-primary: #7C3AED;
  --color-primary-hover: #6D28D9;
  --color-primary-active: #5B21B6;
  --color-primary-highlight: #EDE9FE;
  --color-accent: #0EA5E9;
  --color-coral: #F97316;
  --color-lime: #22C55E;
  --color-gold: #F59E0B;
  --color-gold-hover: #D97706;

  /* Robotics-specific */
  --color-robotics-accent: #F97316;
  --color-circuit-green: #22C55E;
  --color-robotics-bg: #0F172A;
  --color-robotics-surface: #1E293B;

  --font-display: 'Chillax', 'Nunito', sans-serif;
  --font-body: 'Nunito', sans-serif;

  --shadow-sm: 0 1px 2px rgba(124, 58, 237, 0.06);
  --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.1);
  --shadow-lg: 0 12px 32px rgba(124, 58, 237, 0.15);

  --radius-card: 1.25rem;
}

/* ============================================
   HEADER — transparent over dark hero
   ============================================ */

.site-header {
  background: rgba(15, 23, 42, 0);
}

.site-header.scrolled {
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header:not(.scrolled) .nav-logo,
.site-header:not(.scrolled) .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}

.site-header:not(.scrolled) .nav-links a:hover,
.site-header:not(.scrolled) .nav-links a.active {
  color: #fff;
}

.site-header:not(.scrolled) .nav-links a.active::after {
  background: var(--color-robotics-accent);
}

.site-header:not(.scrolled) .hamburger span {
  background: #fff;
}

.site-header.scrolled .nav-logo,
.site-header.scrolled .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}

.site-header.scrolled .nav-links a:hover,
.site-header.scrolled .nav-links a.active {
  color: #fff;
}

.site-header.scrolled .hamburger span {
  background: #fff;
}

/* ============================================
   SCROLL ANIMATION HERO
   ============================================ */

.robo-hero {
  position: relative;
  height: 500vh;
  background: var(--color-robotics-bg);
}

.robo-hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Circuit-board background pattern */
.robo-hero-sticky::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(249, 115, 22, 0.08) 1px, transparent 0);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.robo-canvas-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

#robotCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile video fallback */
.robo-video-fallback {
  display: none;
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-xl);
}

.robo-hero-mobile {
  height: auto !important;
}

.robo-hero-mobile .robo-hero-sticky {
  position: relative !important;
  height: auto !important;
  min-height: auto !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-32) var(--space-6) var(--space-16);
  gap: var(--space-8);
}

.robo-hero-mobile .robo-canvas-wrap {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 360px;
  height: auto;
}

.robo-hero-mobile .robo-video-fallback {
  display: block;
  width: 100%;
  height: auto;
}

.robo-hero-mobile #robotCanvas {
  display: none;
}

.robo-hero-mobile .robo-overlay {
  position: relative !important;
  opacity: 1 !important;
  background: none !important;
  padding: 0 !important;
  display: block !important;
}

.robo-hero-mobile .robo-overlay.hidden-mobile {
  display: none !important;
}

.robo-hero-mobile .robo-scroll-indicator {
  display: none !important;
}

/* Text overlays */
.robo-overlay {
  position: absolute;
  z-index: 10;
  width: 100%;
  padding: 0 var(--space-6);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  /* Dark gradient behind text for readability */
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.75) 0%, transparent 70%);
}

.robo-overlay.visible {
  opacity: 1;
}

.robo-overlay-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.robo-overlay-title .accent {
  color: var(--color-robotics-accent);
}

.robo-overlay-subtitle {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.robo-overlay-cta {
  pointer-events: auto;
}

.robo-overlay-cta .btn {
  background: var(--color-robotics-accent);
  color: #fff;
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.4);
}

.robo-overlay-cta .btn:hover {
  background: #EA580C;
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.5);
}

/* Scroll indicator */
.robo-scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--text-xs);
  animation: bounce-down 2s ease-in-out infinite;
}

.robo-scroll-indicator svg {
  width: 24px;
  height: 24px;
}

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

/* ============================================
   COURSE OVERVIEW
   ============================================ */

.overview-section {
  background: var(--color-bg);
}

.overview-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-10);
}

.overview-intro .age-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: rgba(249, 115, 22, 0.1);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-robotics-accent);
  margin-bottom: var(--space-6);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.overview-card {
  padding: var(--space-8);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  text-align: center;
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
  position: relative;
  overflow: hidden;
}

.overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.overview-card:nth-child(1)::before { background: var(--color-robotics-accent); }
.overview-card:nth-child(2)::before { background: var(--color-circuit-green); }
.overview-card:nth-child(3)::before { background: var(--color-primary); }
.overview-card:nth-child(4)::before { background: var(--color-accent); }

.overview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.overview-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 1.75rem;
}

.overview-card:nth-child(1) .overview-card-icon { background: rgba(249, 115, 22, 0.1); }
.overview-card:nth-child(2) .overview-card-icon { background: rgba(34, 197, 94, 0.1); }
.overview-card:nth-child(3) .overview-card-icon { background: rgba(124, 58, 237, 0.1); }
.overview-card:nth-child(4) .overview-card-icon { background: rgba(14, 165, 233, 0.1); }

.overview-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.overview-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   SYLLABUS TIMELINE
   ============================================ */

.syllabus-section {
  background: var(--color-surface-2);
  position: relative;
  overflow: hidden;
}

/* Decorative gear */
.syllabus-section::before {
  content: '';
  position: absolute;
  top: 80px;
  right: -60px;
  width: 200px;
  height: 200px;
  border: 8px dashed rgba(124, 58, 237, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.syllabus-timeline {
  position: relative;
  max-width: 900px;
  margin: var(--space-10) auto 0;
}

/* Vertical line */
.syllabus-timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(
    to bottom,
    var(--color-robotics-accent),
    var(--color-circuit-green),
    var(--color-primary),
    var(--color-accent),
    var(--color-coral),
    var(--color-gold)
  );
  border-radius: 2px;
}

.syllabus-term {
  position: relative;
  padding-left: 72px;
  padding-bottom: var(--space-10);
}

.syllabus-term:last-child {
  padding-bottom: 0;
}

/* Term dot */
.syllabus-dot {
  position: absolute;
  left: 14px;
  top: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  color: #fff;
  z-index: 2;
}

.syllabus-term:nth-child(1) .syllabus-dot { background: var(--color-robotics-accent); }
.syllabus-term:nth-child(2) .syllabus-dot { background: var(--color-circuit-green); }
.syllabus-term:nth-child(3) .syllabus-dot { background: var(--color-primary); }
.syllabus-term:nth-child(4) .syllabus-dot { background: var(--color-accent); }
.syllabus-term:nth-child(5) .syllabus-dot { background: var(--color-coral); }
.syllabus-term:nth-child(6) .syllabus-dot { background: var(--color-gold); }

.syllabus-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  padding: var(--space-6) var(--space-8);
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
}

.syllabus-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.syllabus-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.syllabus-card-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}

.syllabus-level {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.syllabus-term:nth-child(1) .syllabus-level {
  background: rgba(249, 115, 22, 0.1);
  color: var(--color-robotics-accent);
}
.syllabus-term:nth-child(2) .syllabus-level {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-circuit-green);
}
.syllabus-term:nth-child(3) .syllabus-level {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-primary);
}
.syllabus-term:nth-child(4) .syllabus-level {
  background: rgba(14, 165, 233, 0.1);
  color: var(--color-accent);
}
.syllabus-term:nth-child(5) .syllabus-level {
  background: rgba(249, 115, 22, 0.1);
  color: #EA580C;
}
.syllabus-term:nth-child(6) .syllabus-level {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-gold);
}

.syllabus-topics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2) var(--space-6);
  margin-bottom: var(--space-4);
}

.syllabus-topics li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.syllabus-topics li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  margin-top: 8px;
}

.syllabus-term:nth-child(1) .syllabus-topics li::before { background: var(--color-robotics-accent); }
.syllabus-term:nth-child(2) .syllabus-topics li::before { background: var(--color-circuit-green); }
.syllabus-term:nth-child(3) .syllabus-topics li::before { background: var(--color-primary); }
.syllabus-term:nth-child(4) .syllabus-topics li::before { background: var(--color-accent); }
.syllabus-term:nth-child(5) .syllabus-topics li::before { background: #EA580C; }
.syllabus-term:nth-child(6) .syllabus-topics li::before { background: var(--color-gold); }

.syllabus-project {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.syllabus-project svg {
  color: var(--color-robotics-accent);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .syllabus-timeline::before {
    left: 16px;
  }
  .syllabus-dot {
    left: 2px;
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }
  .syllabus-term {
    padding-left: 52px;
  }
  .syllabus-topics {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   HOW IT WORKS (Robotics)
   ============================================ */

.robo-how-section {
  background: var(--color-bg);
}

.robo-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
  position: relative;
}

.robo-steps-grid::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg,
    var(--color-robotics-accent),
    var(--color-circuit-green),
    var(--color-primary),
    var(--color-accent)
  );
  border-radius: 2px;
}

.robo-step {
  text-align: center;
  position: relative;
}

.robo-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
}

.robo-step:nth-child(1) .robo-step-number { background: var(--color-robotics-accent); }
.robo-step:nth-child(2) .robo-step-number { background: var(--color-circuit-green); }
.robo-step:nth-child(3) .robo-step-number { background: var(--color-primary); }
.robo-step:nth-child(4) .robo-step-number { background: var(--color-accent); }

.robo-step h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.robo-step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 240px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .robo-steps-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .robo-steps-grid::before { display: none; }
}

@media (max-width: 480px) {
  .robo-steps-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PRICING (single card)
   ============================================ */

.robo-pricing-section {
  background: var(--color-surface-2);
}

.robo-pricing-wrap {
  max-width: 480px;
  margin: var(--space-10) auto 0;
}

.robo-pricing-card {
  padding: var(--space-10);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 2px solid var(--color-robotics-accent);
  text-align: center;
  position: relative;
  box-shadow: 0 8px 40px rgba(249, 115, 22, 0.12);
}

.robo-pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-5);
  background: var(--color-robotics-accent);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.robo-pricing-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  margin-top: var(--space-2);
}

.robo-pricing-amount {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-robotics-accent);
  margin-bottom: var(--space-1);
}

.robo-pricing-period {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.robo-pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  text-align: left;
}

.robo-pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.robo-pricing-features li::before {
  content: '✓';
  color: var(--color-circuit-green);
  font-weight: 700;
  flex-shrink: 0;
}

.robo-pricing-card .btn {
  width: 100%;
  background: var(--color-robotics-accent);
  color: #fff;
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  font-weight: 700;
}

.robo-pricing-card .btn:hover {
  background: #EA580C;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

/* ============================================
   FAQ (shared classes, robotics bg)
   ============================================ */

.robo-faq-section {
  background: var(--color-bg);
}

.robo-faq-section .faq-list {
  max-width: 720px;
  margin: var(--space-10) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.robo-faq-section .faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.robo-faq-section .faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
}

.robo-faq-section .faq-question svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--color-text-muted);
}

.robo-faq-section .faq-item.active .faq-question svg {
  transform: rotate(180deg);
}

.robo-faq-section .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.robo-faq-section .faq-answer-inner {
  padding: 0 var(--space-6) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   BOTTOM CTA
   ============================================ */

.robo-cta-bottom {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 40%, #0F172A 100%);
  color: white;
  text-align: center;
  padding: clamp(var(--space-16), 8vw, var(--space-24)) var(--space-6);
  position: relative;
  overflow: hidden;
}

.robo-cta-bottom::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(249, 115, 22, 0.06) 1px, transparent 0);
  background-size: 48px 48px;
  pointer-events: none;
}

.robo-cta-bottom h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  position: relative;
}

.robo-cta-bottom p {
  font-size: var(--text-lg);
  opacity: 0.85;
  margin: 0 auto var(--space-8);
  max-width: 520px;
  position: relative;
}

.robo-cta-bottom .btn {
  background: var(--color-robotics-accent);
  color: #fff;
  font-weight: 700;
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
  position: relative;
}

.robo-cta-bottom .btn:hover {
  background: #EA580C;
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.4);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

[data-theme="dark"] {
  --color-bg: #0F172A;
  --color-surface: #1E293B;
  --color-surface-2: #151E2E;
  --color-surface-offset: #1E293B;
  --color-surface-offset-2: #334155;
  --color-divider: #334155;
  --color-border: #475569;
  --color-text: #F1F5F9;
  --color-text-muted: #94A3B8;
  --color-text-faint: #64748B;
}

[data-theme="dark"] .site-header.scrolled {
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .robo-overlay-title {
    font-size: var(--text-2xl);
  }
}
