/* ===========================================
   Net2Shop - Main Stylesheet
   =========================================== */

/* ---- Variables ---- */
:root {
  --primary: #0d6efd;
  --primary-dark: #0a4fcf;
  --secondary: #198754;
  --warning: #fd7e14;
  --danger: #dc3545;
  --light-bg: #f8f9fa;
  --card-shadow: 0 2px 12px rgba(0,0,0,.08);
  --card-hover-shadow: 0 6px 24px rgba(0,0,0,.15);
  --border-radius: 12px;
  --transition: .25s ease;
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body { font-family: 'Inter', 'Segoe UI', sans-serif; color: #333; background: #fff; }
a { transition: color var(--transition); }
.cursor-pointer { cursor: pointer; }

/* ---- Typography ---- */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), #7b2ff7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ===============================
   NAVBAR
   =============================== */
.navbar-brand img { height: 40px; }
.navbar { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.navbar .nav-link { font-weight: 500; transition: color var(--transition); }
.navbar .nav-link:hover { color: var(--primary) !important; }
.notification-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  border-radius: 50%; width: 18px; height: 18px;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* ===============================
   HERO SECTION
   =============================== */
.hero-section {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 40%, #0d3b5e 100%);
  min-height: 480px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section .hero-content { position: relative; z-index: 1; }
.hero-section .search-bar {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.2);
  padding: 8px 8px 8px 16px;
}
.hero-section .search-bar input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  outline: none;
  width: 100%;
}
.hero-section .search-bar input::placeholder { color: rgba(255,255,255,.6); }
.hero-quick-tags .badge { transition: all var(--transition); }
.hero-quick-tags .badge:hover { background: rgba(255,255,255,.3) !important; transform: translateY(-1px); }

/* Select2 dropdown above everything */
.select2-container--open .select2-dropdown { z-index: 99999 !important; }

/* Hero search card must be above hero pseudo-element overlay */
.hero-search .card { position: relative; z-index: 10; }

/* ===============================
   STATS BAR
   =============================== */
.stats-bar { background: linear-gradient(90deg, #0d6efd, #0a58ca); }
.stats-bar .stat-item { border-right: 1px solid rgba(255,255,255,.2); }
.stats-bar .stat-item:last-child { border-right: none; }
.stat-number { font-size: 1.8rem; font-weight: 700; line-height: 1; }

/* ===============================
   CARDS
   =============================== */
.card {
  border-radius: var(--border-radius) !important;
  transition: all var(--transition);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow) !important;
}

/* ---- Listing Card ---- */
.listing-card { overflow: hidden; }
.listing-card .card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform .4s ease;
}
.listing-card:hover .card-img-top { transform: scale(1.05); }
.listing-card .img-wrapper {
  overflow: hidden;
  position: relative;
}
.listing-card .type-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.listing-card .like-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,.9);
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.listing-card .like-btn:hover { background: #fff; transform: scale(1.1); }
.listing-card .like-btn.liked i { color: var(--danger); }
.listing-card .price { font-size: 1.1rem; font-weight: 700; color: var(--secondary); }
.listing-card .location { font-size: 13px; color: #666; }
.listing-card .meta { font-size: 12px; color: #888; }

/* ---- Category Card ---- */
.category-card {
  border-radius: 16px !important;
  transition: all var(--transition);
  cursor: pointer;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(13,110,253,.2) !important;
  border-color: var(--primary) !important;
}
.category-card .icon-circle {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  transition: all var(--transition);
}
.category-card:hover .icon-circle {
  transform: scale(1.15);
}

/* ---- City Card ---- */
.city-card {
  border-radius: 14px !important;
  transition: all var(--transition);
  cursor: pointer;
}
.city-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(13,110,253,.18) !important;
  border-color: var(--primary) !important;
}
.city-card:hover .fa-city {
  color: var(--primary) !important;
  opacity: 1 !important;
}

/* ---- Featured Badge ---- */
.featured-badge {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #333;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===============================
   STAR RATING
   =============================== */
.star-rating { display: flex; gap: 2px; }
.star-rating .star { font-size: 16px; cursor: pointer; color: #ddd; transition: color var(--transition); }
.star-rating .star.active, .star-rating .star.filled { color: #ffc107; }
.star-rating .star:hover ~ .star { color: #ddd !important; }
.star-rating:hover .star { color: #ffc107; }
.star-rating-static .star { cursor: default; }
.stars-display i { color: #ffc107; font-size: 14px; }
.stars-display i.empty { color: #ddd; }

/* ===============================
   LISTING DETAIL PAGE
   =============================== */
.listing-gallery .main-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 12px;
  cursor: zoom-in;
}
.listing-gallery .thumbnails { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.listing-gallery .thumb {
  width: 70px; height: 70px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: .7;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.listing-gallery .thumb.active, .listing-gallery .thumb:hover {
  opacity: 1;
  border-color: var(--primary);
}
.contact-reveal-card { background: linear-gradient(135deg, #f8f9fa, #e9ecef); }
.seller-card { border-left: 4px solid var(--primary) !important; }
.verified-badge { background: linear-gradient(135deg, #198754, #20c997); }

/* ===============================
   SEARCH PAGE
   =============================== */
.filter-sidebar .filter-section { border-bottom: 1px solid #eee; padding-bottom: 16px; margin-bottom: 16px; }
.filter-sidebar .filter-section:last-child { border-bottom: none; }
.filter-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #dee2e6;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  margin: 2px;
}
.filter-tag:hover, .filter-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- List View Listing ---- */
.listing-list-item {
  border-bottom: 1px solid #eee;
  transition: background var(--transition);
}
.listing-list-item:last-child { border-bottom: none; }
.listing-list-item:hover { background: #f8f9fa; }
.listing-list-item .list-img {
  width: 120px; height: 90px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ===============================
   USER DASHBOARD
   =============================== */
.user-sidebar {
  position: sticky;
  top: 20px;
}
.user-sidebar .nav-link {
  border-radius: 8px;
  padding: 10px 16px;
  color: #555;
  font-weight: 500;
  transition: all var(--transition);
}
.user-sidebar .nav-link:hover, .user-sidebar .nav-link.active {
  background: var(--primary);
  color: #fff;
}
.stat-card { border-left: 4px solid !important; }
.stat-card.primary { border-left-color: var(--primary) !important; }
.stat-card.success { border-left-color: var(--secondary) !important; }
.stat-card.warning { border-left-color: var(--warning) !important; }
.stat-card.danger  { border-left-color: var(--danger)  !important; }

/* ===============================
   ADMIN PANEL
   =============================== */
.admin-sidebar {
  min-height: calc(100vh - 60px);
  background: #1e293b;
  width: 250px;
  flex-shrink: 0;
  position: fixed;
  top: 60px;
  left: 0;
  overflow-y: auto;
  transition: transform var(--transition);
  z-index: 1000;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.7);
  padding: 10px 20px;
  border-radius: 0;
  font-size: 14px;
  transition: all var(--transition);
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.1);
  border-left: 3px solid var(--primary);
}
.admin-sidebar .nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.4);
  padding: 16px 20px 4px;
  margin: 0;
}
.admin-content {
  margin-left: 250px;
  padding: 24px;
  min-height: calc(100vh - 60px);
}
@media (max-width: 992px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
}

/* ---- Admin Stats ---- */
.admin-stat-card { border-radius: 16px !important; }
.admin-stat-card .icon-bg {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* ---- Data Tables ---- */
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #888; font-weight: 600; }
.data-table td { vertical-align: middle; }
.data-table tr:hover { background: #f8f9fa; }

/* ===============================
   FORMS
   =============================== */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}
.upload-area {
  border-style: dashed !important;
  transition: all var(--transition);
  cursor: pointer;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary) !important;
  background: rgba(13,110,253,.04);
}

/* ===============================
   TYPE LABELS (add-listing)
   =============================== */
.type-label {
  cursor: pointer;
  border: 2px solid #dee2e6 !important;
  border-radius: 12px !important;
  transition: all var(--transition);
}
.type-label:hover {
  border-color: var(--primary) !important;
  background: rgba(13,110,253,.04);
  color: var(--primary);
}

/* ===============================
   ALERTS & BADGES
   =============================== */
.alert { border-radius: 10px !important; border: none; }
.badge { font-weight: 500; letter-spacing: .3px; }

/* ===============================
   PAGINATION
   =============================== */
.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 2px;
  border: 1px solid #dee2e6;
  color: #555;
  transition: all var(--transition);
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}
.pagination .page-link:hover { background: #e9ecef; color: var(--primary); }

/* ===============================
   FOOTER
   =============================== */
.site-footer { background: #0f172a; }
.site-footer a { color: rgba(255,255,255,.65); transition: color var(--transition); }
.site-footer a:hover { color: #fff; }
.footer-brand img { height: 36px; filter: brightness(10); }

/* ===============================
   BACK TO TOP
   =============================== */
#backToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px; height: 42px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(13,110,253,.4);
  z-index: 999;
  transition: all var(--transition);
}
#backToTop:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(13,110,253,.5); }
#backToTop.show { display: flex; }

/* ===============================
   LIGHTBOX
   =============================== */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-overlay img { max-height: 90vh; max-width: 90vw; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  font-size: 32px; color: #fff; cursor: pointer; line-height: 1;
}

/* ===============================
   TOAST NOTIFICATIONS
   =============================== */
.toast-container { position: fixed; top: 80px; right: 16px; z-index: 9000; }
.n2s-toast {
  min-width: 260px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  animation: slideInRight .3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===============================
   PRICE RANGE SLIDER
   =============================== */
.price-range input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}
.price-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(13,110,253,.4);
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 767px) {
  .hero-section { min-height: 320px; }
  .hero-section h1 { font-size: 1.8rem; }
  .stat-number { font-size: 1.4rem; }
  .listing-card .card-img-top { height: 160px; }
  .listing-gallery .main-img { height: 240px; }
  .listing-list-item .list-img { width: 80px; height: 64px; }
}

/* ===============================
   UTILITY
   =============================== */
.img-fit { object-fit: cover; }
.rounded-xl { border-radius: 16px !important; }
.shadow-soft { box-shadow: var(--card-shadow) !important; }
.border-dashed { border-style: dashed !important; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gap-2 { gap: .5rem; }
.w-fit { width: fit-content; }
.z-1 { z-index: 1; }
