/* ============================================================================
   GLOBAL DESIGN SYSTEM - PREMIUM LIMO REFACTORED
   STRICT TOKEN-BASED THEMING FOR LIGHT & DARK MODES
   NO HARDCODED COLORS - TOKENS ONLY
   ============================================================================ */

:root,
html[data-theme="light"] {
  /* ========== CORE COLOR TOKENS ========== */
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface-2: #f0f2f5;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --muted: #888888;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.15);
  
  /* Accent colors (consistent across themes) */
  --accent: #d4af37;
  --accent-2: #b8941d;
  --focus: #d4af37;
  
  /* Semantic colors */
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  
  /* Hero overlays */
  --hero-overlay: rgba(0, 0, 0, 0.4);
  --header-bg: rgba(0, 0, 0, 0.5);
  
  /* ========== SPACING TOKENS ========== */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* ========== BORDER RADIUS ========== */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* ========== TYPOGRAPHY ========== */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
}

/* ========== DARK MODE TOKENS ========== */
html[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #252525;
  --text: #f5f5f5;
  --text-secondary: #b8b8b8;
  --muted: #6a6a6a;
  --border: #333333;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  
  /* Hero overlays - darker for better text contrast */
  --hero-overlay: rgba(0, 0, 0, 0.65);
  --header-bg: rgba(0, 0, 0, 0.75);
}

/* Auto dark mode from system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface-2: #252525;
    --text: #f5f5f5;
    --text-secondary: #b8b8b8;
    --muted: #6a6a6a;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --hero-overlay: rgba(0, 0, 0, 0.65);
    --header-bg: rgba(0, 0, 0, 0.75);
  }
}

/* ============================================================================
   BASE ELEMENT STYLING
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--accent);
  line-height: 1.3;
}

/* Override for card headings and other special cases */
.card h3,
.commitment-card h3,
.benefit-card h3,
.fleet-card h3,
.info-card h3,
.service-item h3 {
  color: var(--text);
}

/* ========== LAYOUT CONTAINER SYSTEM ========== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding-block: var(--space-3xl);
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--space-2xl);
  }
}

/* ============================================================================
   SMART GRID SYSTEM - NO ORPHAN CARDS
   ============================================================================ */

.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

/* Force 2x2 layout for exactly 4-6 items at desktop */
@media (min-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3-column for 6 items */
@media (min-width: 900px) {
  .grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Last item centering for orphans */
.grid.center-orphan > *:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 450px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .grid,
  .grid-4,
  .grid-6 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   CARD COMPONENT - CONSISTENT PADDING & HEIGHT
   ============================================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  box-shadow: 0 8px 24px var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent), #f4d03f);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 1.75rem;
  color: #000;
  flex-shrink: 0;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
  color: var(--text);
  line-height: 1.3;
  text-align: center;
}

.card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
  flex-grow: 1;
  text-align: center;
}

/* ============================================================================
   FORM CONTROLS - FULLY TOKENIZED (NO HARDCODED COLORS)
   ============================================================================ */

input,
select,
textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  transition: all 0.3s ease;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Fix autofill styling in both themes */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--surface) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  transition: background-color 5000s ease-in-out 0s;
  border-color: var(--border);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn,
button.btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.btn:hover,
button.btn:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================================
   FOOTER - MINIMAL COPYRIGHT BAR
   ============================================================================ */

.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
  margin-top: var(--space-3xl);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.footer-content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-copyright {
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-center {
  text-align: center;
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  color: var(--text);
  margin-bottom: var(--space-xl);
}

.section-title.centered {
  text-align: center;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  z-index: 1000;
  transition: all 0.3s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (min-width: 769px) {
  .header {
    background-image: url('images/header-desktop.jpg');
  }
}

@media (max-width: 768px) {
  .header {
    background-image: url('images/header-phone.jpg');
  }
}

.navbar {
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 90px;
  width: auto;
  display: block;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 1.5rem;
}

.nav-item.mobile-book {
  display: none;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.book-now-btn {
  background: linear-gradient(135deg, var(--accent), #f4d03f);
  color: #000;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.book-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.book-now-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.2);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  width: 28px;
  height: 22px;
}

.bar {
  position: absolute;
  left: 0;
  width: 28px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  margin: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
  transform-origin: center center;
}

.hamburger .bar:nth-child(1) { top: 4px; }
.hamburger .bar:nth-child(2) { top: 10px; }
.hamburger .bar:nth-child(3) { top: 16px; }

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-container {
    position: relative;
  }
  
  .nav-menu,
  .nav-actions {
    display: none;
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-menu.active {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    background: #000;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1001;
    opacity: 1;
    animation: menuFadeIn 180ms ease-out;
  }
  
  .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
  }
  
  .nav-link {
    padding: 0.875rem 20px;
    font-size: 1.5rem;
    display: block;
    width: 100%;
    text-align: left;
  }
  
  .hamburger.active .bar:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
  }
  
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active .bar:nth-child(3) {
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
  }
  
  .nav-menu.active .nav-item.mobile-book {
    display: block;
  }
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   THEME TOGGLE BUTTON
   ============================================================================ */

.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text, #fff);
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.5);
  color: var(--accent);
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}
