/* CSS Reset and Variables */
:root {
  --bg-color: #fffdf7; /* Light sunny background */
  --surface-color: #ffffff;
  --primary-color: #f59e0b; /* Sunny orange/yellow */
  --primary-hover: #d97706;
  --accent-color: #0284c7; /* Sea blue */
  --text-primary: #1f2937; /* Dark text for readability */
  --text-secondary: #4b5563;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(245, 158, 11, 0.3);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}

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

a:hover {
  color: var(--primary-hover);
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  box-shadow: none;
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

/* Pulsante In Evidenza (Offerte) */
.btn-accent {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  animation: pulse-accent 2s infinite;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6) !important;
}

@keyframes pulse-accent {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Glassmorphism Classes */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 253, 247, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.8rem 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background-image: url('./assets/hero_bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(255, 253, 247, 0.9) 0%, rgba(255, 253, 247, 0.4) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Features Section */
.features {
  padding: 6rem 0;
  background-color: var(--surface-color);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2.5rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-img {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Car Showcase Section */
.showcase {
  padding: 6rem 0;
  background-color: var(--bg-color);
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.car-card {
  background: var(--surface-color);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.car-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.car-img {
  width: 100%;
  height: 220px;
  background-size: cover;
  background-position: center;
}

.car-info {
  padding: 1.5rem;
  text-align: center;
}

.car-info h3 {
  margin-bottom: 0.5rem;
}

.car-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Lead Form Section */
.lead-section {
  padding: 6rem 0;
  background: linear-gradient(to bottom, var(--bg-color), var(--surface-color));
}

.form-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

select.form-control option {
  background: var(--surface-color);
  color: var(--text-primary);
}

/* Footer */
.footer {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-up {
  animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding-top: 130px;
  }
  .hero h1 { 
    font-size: 2.2rem; 
    line-height: 1.2;
  }
  .section-header h2 {
    font-size: 2rem;
  }
  .form-container { 
    padding: 1.5rem; 
  }
  
  /* Riduzione degli spazi verticali eccessivi su mobile */
  .page-header {
    padding-bottom: 1.5rem !important;
    padding-top: 100px !important;
  }
  .showcase, .features, .lead-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  /* Hamburger Menu Button */
  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
  }
  
  .nav-content {
    flex-wrap: wrap;
    align-items: center;
  }

  /* Nascondi i link di default su mobile */
  .nav-links {
    display: none !important;
    width: 100%;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    margin-top: 1rem;
    background: var(--surface-color); /* Sfondo solido bianco per leggibilità */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--glass-border);
  }
  
  /* Mostra i link quando il menu è attivo */
  .nav-links.active {
    display: flex !important;
  }
  
  .nav-links a, 
  .nav-links div {
    width: 100%;
    text-align: center;
  }

  /* Evita sovrapposizione griglie con inline styles fissi */
  .features-grid, .car-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Ridimensionamento pulsanti per schermi piccoli */
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem;
    text-align: center;
  }
  
  /* Fix Modulo Ricerca Inline */
  form[action="search.php"] {
    flex-direction: column !important;
  }
  form[action="search.php"] input,
  form[action="search.php"] select,
  form[action="search.php"] button {
    width: 100% !important;
    min-width: 100% !important;
  }
}

/* Nascondi il pulsante hamburger su desktop */
@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero-tag {
    font-size: 0.75rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .section-header h2 {
    font-size: 1.6rem;
  }
}
