/* ============================================================
   K4MKids Typing - Main Stylesheet
   ============================================================ */

/* CSS Custom Properties */
:root {
  --primary: #4A90D9;
  --primary-dark: #3A7BC8;
  --primary-light: #6BA8E8;
  --secondary: #FF6B6B;
  --secondary-dark: #E55A5A;
  --accent: #FFD93D;
  --accent-dark: #F0C829;
  --success: #6BCB77;
  --success-dark: #55B863;
  --purple: #9B59B6;
  --orange: #FFA07A;
  --bg: #F0F4FF;
  --card: #FFFFFF;
  --text-dark: #2D3436;
  --text-medium: #636E72;
  --text-light: #B2BEC3;
  --border: #DFE6E9;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(74, 144, 217, 0.12);
  --shadow-hover: 0 8px 32px rgba(74, 144, 217, 0.18);
  --font-heading: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; color: var(--text-dark); }
h1 { font-size: 2.5rem; } h2 { font-size: 2rem; } h3 { font-size: 1.5rem; } h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--text-medium); }
ul, ol { list-style: none; }

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* Navigation */
.main-nav {
  position: sticky; top: 0; z-index: 1000;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 0.5rem 0;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-heading); font-size: 1.4rem;
  color: var(--primary); text-decoration: none;
}
.nav-logo:hover { color: var(--primary-dark); }
.logo-icon { display: flex; align-items: center; }
.logo-text { white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-link {
  font-weight: 700; font-size: 0.95rem; color: var(--text-dark);
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-link:hover { color: var(--primary); background: rgba(74,144,217,0.08); }
.nav-link-cta {
  background: var(--primary); color: white !important; border-radius: 25px; padding: 0.5rem 1.25rem;
}
.nav-link-cta:hover { background: var(--primary-dark); }
.nav-link-outline {
  border: 2px solid var(--secondary); color: var(--secondary) !important; border-radius: 25px;
}
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0.5rem;
}
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--text-dark); border-radius: 3px; transition: 0.3s; }

/* Flash Messages */
.flash {
  padding: 1rem 1.5rem; margin: 1rem auto; max-width: 1200px;
  border-radius: var(--radius-sm); font-weight: 700; cursor: pointer;
  animation: slideIn 0.4s ease; transition: opacity 0.3s, transform 0.3s;
}
.flash-success { background: #E8F8EA; color: #2D7738; border-left: 5px solid var(--success); }
.flash-error { background: #FDEAEA; color: #B73232; border-left: 5px solid var(--secondary); }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow); transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover { box-shadow: var(--shadow-hover); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-heading); font-size: 1rem;
  padding: 0.75rem 1.75rem; border: none; border-radius: 25px;
  cursor: pointer; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
  position: relative; user-select: none;
}
.btn:hover { transform: scale(1.05) translateY(-2px); }
.btn:active { transform: scale(0.97) translateY(1px); box-shadow: none; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(74,144,217,0.35); }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--secondary); color: white; box-shadow: 0 4px 12px rgba(255,107,107,0.35); }
.btn-secondary:hover { background: var(--secondary-dark); color: white; }
.btn-success { background: var(--success); color: white; box-shadow: 0 4px 12px rgba(107,203,119,0.35); }
.btn-success:hover { background: var(--success-dark); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-large { font-size: 1.25rem; padding: 1rem 2.5rem; }
.btn-small { font-size: 0.875rem; padding: 0.5rem 1.25rem; }
.bounce-hover:hover { animation: bounce 0.5s; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-family: var(--font-heading); font-size: 1rem; color: var(--text-dark); margin-bottom: 0.5rem; }
.form-control {
  width: 100%; padding: 0.85rem 1.25rem; font-family: var(--font-body); font-size: 1rem;
  color: var(--text-dark); background: var(--card);
  border: 3px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(74,144,217,0.15); }
.form-control::placeholder { color: var(--text-light); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23636E72' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}

/* Footer */
.main-footer {
  background: var(--card); text-align: center; padding: 2rem 1.5rem;
  margin-top: 3rem; box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.main-footer p { color: var(--text-medium); font-size: 0.9rem; margin: 0; }

/* Grid */
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #4A90D9 0%, #9B59B6 50%, #FF6B6B 100%);
  color: white; padding: 4rem 1.5rem; text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 10%, transparent 60%);
  animation: float 8s ease-in-out infinite;
}
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: 3rem; color: white; margin-bottom: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.hero-subtitle { font-size: 1.25rem; color: rgba(255,255,255,0.9); max-width: 600px; margin: 0 auto 2rem; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.text-gradient { background: linear-gradient(90deg, #FFD93D, #FFA07A); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-vehicles { display: flex; justify-content: center; gap: 3rem; margin-top: 2rem; position: relative; z-index: 1; }
.hero-vehicle { animation: float 3s ease-in-out infinite; }
.hero-vehicle-1 { animation-delay: 0s; }
.hero-vehicle-2 { animation-delay: 0.5s; }
.hero-vehicle-3 { animation-delay: 1s; }

/* Feature Cards */
.feature-card { text-align: center; }
.feature-card h3 { margin: 1rem 0 0.5rem; }
.feature-icon {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}

/* Section Titles */
.section-title { margin-bottom: 2rem; }

/* Steps / How It Works */
.steps { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.step { text-align: center; max-width: 200px; }
.step h3 { font-size: 1.1rem; margin: 0.5rem 0 0.25rem; }
.step p { font-size: 0.9rem; }
.step-number {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--primary); color: white; font-family: var(--font-heading);
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.step-arrow { display: flex; align-items: center; }

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, #6BCB77, #4A90D9);
  padding: 3rem 1.5rem; border-radius: var(--radius-lg); margin: 3rem 1.5rem;
  color: white;
}
.cta-section h2 { color: white; margin-bottom: 0.5rem; }
.cta-section p { color: rgba(255,255,255,0.9); }

/* Stat Cards */
.stat-card { text-align: center; padding: 1.5rem; border-radius: var(--radius); }
.stat-card-value { font-family: var(--font-heading); font-size: 2rem; line-height: 1; }
.stat-card-label { font-size: 0.85rem; color: var(--text-medium); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-blue .stat-card-value { color: var(--primary); }
.stat-green .stat-card-value { color: var(--success); }
.stat-yellow .stat-card-value { color: var(--accent-dark); }
.stat-purple .stat-card-value { color: var(--purple); }

/* Vehicle Selection */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.vehicle-option { cursor: pointer; }
.vehicle-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.vehicle-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem; background: var(--card); border: 3px solid var(--border);
  border-radius: var(--radius); transition: all 0.2s; text-align: center;
}
.vehicle-card span { font-family: var(--font-heading); font-size: 0.8rem; }
.vehicle-card:hover { border-color: var(--primary-light); transform: scale(1.05); }
.vehicle-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,144,217,0.2); background: rgba(74,144,217,0.03); }

/* Progress Bar */
.progress-bar-container { margin-bottom: 1rem; }
.progress-bar-bg { width: 100%; height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); border-radius: 6px; transition: width 0.6s; }
.progress-label { font-size: 0.8rem; color: var(--text-medium); margin-top: 0.25rem; }

/* Animations */
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes slideIn { 0%{opacity:0;transform:translateY(16px)} 100%{opacity:1;transform:translateY(0)} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.shake { animation: shake 0.3s; }

/* Responsive - Tablet */
@media (max-width: 768px) {
  h1 { font-size: 2rem; } h2 { font-size: 1.6rem; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 75%; max-width: 300px;
    height: 100vh; background: var(--card); flex-direction: column;
    align-items: flex-start; padding: 5rem 2rem 2rem;
    box-shadow: var(--shadow-hover); transition: right 0.3s; z-index: 999;
  }
  .nav-links.open { right: 0; }
  .nav-links .nav-link { width: 100%; padding: 0.75rem; font-size: 1.1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 3rem 1.5rem; }
  .hero-title { font-size: 2.2rem; }
  .steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.75rem; }
  .hero-vehicles { gap: 1rem; }
  .hero-vehicle svg { width: 60px; height: auto; }
  .card { padding: 1.5rem; }
  .btn-large { font-size: 1.1rem; padding: 0.85rem 2rem; }
  .vehicle-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-buttons { flex-direction: column; align-items: center; }
}
