/* ===== CSS Variables ===== */
:root {
  /* BMW M-Sport Inspired Color Palette */
  --primary-color: #1c69d4; /* BMW Blue */
  --primary-dark: #0f4c9e;
  --primary-light: #2d7de8;
  --accent-color: #e31e24; /* M-Sport Red */
  --accent-dark: #b91419;
  
  /* Dark Theme Backgrounds (Default) */
  --bg-primary: #1a1f2e; /* Deep navy */
  --bg-secondary: #252b3b; /* Lighter navy */
  --bg-tertiary: #0f1419; /* Darkest - for footer */
  --bg-card: #1f2533;
  
  /* Text Colors */
  --text-primary: #e5e7eb;
  --text-secondary: #f9fafb;
  --text-muted: #9ca3af;
  --text-inverse: #1f2937;
  
  /* Borders & Dividers */
  --border-color: #2d3548;
  --border-light: #3d4558;
  
  /* Shadows - adjusted for dark theme */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(28, 105, 212, 0.15);
  --shadow-glow-hover: 0 0 30px rgba(28, 105, 212, 0.25);
  
  /* Hero Overlay */
  --hero-overlay: rgba(15, 20, 25, 0.35);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  --container-max: 1200px;
  --border-radius: 0.5rem;
}

/* Light Theme Override - applies to both html (loading) and body (loaded) */
html.light-theme-loading,
body.light-theme {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-card: #ffffff;
  
  --text-primary: #1f2937;
  --text-secondary: #111827;
  --text-muted: #6b7280;
  --text-inverse: #f9fafb;
  
  --border-color: #e5e7eb;
  --border-light: #d1d5db;
  
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(28, 105, 212, 0.08);
  --shadow-glow-hover: 0 0 30px rgba(28, 105, 212, 0.15);
  
  --hero-overlay: rgba(0, 0, 0, 0.4);
}

/* ===== Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* ===== Layout ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-2xl) 0;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.section:nth-child(even) {
  background-color: var(--bg-secondary);
}

.section-intro {
  font-size: 1.125rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  min-width: 44px;
  min-height: 44px;
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-hover);
}

.btn-secondary {
  background-color: var(--accent-color);
  color: white;
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  background-color: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  opacity: 0.7;
}

.theme-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-color);
}

.theme-toggle-icon {
  line-height: 1;
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 500px;
  height: 70vh;
  max-height: 700px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--hero-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: var(--spacing-md);
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 475px;
}

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

.hero-bottom {
  text-align: center;
  margin-top: auto;
  padding-top: var(--spacing-xl);
}

.hero h1 {
  color: white;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.1rem;
  margin-top: 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  margin-bottom: 0;
  font-weight: 600;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.8);
  color: white;
}

.hero-description {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  margin-bottom: var(--spacing-md);
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.8);
  color: white;
}

/* ===== Services Section ===== */
.services h2 {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.service-card {
  background: var(--bg-card);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-color);
}

.service-card h3 {
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.service-card p {
  color: var(--text-primary);
}

.services-cta {
  text-align: center;
  margin-top: var(--spacing-lg);
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* ===== Gallery Section ===== */
.gallery h2 {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

.gallery-item {
  overflow: hidden;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

/* ===== Hours Section ===== */
.hours h2 {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.hours-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.hours-main {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.hours-note {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* ===== Contact Section ===== */
.contact h2 {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.contact-info {
  background: var(--bg-card);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-info h3 {
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
}

.contact-item {
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
  color: var(--text-primary);
}

.phone-link {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}

.phone-link:hover {
  color: var(--accent-color);
}

.contact-cta {
  margin-top: var(--spacing-lg);
}

.contact-map {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.contact-map iframe {
  display: block;
  width: 100%;
  min-height: 400px;
}

/* ===== Footer Section ===== */
.footer {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
  text-align: center;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-cta {
  margin-bottom: var(--spacing-xl);
}

.footer-cta h2 {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.footer-cta p {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-md);
  color: var(--text-muted);
}

.footer-info {
  border-top: 1px solid var(--border-color);
  padding-top: var(--spacing-lg);
  color: var(--text-muted);
}

.footer-business {
  margin-bottom: var(--spacing-sm);
  line-height: 1.8;
}

.footer-copyright {
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* Social Links */
.social-links {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.social-links-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.social-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-color);
  color: var(--primary-color);
  text-decoration: none;
}

.social-icon svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.social-icon span {
  line-height: 1;
}

/* ===== Responsive Design ===== */

/* Mobile optimizations */
@media (max-width: 639px) {
  .hero {
    min-height: 450px;
    height: 60vh;
    background-position: center center;
  }
  
  .hero-content {
    padding: var(--spacing-md) var(--spacing-lg);
    width: 100%;
    min-height: 450px;
    justify-content: space-between;
    /* Extra horizontal padding for logo breathing room */
  }
  
  .hero-top {
    margin-bottom: 0;
  }
  
  .hero-bottom {
    margin-top: auto;
    padding-top: var(--spacing-md);
  }
  
  .hero h1 {
    margin-bottom: 0.375rem;
  }
  
  .hero-tagline {
    margin-bottom: 0;
    font-size: clamp(1rem, 3vw, 1.25rem);
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .theme-toggle {
    bottom: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
  
  .social-icons {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .social-icon {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 640px) {
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
  
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  .hero {
    min-height: 600px;
    max-height: 800px;
  }
  
  .hero-content {
    min-height: 500px;
  }
  
  .hero-bottom {
    padding-top: var(--spacing-2xl);
  }
  
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .contact-content {
    grid-template-columns: 1fr 1.5fr;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    gap: var(--spacing-lg);
  }
  
  .gallery-grid {
    gap: var(--spacing-lg);
  }
}

/* Landscape mobile devices */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 400px;
    height: 90vh;
  }
}

/* ===== Print Styles ===== */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .hero-overlay {
    background: rgba(0, 0, 0, 0.3);
  }
  
  .btn {
    border: 1px solid black;
    background: transparent;
    color: black;
  }
  
  .contact-map,
  .gallery {
    display: none;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
  
  a[href^="tel:"]:after {
    content: "";
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: black;
  }
}

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

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
.btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(28, 105, 212, 0.2);
}

/* Ensure sufficient tap targets on mobile */
@media (max-width: 767px) {
  a, button, .btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

