@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
  --primary-color: #0f172a;
  /* Deep Blue */
  --primary-light: #1e293b;
  --accent-color: #ef4444;
  /* Red/Orange Accent */
  --accent-hover: #dc2626;
  --background-color: #f8fafc;
  /* Very Light Blue/Grey */
  --text-dark: #1e293b;
  --text-light: #64748b;
  --white: #ffffff;
  --gradient-main: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --gradient-accent: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px 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);
  --radius: 12px;
  --font-main: 'Outfit', sans-serif;
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--background-color);
  color: var(--text-dark);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* --- Utilities --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 1rem;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--gradient-main);
  color: var(--white);
  box-shadow: 0 4px 14px 0 rgba(15, 23, 42, 0.39);
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--white);
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
}

.btn-outline {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

.section-padding {
  padding: 5rem 0;
}

.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Header --- */
header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -1.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.logo i {
  font-size: 1.8rem;
  filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.3));
}

.logo span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-dark);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* --- Hamburger Button --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1100;
}

.hamburger:hover {
  background: rgba(0, 0, 0, 0.05);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.nav-overlay.active {
  display: block;
}

/* Nav actions wrapper (Call + Find a Car + Hamburger) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Close button row inside the mobile panel — hidden on desktop */
.nav-panel-close {
  display: none;
}

.nav-close-btn {
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, color 0.2s;
}

.nav-close-btn:hover {
  background: #f1f5f9;
  color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  background: url("images/scorpio_3d.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  perspective: 1000px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 50%, rgba(0,0,0,0.3) 100%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  transform-style: preserve-3d;
  animation: floatSmall 6s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  font-weight: 800;
  text-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: fadeInUp3D 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero p {
  font-size: clamp(1rem, 3vw, 1.35rem);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInUp3D 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.hero .btn-accent {
    opacity: 0;
    animation: fadeInUp3D 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s both;
    transform: translateZ(20px);
}

@keyframes fadeInUp3D {
  from {
    opacity: 0;
    transform: translateY(40px) rotateX(-15deg) translateZ(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0) translateZ(0);
  }
}

@keyframes floatSmall {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* --- Glassmorphism Search Bar --- */
.hero-search-container {
  position: relative;
  z-index: 20;
  margin-top: -100px;
  margin-bottom: 5rem;
  transform: perspective(1000px) rotateX(2deg);
}

.search-card {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 240, 240, 0.35);
  padding: 35px;
  border-radius: 20px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(239, 68, 68, 0.1); /* Subtle brand color glow */
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s;
}

.search-card:hover {
  transform: translateY(-8px) rotateX(0deg) scale(1.01);
  box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.4);
}

.search-card input,
.search-card select {
  flex: 1 1 200px;
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-color);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  transition: all 0.3s;
}

.search-card input:focus,
.search-card select:focus {
  border-color: var(--accent-color);
  background: #fff;
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.08);
  outline: none;
}

/* --- Contact Strip --- */
.contact-strip {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 18px 32px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text-dark);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    color: var(--accent-color);
}

.action-btn i {
  font-size: 1.2rem;
  color: var(--accent-color);
}

/* --- Featured Cars (Grid) --- */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.car-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.car-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.car-image-container {
  position: relative;
  overflow: hidden;
  height: 220px;
}

.car-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.car-card:hover .car-image {
  transform: scale(1.05);
}

.car-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.car-info {
  padding: 20px;
}

.car-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 5px;
}

.car-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.car-spec-icons {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f1f5f9;
  color: var(--text-light);
  font-size: 0.9rem;
}

.car-spec-icons span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- Features Section --- */
.features-section {
  background: var(--primary-color);
  color: var(--white);
}

.feature-box {
  text-align: center;
  padding: 20px;
}

.feature-icon-wrapper {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  color: var(--accent-color);
}

/* --- Enquiry Form --- */
.enquiry-section {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.form-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

/* --- Footer --- */
footer {
  background: var(--primary-color);
  color: #94a3b8;
  padding: 4rem 0 2rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--accent-color);
}

.admin-trigger {
  color: #334155;
  font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE: 768px (Tablet / Mobile)
   ============================================ */
@media (max-width: 768px) {
  /* --- Mobile Header Fix --- 
     On mobile, backdrop-filter on the header creates a new containing block 
     that clips fixed-position children. We disable it here to allow the 
     mobile menu to fill the screen height. */
  header {
    backdrop-filter: none !important;
    background-color: #ffffff; /* Fallback to solid white */
  }

  /* --- Show Hamburger on mobile --- */
  .hamburger {
    display: flex;
  }

  /* --- Hide desktop-only nav CTA buttons (Call / Find a Car) --- */
  .nav-actions .btn {
    display: none;
  }

  /* --- Mobile Nav: slide-in panel from the right --- */
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 85vw);
    height: 100vh !important;
    background-color: #ffffff !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    z-index: 9999 !important; /* Extremely high to escape any overflow */
    padding: 1.5rem;
    box-shadow: -5px 0 35px rgba(0,0,0,0.3);
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
  }

  @keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }

  .nav-links.mobile-open {
    display: flex !important;
  }

  /* Show the close button row at the top of the slide panel */
  .nav-panel-close {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    flex-shrink: 0;
  }

  .nav-panel-close span {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-links li {
    display: block !important;
    border-bottom: 1px solid #f1f5f9;
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color) !important;
    padding: 16px 8px;
    width: 100%;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a:active {
    color: var(--accent-color);
  }

  /* --- Logo --- */
  .logo {
    font-size: 1.5rem;
  }

  /* --- Hero --- */
  .hero {
    min-height: 75vh;
    background-position: 70% center;
  }

  .hero::before {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.65));
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .hero .btn {
    width: 100%;
    max-width: 280px;
  }

  /* --- Floating Search Bar --- */
  .hero-search-container {
    margin-top: -40px;
    margin-bottom: 2rem;
  }

  .search-card {
    flex-direction: column;
    padding: 20px;
    gap: 12px;
  }

  .search-card h3 {
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
  }

  .search-card input,
  .search-card select,
  .search-card button {
    width: 100%;
    flex: none;
    min-height: 48px;
    font-size: 1rem;
  }

  /* --- Contact Strip --- */
  .contact-strip {
    gap: 12px;
    justify-content: center;
  }

  .action-btn {
    padding: 12px 18px;
    font-size: 0.9rem;
    flex: 1 1 calc(50% - 12px);
    justify-content: center;
    max-width: 200px;
  }

  /* --- Car Grid --- */
  .car-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* --- Section Headings --- */
  .section-padding {
    padding: 3rem 0;
  }

  h2[style*="2.5rem"],
  .text-center h2 {
    font-size: 1.8rem !important;
  }

  /* --- Features Section --- */
  .features-section .container > div {
    flex-direction: column;
    align-items: center;
  }

  .feature-box {
    width: 100%;
    max-width: 400px;
  }

  /* --- Enquiry Form --- */
  .form-card {
    padding: 24px 16px;
    margin: 0 4px;
  }

  .form-control {
    min-height: 48px;
    font-size: 1rem;
  }

  /* --- Footer --- */
  .footer-top {
    flex-direction: column;
    gap: 24px;
  }

  .footer-col {
    min-width: unset !important;
    flex: none !important;
    width: 100%;
  }

  /* --- Buttons (Touch Friendly) --- */
  .btn {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}

/* ============================================
   RESPONSIVE: 480px (Small Mobile)
   ============================================ */
@media (max-width: 480px) {

  .container {
    padding: 0 16px;
  }

  /* --- Hero --- */
  .hero {
    min-height: 65vh;
  }

  .hero h1 {
    font-size: 1.9rem;
    line-height: 1.2;
  }

  .hero p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  /* --- Search --- */
  .search-card {
    padding: 16px;
    border-radius: 10px;
  }

  /* --- Contact Strip --- */
  .action-btn {
    flex: 1 1 calc(50% - 10px);
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .action-btn i {
    font-size: 1rem;
  }

  /* --- Car Grid --- */
  .car-grid {
    grid-template-columns: 1fr;
  }

  .car-image-container {
    height: 200px;
  }

  .car-price {
    font-size: 1.3rem;
  }

  .car-name {
    font-size: 1.05rem;
  }

  /* --- Feature boxes --- */
  .feature-icon-wrapper {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
  }

  /* --- Headings --- */
  h2 {
    font-size: 1.6rem;
  }

  /* --- Form Card --- */
  .form-card {
    padding: 20px 14px;
  }

  /* --- Buttons --- */
  .btn {
    font-size: 0.9rem;
    padding: 11px 18px;
  }

  /* --- Footer --- */
  footer {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .logo {
    font-size: 1.3rem;
  }
}

/* ============================================
   SECURE LOGIN MODAL STYLES
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.login-modal {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    animation: modalScaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-header {
    padding: 30px 30px 10px;
    text-align: center;
}

.modal-header i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.modal-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-body {
    padding: 20px 30px 30px;
}

.modal-form .form-group {
    position: relative;
    margin-bottom: 15px;
}

.modal-form .form-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.modal-form input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.modal-form input:focus {
    border-color: var(--accent-color);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.modal-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.modal-footer a {
    color: var(--accent-color);
    font-weight: 700;
}

#modal-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
    border: 1px solid #fca5a5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 480px) {
    .login-modal {
        max-width: 100%;
        margin-bottom: 0;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        animation: modalSlideUp 0.4s ease-out;
    }
    
    @keyframes modalSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}