/* Enhanced UI Styles for BS Motors */

/* Hero Section - BMW Background */
.hero-section {
  position: relative;
  min-height: 70vh; /* Shrink slightly on desktop */
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('/Images/bmw_front.webp');
  background-size: cover; /* Fill container on desktop */
  background-position: center; /* Keep subject centered */
  background-repeat: no-repeat;
  background-color: #0f1113; /* Fallback around image */
  overflow: hidden;
  /* Soft vignette to blend edges */
  box-shadow: inset 0 -60px 120px rgba(0,0,0,0.35), inset 0 40px 80px rgba(0,0,0,0.35);
}

.hero-badge i { color: var(--bs-accent); }

/* Subtle brand tint to unify colors */
.hero-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* Under content/fades */
  background: radial-gradient(120% 80% at 50% 20%, rgba(25,135,84,0.10) 0%, rgba(0,86,179,0.08) 35%, rgba(0,0,0,0) 70%);
  mix-blend-mode: soft-light;
}

/* Tablet & down: slightly shorter */
@media (max-width: 992px) {
  .hero-section {
    min-height: 58vh !important; /* Slightly smaller on tablets */
    margin: 0 !important;           /* Override layout.css margins */
    border-radius: 0 !important;     /* Full-bleed on mobile */
    background-attachment: scroll;   /* Better perf on mobile */
    padding-top: 0 !important;       /* Remove gap under header */
    padding-bottom: 2rem;            /* Keep a bit of space for buttons */
    background-position: 50% 0% !important; /* Start image at top */
    background-size: cover !important;       /* Fill hero, no top band */
    margin-top: -1px !important;             /* Nudge up to hide any 1px seam */
  }

  /* Ensure no accidental margins from layout wrap */
  header.navbar.sticky-top + main .hero-section { margin-top: 0 !important; }

  /* Remove darkness at top so image edges with header (no "gap") */
  .hero-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.8) 70%, rgba(0,0,0,0.9) 100%) !important;
  }

  /* Hide brand tint overlay on small screens to avoid any visible banding at top */
  .hero-tint { display: none !important; }

  /* Remove top vignette to avoid dark bar between header and image */
  .hero-section { box-shadow: inset 0 -60px 120px rgba(0,0,0,0.35); }
}

/* Mobile: show full image without cropping */
@media (max-width: 768px) {
  .hero-section.hero-section {
    min-height: 52vh !important;                /* Give a bit more height for contain */
    background-size: cover !important;           /* Fill the container */
    background-position: center !important;     /* Center the image */
    background-repeat: no-repeat !important;
    background-color: #0f1113; /* Bands match header/background */
  }

  /* Reduce vertical space so image can fit */
  .hero-content { padding-top: 0.75rem; padding-bottom: 1rem; }
  .hero-title { margin-bottom: 0.5rem; }
  .hero-description { margin-bottom: 1rem; }
  .hero-actions { margin-bottom: 1rem; }
  .hero-scroll-indicator { display: none; }

  /* Enhance text contrast on mobile */
  .hero-title,
  .hero-description {
    text-shadow: 0 2px 15px rgba(0,0,0,0.8), 0 1px 5px rgba(0,0,0,0.9);
  }

  /* Ensure overlay does not create a dark band at the very top */
  .hero-overlay { background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 55%, rgba(0,0,0,0.85) 100%) !important; }

  /* Hide stats on mobile to prevent excessive height */
  .hero-stats { display: none !important; }

  /* Simplify overlays for clarity */
  .hero-background-pattern { display: none; }
  /* Note: overlay top already set to transparent earlier in this block */
}

/* Bottom fade to blend hero into next section */
.hero-bottom-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 220px;
  pointer-events: none;
  z-index: 1; /* under wave */
  /* multi-stop fade for a softer transition toward the page background */
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.06) 28%,
    rgba(255,255,255,0.18) 52%,
    rgba(255,255,255,0.38) 74%,
    rgba(255,255,255,0.65) 90%,
    var(--bs-light) 100%
  );
}

/* Decorative wave separator */
.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 120px;
  pointer-events: none;
  z-index: 2; /* above fade */
}
.hero-wave svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 -6px 14px rgba(0,0,0,0.18)); }
.hero-wave svg path { fill: var(--bs-light); opacity: 0.98; }

@media (max-width: 768px) {
  .hero-bottom-fade { height: 180px; }
  .hero-wave { height: 90px; }
}

@media (max-width: 576px) {
  .hero-section.hero-section {
    min-height: 52vh;
    background-size: contain !important;
    background-position: 50% 0% !important;    /* Flush with header */
  }
}

@media (max-width: 480px) {
  .hero-section.hero-section {
    min-height: 48vh;
    background-size: cover !important;
    background-position: center !important;    /* Flush with header */
  }
}

/* Extra safety: very tall/narrow screens (e.g., small phones) */
@media (max-aspect-ratio: 9/16) {
  .hero-section.hero-section {
    background-size: cover !important;
    background-position: center !important;
  }
}

.hero-background-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(0, 123, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 123, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(0, 123, 255, 0.05) 0%, transparent 50%);
  z-index: 1;
}

.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
}

.hero-particles::before,
.hero-particles::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(0, 123, 255, 0.6);
  border-radius: 50%;
  animation: float 20s infinite linear;
}

.hero-particles::before {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
}

.hero-particles::after {
  left: 80%;
  top: 60%;
  animation-delay: 10s;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.55); /* high contrast on blue car */
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
  backdrop-filter: saturate(120%) blur(8px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.text-gradient {
  background: linear-gradient(135deg, var(--bs-accent), #0056b3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  margin-bottom: 3rem;
}

.btn-outline-light {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  transition: all 0.3s ease;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.hero-stats {
  margin-top: 4rem;
}

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

.stat-number,
.stat-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bs-accent);
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  line-height: 1.2;
}

.stat-text {
  font-size: 1.5rem;
}

/* Improve contrast of hero stats text on image background (no band) */
.hero-stats { z-index: 3; }
.hero-stats .hero-stat { background: transparent; border: 0; padding: 0; backdrop-filter: none; position: relative; }
.hero-stats .stat-text { color: #ffffff; text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.hero-stats .stat-label { color: rgba(255,255,255,0.92); text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

.stat-label {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hero Image Styles */
.hero-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.4s ease;
  filter: brightness(0.9) contrast(1.1);
}

.hero-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 123, 255, 0.1) 0%,
    rgba(0, 86, 179, 0.1) 100%
  );
  border-radius: 20px;
  pointer-events: none;
}

.hero-image-wrapper:hover .hero-image {
  transform: scale(1.05);
}

/* Responsive hero layout */
@media (max-width: 992px) {
  .hero-section .row {
    text-align: center;
    padding: 2rem 0;
  }
  
  .hero-image-wrapper {
    margin-top: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .hero-section .min-vh-100 {
    min-height: auto;
    padding: 4rem 0;
  }
  
  .hero-image-wrapper {
    margin-top: 1.5rem;
  }
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.scroll-mouse {
  width: 30px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 25px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8px;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(15px); opacity: 0; }
}

/* Section Headers */
.section-header {
  margin-bottom: 4rem;
}

.section-subtitle {
  display: inline-block;
  color: var(--bs-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--bs-dark);
}

.section-description {
  max-width: 600px;
  margin: 0 auto;
}

/* Enhanced Feature Cards */
.feature-card-enhanced {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.4s ease;
  height: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.feature-card-enhanced:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 123, 255, 0.15);
  border-color: rgba(0, 123, 255, 0.3);
}

.feature-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.icon-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--bs-accent), #0056b3);
  border-radius: 50%;
  opacity: 0.1;
  transition: all 0.4s ease;
}

.feature-card-enhanced:hover .icon-bg {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 0.2;
}

.feature-icon {
  font-size: 3rem;
  color: var(--bs-accent);
  position: relative;
  z-index: 2;
  transition: all 0.4s ease;
}

.feature-card-enhanced:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--bs-dark);
}

.feature-description {
  color: #6c757d;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.feature-benefits {
  list-style: none;
  padding: 0;
  text-align: left;
}

.feature-benefits li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: #495057;
}

.feature-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--bs-accent);
  font-weight: bold;
}

/* Enhanced Testimonial Cards */
.testimonials-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.testimonial-card-enhanced {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.testimonial-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bs-accent), #0056b3);
}

.testimonial-card-enhanced:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.testimonial-rating {
  color: #ffc107;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.testimonial-quote {
  position: relative;
  margin-bottom: 2rem;
}

.quote-icon {
  position: absolute;
  top: -10px;
  left: -10px;
  font-size: 2rem;
  color: rgba(0, 123, 255, 0.2);
  z-index: 1;
}

.testimonial-quote p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #495057;
  font-style: italic;
  position: relative;
  z-index: 2;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  font-size: 3rem;
  color: var(--bs-accent);
}

.author-info h5 {
  margin: 0;
  font-weight: 700;
  color: var(--bs-dark);
}

.author-info span {
  color: #6c757d;
  font-size: 0.9rem;
}

.btn-outline-accent {
  color: var(--bs-accent);
  border: 2px solid var(--bs-accent);
  background: transparent;
  transition: all 0.3s ease;
}

.btn-outline-accent:hover {
  background: var(--bs-accent);
  color: white;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    min-height: 70vh;
    background-attachment: scroll;
    background-position: center center;
    background-size: cover;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-description {
    font-size: 1.1rem;
  }
  
  .hero-actions .btn {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
  }
  
  .hero-stats .col-md-4 {
    margin-bottom: 1.5rem;
  }
  
  .hero-stats {
    margin-top: 2rem;
  }
  
  .stat-text {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .feature-card-enhanced,
  .testimonial-card-enhanced {
    margin-bottom: 2rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: 60vh;
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .feature-card-enhanced,
  .testimonial-card-enhanced {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    min-height: 50vh;
    background-position: 65% center;
  }
  
  .hero-content {
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: 1.6rem;
  }
  
  .hero-actions .btn {
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
  }
}

/* Performance optimizations */
.feature-card-enhanced,
.testimonial-card-enhanced,
.hero-section {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Smooth animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .feature-card-enhanced,
  .testimonial-card-enhanced,
  .hero-section,
  .btn {
    transition: none !important;
    animation: none !important;
  }
}

/* Final override to fix mobile top gap */
@media (max-width: 767.98px) {
  .hero-section {
    background-position: top !important;
  }
}
