@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ──────────────────────────────────── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1e2a42;
  --bg-glass: rgba(26, 34, 54, 0.7);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  --gradient-brand: linear-gradient(135deg, #3b82f6, #06b6d4);
  --gradient-hero: linear-gradient(180deg, #0a0e1a 0%, #111827 50%, #0a0e1a 100%);
  --gradient-card: linear-gradient(145deg, #1a2236 0%, #151d30 100%);

  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-accent: rgba(59, 130, 246, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-cyan); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-blue); }
img { max-width: 100%; height: auto; }

/* ─── Utility ────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ─── Navbar ─────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
  transition: background var(--transition-normal);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
}
.navbar-brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.navbar-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.navbar-links a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  transition: color var(--transition-fast);
}
.navbar-links a:hover { color: var(--text-primary); }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border: none; border-radius: var(--radius-full);
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition-normal);
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-brand); color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
  color: white;
}
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-accent);
}
.btn-outline:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}
.btn-sm { padding: 8px 20px; font-size: 0.85rem; }
.btn-strava {
  background: #FC4C02; color: white;
  box-shadow: 0 4px 16px rgba(252, 76, 2, 0.3);
}
.btn-strava:hover {
  background: #e44502; transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(252, 76, 2, 0.4);
  color: white;
}

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  position: relative; padding: 160px 0 120px;
  background: var(--gradient-hero);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
  animation: pulse-bg 8s ease-in-out infinite alternate;
}
@keyframes pulse-bg {
  from { opacity: 0.5; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}
.hero-content {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.hero-text h1 {
  font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.hero-text p {
  font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 40px;
  max-width: 500px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual {
  display: flex; justify-content: center; align-items: center;
  perspective: 1000px;
}
.hero-card {
  background: var(--gradient-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: float 6s ease-in-out infinite;
  max-width: 380px; width: 100%;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotateX(2deg); }
  50%      { transform: translateY(-12px) rotateX(-2deg); }
}
.hero-gauge { margin-bottom: 24px; }
.hero-gauge-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px;
}
.hero-gauge-label .pct { font-weight: 700; color: var(--accent-yellow); }
.hero-gauge-bar {
  height: 8px; background: rgba(255,255,255,0.05); border-radius: var(--radius-full);
  overflow: hidden;
}
.hero-gauge-fill {
  height: 100%; border-radius: var(--radius-full);
  transition: width 1.5s ease;
}
.fill-green  { background: var(--accent-green); width: 35%; }
.fill-yellow { background: var(--accent-yellow); width: 78%; }
.fill-red    { background: var(--accent-red); width: 95%; }

.hero-bike-name {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 4px;
}
.hero-bike-km {
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px;
}

/* ─── Features ───────────────────────────────────────── */
.features { padding: 120px 0; }
.section-header {
  text-align: center; margin-bottom: 64px;
}
.section-header h2 {
  font-size: 2.5rem; font-weight: 800; margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.section-header p { color: var(--text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature-card {
  background: var(--gradient-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 32px;
  transition: all var(--transition-normal);
}
.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}
.feature-icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}
.feature-icon.blue   { background: rgba(59, 130, 246, 0.15); }
.feature-icon.cyan   { background: rgba(6, 182, 212, 0.15); }
.feature-icon.green  { background: rgba(16, 185, 129, 0.15); }
.feature-icon.yellow { background: rgba(245, 158, 11, 0.15); }
.feature-icon.purple { background: rgba(139, 92, 246, 0.15); }
.feature-icon.red    { background: rgba(239, 68, 68, 0.15); }

.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ─── Pricing ────────────────────────────────────────── */
.pricing { padding: 120px 0; background: var(--bg-secondary); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px;
  max-width: 800px; margin: 0 auto;
}
.pricing-card {
  background: var(--gradient-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 40px;
  transition: all var(--transition-normal);
}
.pricing-card.featured {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
  position: relative;
}
.pricing-card.featured::before {
  content: 'POPULAIRE'; position: absolute; top: -12px; right: 24px;
  background: var(--gradient-brand); color: white;
  padding: 4px 16px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
}
.pricing-plan { font-size: 0.85rem; font-weight: 600; color: var(--accent-cyan); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.pricing-price { font-size: 3rem; font-weight: 800; margin-bottom: 8px; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 32px; }
.pricing-features { list-style: none; margin-bottom: 32px; }
.pricing-features li {
  padding: 8px 0; color: var(--text-secondary); font-size: 0.9rem;
  display: flex; align-items: center; gap: 12px;
}
.pricing-features li::before { content: '✓'; color: var(--accent-green); font-weight: 700; }

/* ─── Footer ─────────────────────────────────────────── */
.footer {
  padding: 48px 0; border-top: 1px solid var(--border-subtle);
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
}

/* ─── Dashboard ──────────────────────────────────────── */
.dashboard { padding: 100px 0 60px; min-height: 100vh; }
.dashboard-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 40px;
}
.dashboard-header h1 { font-size: 2rem; font-weight: 800; }
.dashboard-actions { display: flex; gap: 12px; }

.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--gradient-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 24px;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.bikes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px;
}
.bike-card {
  background: var(--gradient-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition-normal);
}
.bike-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}
.bike-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 24px 16px;
}
.bike-card-header h3 { font-size: 1.15rem; font-weight: 700; }
.bike-type-badge {
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-road   { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge-mtb    { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-gravel { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.badge-city   { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.badge-ebike  { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

.bike-card-meta {
  padding: 0 24px 20px; font-size: 0.85rem; color: var(--text-muted);
  display: flex; gap: 16px;
}

.components-list { padding: 0 24px 24px; }
.component-row {
  padding: 16px 0; border-top: 1px solid var(--border-subtle);
}
.component-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.component-name { font-size: 0.9rem; font-weight: 600; }
.component-pct { font-size: 0.85rem; font-weight: 700; }
.component-pct.green  { color: var(--accent-green); }
.component-pct.yellow { color: var(--accent-yellow); }
.component-pct.red    { color: var(--accent-red); }

.wear-bar {
  height: 6px; background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full); overflow: hidden;
}
.wear-bar-fill {
  height: 100%; border-radius: var(--radius-full);
  transition: width 1s ease, background 0.5s ease;
}
.wear-bar-fill.green  { background: var(--accent-green); }
.wear-bar-fill.yellow { background: var(--accent-yellow); }
.wear-bar-fill.red    { background: var(--accent-red); }

.component-meta {
  display: flex; gap: 16px; margin-top: 6px;
  font-size: 0.75rem; color: var(--text-muted);
}

.empty-state {
  text-align: center; padding: 80px 24px;
  color: var(--text-secondary);
}
.empty-state h2 { font-size: 1.5rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 24px; }

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all var(--transition-normal);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 32px;
  max-width: 500px; width: 90%;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 8px;
}
.form-group input, .form-group select {
  width: 100%; padding: 12px 16px;
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--accent-blue);
}
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ─── Toast ──────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 12px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 16px 20px;
  box-shadow: var(--shadow-md);
  animation: slide-in 0.3s ease;
  display: flex; align-items: center; gap: 12px;
  font-size: 0.9rem; min-width: 300px;
}
.toast.success { border-color: var(--accent-green); }
.toast.error   { border-color: var(--accent-red); }
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-text h1 { font-size: 2.5rem; }
  .hero-text p { margin: 0 auto 40px; }
  .hero-actions { justify-content: center; }
  .hero-visual { margin-top: 40px; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .bikes-grid { grid-template-columns: 1fr; }
  .navbar-links { display: none; }
  .dashboard-header { flex-direction: column; gap: 16px; text-align: center; }
}
