/* ============================================================
   AutoNoleggio - Stile Principale
   ============================================================ */

:root {
  --red:       #e63946;
  --red-dark:  #c1121f;
  --red-light: #ff6b6b;
  --dark:      #0d0d0d;
  --dark-2:    #1a1a2e;
  --gray:      #6c757d;
  --light-bg:  #f8f9fa;
  --white:     #ffffff;
  --shadow:    0 8px 32px rgba(0,0,0,.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.2);
  --radius:    16px;
  --radius-sm: 10px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  color: #212529;
  background: #fff;
  scroll-behavior: smooth;
}

/* ── Typography ── */
.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }

.text-gradient-red {
  background: linear-gradient(135deg, var(--red), var(--red-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ── */
#mainNav {
  background: rgba(13,13,13,.95);
  backdrop-filter: blur(20px);
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
#mainNav.scrolled {
  background: rgba(13,13,13,1);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
#mainNav .navbar-brand { font-size: 1.4rem; letter-spacing: -.5px; }
#mainNav .nav-link { font-weight: 500; padding: .5rem .75rem; color: rgba(255,255,255,.85) !important; transition: color var(--transition); }
#mainNav .nav-link:hover { color: var(--red) !important; }

/* ── Hero ── */
.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark-2) 0%, #16213e 50%, #0f3460 100%),
              url('') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  padding: 100px 0 60px;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(230,57,70,.15) 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 1; width: 100%; }
.min-vh-80 { min-height: 80vh; }

/* Stat boxes */
.stat-box { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--red); line-height: 1; }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: 1px; }

/* ── Booking Card ── */
.booking-card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.booking-card .form-control,
.booking-card .form-select {
  border: 2px solid #e9ecef;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.booking-card .form-control:focus,
.booking-card .form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,.1);
}

/* ── Category Cards ── */
.cat-card {
  display: block;
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  border: 2px solid transparent;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.cat-card:hover {
  border-color: var(--red);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.cat-icon { font-size: 2rem; color: var(--red); margin-bottom: .5rem; }
.cat-name { font-weight: 700; color: #212529; }
.cat-count { font-size: .8rem; color: var(--gray); }

/* ── Vehicle Card ── */
.vehicle-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,.05);
}
.vehicle-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.vehicle-img-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #f0f0f0;
}
.vehicle-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.vehicle-card:hover .vehicle-img-wrap img { transform: scale(1.05); }
.vehicle-img-wrap .badge {
  position: absolute; top: 12px; left: 12px;
  font-size: .75rem; padding: 6px 10px;
}
.badge-featured {
  position: absolute !important; top: 12px; right: 12px;
  background: #ffd700 !important; color: #333 !important;
}
.vehicle-body { padding: 1.25rem; }
.vehicle-meta { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--red); font-weight: 600; }
.vehicle-title { font-size: 1.1rem; font-weight: 700; margin: .3rem 0 .75rem; }
.vehicle-specs {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--gray); margin-bottom: .75rem;
}
.vehicle-specs span { display: flex; align-items: center; gap: 4px; }
.vehicle-price { display: flex; align-items: baseline; gap: 4px; }
.price-label { font-size: .8rem; color: var(--gray); }
.price-amount { font-size: 1.5rem; font-weight: 800; color: var(--red); }
.price-period { font-size: .8rem; color: var(--gray); }

/* ── Why Cards ── */
.why-card {
  padding: 2rem 1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  transition: var(--transition);
}
.why-card:hover {
  background: rgba(230,57,70,.1);
  border-color: rgba(230,57,70,.3);
}
.why-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.why-card h5 { font-weight: 700; margin-bottom: .5rem; }
.why-card p { color: rgba(255,255,255,.6); font-size: .9rem; margin: 0; }

/* ── Footer ── */
.footer-link { color: inherit; text-decoration: none; transition: color var(--transition); display: block; margin-bottom: .3rem; }
.footer-link:hover { color: var(--red); }

/* ── Badges ── */
.badge { font-weight: 600; }
.bg-danger-subtle { background-color: rgba(230,57,70,.1) !important; }

/* ── Vehicles List Page ── */
.filter-sidebar {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: sticky;
  top: 80px;
}
.filter-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group label { font-weight: 600; font-size: .9rem; color: #444; margin-bottom: .5rem; display: block; }

/* ── Vehicle Detail ── */
.vehicle-gallery img {
  width: 100%; height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
}
.thumb-strip { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumb-strip img {
  width: 80px; height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: .7;
  transition: opacity var(--transition);
  border: 2px solid transparent;
}
.thumb-strip img:hover,
.thumb-strip img.active { opacity: 1; border-color: var(--red); }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.spec-item {
  background: var(--light-bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.spec-item i { font-size: 1.5rem; color: var(--red); display: block; margin-bottom: .4rem; }
.spec-item .spec-value { font-weight: 700; font-size: 1rem; }
.spec-item .spec-label { font-size: .75rem; color: var(--gray); }

.price-box {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── Booking Form ── */
.booking-step {
  display: none;
}
.booking-step.active { display: block; }

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.step-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  background: #e9ecef;
  color: #999;
  transition: var(--transition);
}
.step-dot.active { background: var(--red); color: white; }
.step-dot.done { background: #28a745; color: white; }

/* ── Admin Panel ── */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--dark);
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform var(--transition);
}
.admin-sidebar .brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-nav .nav-item { border-bottom: 1px solid rgba(255,255,255,.04); }
.admin-nav .nav-link {
  color: rgba(255,255,255,.7);
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 500;
  font-size: .9rem;
  transition: var(--transition);
}
.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
  color: white;
  background: rgba(230,57,70,.15);
  border-left: 3px solid var(--red);
}
.admin-nav .nav-link i { font-size: 1.1rem; width: 20px; }
.admin-nav .nav-section {
  padding: .75rem 1.5rem .25rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
}

.admin-main {
  margin-left: 260px;
  background: #f4f6f9;
  min-height: 100vh;
}
.admin-topbar {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-content { padding: 2rem; }

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  border-left: 4px solid transparent;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card.border-red { border-left-color: var(--red); }
.stat-card.border-green { border-left-color: #28a745; }
.stat-card.border-blue { border-left-color: #0d6efd; }
.stat-card.border-orange { border-left-color: #fd7e14; }
.stat-card .value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .label { color: var(--gray); font-size: .85rem; margin-top: .25rem; }
.stat-card .icon { font-size: 2rem; opacity: .2; }

/* Data tables */
.admin-table { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.admin-table .table { margin: 0; }
.admin-table .table th { background: #f8f9fa; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; color: #555; border-bottom: 2px solid #e9ecef; }
.admin-table .table td { vertical-align: middle; }
.admin-table-header { padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e9ecef; }

/* Upload area */
.upload-area {
  border: 2px dashed #dee2e6;
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fafafa;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--red);
  background: rgba(230,57,70,.04);
}
.upload-area i { font-size: 3rem; color: var(--gray); margin-bottom: 1rem; display: block; }

/* Image preview grid */
.img-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 1rem; }
.img-preview-item {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 4/3; background: #eee;
  border: 2px solid transparent;
}
.img-preview-item.is-cover { border-color: var(--red); }
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-item .img-actions {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity var(--transition);
}
.img-preview-item:hover .img-actions { opacity: 1; }
.img-preview-item .cover-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: var(--red); color: white;
  font-size: .65rem; padding: 2px 6px; border-radius: 4px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-topbar { padding: 1rem; }
  .admin-content { padding: 1rem; }
  .hero-section { padding: 80px 0 40px; min-height: auto; }
}

@media (max-width: 767px) {
  .vehicle-gallery img { height: 250px; }
  .booking-card { padding: 1.25rem; }
}

/* ── Utilities ── */
.cursor-pointer { cursor: pointer; }
.border-dashed { border-style: dashed !important; }
.rounded-pill { border-radius: 50px !important; }
.btn-danger { background: linear-gradient(135deg, var(--red), var(--red-dark)); border: none; }
.btn-danger:hover { background: linear-gradient(135deg, var(--red-dark), #a00); transform: translateY(-1px); }
.btn-outline-danger { border-color: var(--red); color: var(--red); }
.btn-outline-danger:hover { background: var(--red); border-color: var(--red); }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .5s ease forwards; }

/* ── Import section ── */
.import-steps { counter-reset: step; }
.import-step { position: relative; padding-left: 3rem; margin-bottom: 1.5rem; }
.import-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem;
  background: var(--red); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
