/**
 * OCARS.MA V3 — Design System
 * Modern Automotive Brutalism
 * Mobile-First • Electric Palette • Lexend Deca + DM Sans
 */

/* ════════════════════════════════════════════════════════
   FONTS
   ════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@400;500;600;700;800;900&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ════════════════════════════════════════════════════════
   VARIABLES — Electric Palette
   ════════════════════════════════════════════════════════ */
:root {
  /* Colors */
  --primary:   #0066FF;  /* Bleu électrique */
  --secondary: #00D9A3;  /* Vert néon */
  --accent:    #FF6B35;  /* Orange vif */
  --dark:      #0F1419;  /* Anthracite profond */
  --gray-900:  #1A1D29;
  --gray-800:  #2D3142;
  --gray-700:  #4F5565;
  --gray-600:  #64748B;
  --gray-500:  #94A3B8;
  --gray-400:  #CBD5E1;
  --gray-300:  #E2E8F0;
  --gray-200:  #F1F5F9;
  --gray-100:  #F8FAFC;
  --white:     #FFFFFF;
  
  /* Semantic */
  --success: #10B981;
  --warning: #F59E0B;
  --error:   #EF4444;
  --info:    var(--primary);
  
  /* Shadows */
  --shadow-sm:  0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-xl:  0 25px 50px -12px rgba(0,0,0,0.25);
  
  /* Border radius */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Container */
  --container: 1280px;
  
  /* Header height */
  --header-h: 68px;
}

/* ════════════════════════════════════════════════════════
   TYPOGRAPHY
   ════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.text-xs   { font-size: 0.75rem; line-height: 1.4; }
.text-sm   { font-size: 0.875rem; line-height: 1.5; }
.text-base { font-size: 1rem; line-height: 1.6; }
.text-lg   { font-size: 1.125rem; line-height: 1.6; }
.text-xl   { font-size: 1.25rem; line-height: 1.5; }
.text-2xl  { font-size: 1.5rem; line-height: 1.4; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-tight { letter-spacing: -0.02em; }
.tracking-wide  { letter-spacing: 0.05em; }

/* ════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ════════════════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Spacing */
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

/* ════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow 0.3s;
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.logo {
  font-family: 'Lexend Deca', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-bar {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-bar input {
  width: 100%;
  height: 44px;
  padding: 0 1rem 0 3rem;
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s;
}

.search-bar input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

.search-bar svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
  background: rgba(0, 102, 255, 0.05);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .search-bar { display: none; }
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* ════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
  background: #0052CC;
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--dark);
  box-shadow: 0 4px 12px rgba(0, 217, 163, 0.3);
}

.btn-secondary:hover {
  background: #00C794;
}

.btn-outline {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 102, 255, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--dark);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════ */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--gray-300);
}

.car-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.car-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--gray-100);
}

.car-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.car-card:hover .car-thumb img {
  transform: scale(1.05);
}

.car-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.car-badge.new {
  background: var(--primary);
}

.car-badge.featured {
  background: var(--accent);
}

.car-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.car-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.spec-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.car-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--gray-200);
}

.car-price {
  font-family: 'Lexend Deca', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.car-location {
  font-size: 0.875rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: white;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--dark);
  outline: none;
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* ════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════ */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-gray { color: var(--gray-600); }
.text-muted { color: var(--gray-500); }

.bg-primary { background: var(--primary); }
.bg-secondary { background: var(--secondary); }
.bg-gray { background: var(--gray-100); }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.transition { transition: all 0.2s; }
