/* ===== BASE ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --bg: #f1f5f9;
  --white: #ffffff;
  --dark: #0f172a;
  --text: #334155;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover: 0 10px 25px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  font-size: 15px;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--white) !important;
  border-bottom: 1px solid var(--border);
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  position: relative;
  z-index: 1050;
}

.navbar .container { height: 64px; }

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary) !important;
  letter-spacing: -.5px;
}

.navbar-nav .nav-link {
  color: var(--text) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 14px !important;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.navbar-nav .nav-link:hover {
  background: var(--bg);
  color: var(--primary) !important;
}

.navbar-toggler { border: none; }
.navbar-toggler:focus { box-shadow: none; }

.navbar-collapse {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  position: relative;
  z-index: 1050;
}

@media (max-width: 991px) {
  .navbar-collapse {
    padding: 4px 0 8px;
  }
  .navbar-nav .nav-link {
    padding: 10px 16px !important;
    border-radius: 0;
    width: 100%;
  }
  .navbar-nav .ms-2 {
    margin-left: 0 !important;
  }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1e3a5f 100%);
  padding: 80px 0 70px;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -.5px;
}

.hero h1 span { color: var(--accent); }

.hero p {
  color: rgba(255,255,255,.7);
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 480px;
}

.btn-hero {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  padding: 13px 30px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

.btn-hero:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-hero-outline {
  background: rgba(255,255,255,.1);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.25);
  font-weight: 600;
  padding: 13px 30px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  transition: background .2s;
  margin-left: 12px;
}

.btn-hero-outline:hover { background: rgba(255,255,255,.2); }

/* ===== SECTION ===== */
.section { padding: 56px 0; }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.section-title span { color: var(--primary); }
.section-sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 0; }

/* ===== LISTING CARD ===== */
.listing-card {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  box-shadow: var(--card-shadow);
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.listing-card img {
  height: 200px;
  object-fit: cover;
  display: block;
  width: 100%;
}

.listing-card .card-body {
  background: var(--white) !important;
  padding: 14px;
  border-top: 1px solid var(--border) !important;
}

.listing-card .card-title {
  color: var(--dark);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.listing-card .card-footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--border) !important;
}

.price-tag {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

/* ===== CARDS ===== */
.card {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--card-shadow);
  color: var(--text) !important;
}

.card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--muted) !important;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 12px 12px 0 0 !important;
}

.card-footer {
  background: #f8fafc !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 0 0 12px 12px !important;
}

/* ===== FORM ===== */
.form-control, .form-select {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  color: var(--dark) !important;
  border-radius: 8px !important;
  font-size: .9rem;
  padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--border) !important;
  box-shadow: none !important;
}

.form-control::placeholder { color: var(--muted) !important; }
.form-label { color: var(--text); font-size: .85rem; font-weight: 500; margin-bottom: 6px; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 20px;
}

.btn-primary:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.btn-success {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
}

.btn-outline-primary {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  border-radius: 8px;
  font-weight: 500;
}

.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.btn-outline-secondary {
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px;
}

.btn-outline-secondary:hover {
  background: var(--bg) !important;
  color: var(--dark) !important;
}

.btn-outline-danger {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  border-radius: 8px;
}

.btn-outline-danger:hover {
  background: #ef4444 !important;
  color: #fff !important;
}

/* ===== TABLE ===== */
.table { color: var(--text) !important; }
.table td, .table th { border-color: var(--border) !important; }
.table-dark { background: var(--dark) !important; color: #fff !important; }
.table-hover tbody tr:hover { background: var(--bg) !important; }

/* ===== ALERTS ===== */
.alert-success { background: #ecfdf5 !important; border-color: #a7f3d0 !important; color: #065f46 !important; }
.alert-danger  { background: #fef2f2 !important; border-color: #fecaca !important; color: #991b1b !important; }
.alert-warning { background: #fffbeb !important; border-color: #fde68a !important; color: #92400e !important; }

/* ===== DROPDOWN ===== */
.dropdown-menu {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 25px rgba(0,0,0,.1) !important;
  padding: 6px;
}

.dropdown-item {
  color: var(--text) !important;
  border-radius: 6px;
  font-size: .875rem;
  padding: 8px 12px;
}

.dropdown-item:hover { background: var(--bg) !important; color: var(--primary) !important; }
.dropdown-divider { border-color: var(--border) !important; }

/* ===== FOOTER ===== */
footer {
  background: transparent !important;
  color: var(--muted) !important;
  border-top: none;
}

/* ===== AVATAR ===== */
.avatar { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; border: 3px solid var(--border); }
.avatar-lg { width: 120px; height: 120px; }

/* ===== STAR RATING ===== */
.star-rating { color: var(--accent); }

/* ===== BADGE ===== */
.badge.bg-light { background: var(--bg) !important; color: var(--text) !important; }

/* ===== AUTOCOMPLETE ===== */
[id^="ac-"] {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.08) !important;
}

[id^="ac-"] li { color: var(--text) !important; }
[id^="ac-"] li:hover { background: var(--bg) !important; }

/* ===== MAIN ===== */
main.container { padding-top: 32px; padding-bottom: 40px; }

/* ===== DETAIL PAGE ===== */
.detail-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.detail-section-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 12px 12px 0 0;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.detail-section-body { padding: 16px; }

/* ===== THUMBNAIL ===== */
.thumb { transition: opacity .15s; }
.thumb:hover { opacity: .85; }

@media (min-width: 992px) {
  .navbar-collapse {
    background: transparent;
    border-top: none;
    padding: 0;
  }
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: .8rem !important;
  line-height: 1.5 !important;
}

/* ===== PAGINATION ===== */
.page-link {
  background: var(--white) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  margin: 0 2px;
}

.page-link:hover {
  background: var(--bg) !important;
  color: var(--primary) !important;
}

.page-item.active .page-link {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
