/* ============================================================
   style.css — Core Styles for Robotics Education Platform
   ============================================================ */

/* ─── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS CUSTOM PROPERTIES ────────────────────────────────── */
:root {
  /* Colors */
  --color-primary:        #00d4ff;
  --color-primary-dark:   #00a8cc;
  --color-primary-rgb:    0, 212, 255;
  --color-accent:         #0066ff;
  --color-accent-rgb:     0, 102, 255;
  --color-bg-dark:        #0a0e1a;
  --color-bg-darker:      #060911;
  --color-bg-section:     #0d1117;
  --color-bg-section-alt: #111827;
  --color-bg-card:        rgba(255, 255, 255, 0.05);
  --color-bg-card-hover:  rgba(255, 255, 255, 0.08);
  --color-text:           #c9d1d9;
  --color-text-secondary: #8b949e;
  --color-text-heading:   #f0f6fc;
  --color-border:         rgba(255, 255, 255, 0.1);
  --color-border-hover:   rgba(0, 212, 255, 0.35);
  --color-success:        #00e676;
  --color-warning:        #ffab00;
  --color-danger:         #ff5252;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm:   0 2px 8px  rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px   rgba(0, 212, 255, 0.15);

  /* Motion */
  --transition:      0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --container-width:  1200px;
  --navbar-height:    70px;
  --section-padding:  100px;
}

/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(var(--color-primary-rgb), 0.25);
  color: var(--color-primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-darker); }
::-webkit-scrollbar-thumb { background: rgba(var(--color-primary-rgb), 0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ─── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2.25rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p { color: var(--color-text); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  padding: 2px 7px;
  border-radius: 4px;
}

pre {
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  color: var(--color-text);
}

/* ─── LAYOUT ───────────────────────────────────────────────── */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
}

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

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── TEXT GRADIENT ────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── GRID SYSTEM ──────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── NAVBAR ───────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text-heading);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.nav-logo__icon {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.nav-logo__text {
  letter-spacing: 3px;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  display: block;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-search-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}

.nav-search-btn:hover {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.1);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO ─────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-dark);
  padding-top: var(--navbar-height);
}

/* Radial glow orb */
.hero::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(var(--color-primary-rgb), 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle dot grid */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.hero__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  max-width: var(--container-width);
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

.hero__content {
  z-index: 1;
}

.hero__title {
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  line-height: 1.75;
  max-width: 520px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}

.hero__visual svg {
  filter: drop-shadow(0 0 30px rgba(var(--color-primary-rgb), 0.25));
  max-width: 100%;
  height: auto;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  width: 100%;
  max-width: var(--container-width);
  padding: 40px 24px;
  border-top: 1px solid var(--color-border);
  position: relative;
  z-index: 1;
}

.hero__stat {
  text-align: center;
}

.hero__stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.hero__stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(var(--color-primary-rgb), 0.3);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(var(--color-primary-rgb), 0.35);
}

.btn--secondary:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

/* ─── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1;
}

.badge--beginner {
  background: rgba(0, 230, 118, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge--intermediate {
  background: rgba(255, 171, 0, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(255, 171, 0, 0.2);
}

.badge--advanced {
  background: rgba(255, 82, 82, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(255, 82, 82, 0.2);
}

.badge--category {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

/* ─── FOOTER ───────────────────────────────────────────────── */
.footer {
  background: var(--color-bg-darker);
  padding: 64px 0 32px;
  border-top: 1px solid var(--color-border);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--color-text-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 2px;
}

.footer__logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.footer__description {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.footer__title {
  color: var(--color-text-heading);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
  display: block;
}

.footer__link:hover {
  color: var(--color-primary);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.footer__copyright,
.footer__tagline {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* ─── ANIMATIONS ───────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.15); }
  50%       { box-shadow: 0 0 25px rgba(var(--color-primary-rgb), 0.35); }
}

/* ─── UTILITY ──────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
  display: block;
}

.empty-state__text {
  color: var(--color-text-secondary);
  font-size: 1rem;
}
