/* ============================================================
   SABIUPDATE — Main Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #6C5CE7;
  --primary-light: #a29bfe;
  --primary-dark:  #4c3dd4;
  --secondary:     #00cec9;
  --success:       #00b894;
  --danger:        #d63031;
  --warning:       #fdcb6e;
  --info:          #0984e3;
  --dark:          #2d3436;
  --light:         #f8f9fa;
  --gray:          #636e72;
  --border:        #e9ecef;

  /* Sidebar */
  --sidebar-width:     260px;
  --sidebar-bg:        #1e1b4b;
  --sidebar-text:      rgba(255,255,255,.7);
  --sidebar-active:    #fff;
  --sidebar-hover-bg:  rgba(255,255,255,.08);
  --sidebar-active-bg: rgba(108,92,231,.5);

  /* Layout */
  --topbar-height: 64px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 20px rgba(0,0,0,.06);
  --shadow-md:     0 4px 30px rgba(0,0,0,.1);
  --transition:    all .2s ease;
}

[data-bs-theme="dark"] {
  --bs-body-bg:    #0f0e1a;
  --bs-body-color: #e2e8f0;
  --border:        rgba(255,255,255,.08);
  --shadow:        0 2px 20px rgba(0,0,0,.3);
  --card-bg:       #1a1826;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── Dashboard Layout ───────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: var(--topbar-height);
}

.sidebar-logo { height: 36px; object-fit: contain; }
.sidebar-brand { color: #fff; font-size: 1.2rem; font-weight: 800; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-nav .nav { padding: 0 .75rem; gap: .125rem; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--sidebar-text);
  padding: .625rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: var(--sidebar-hover-bg);
}

.sidebar-nav .nav-link.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: .75rem 1.5rem;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin .3s ease;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 1.5rem;
  background: var(--bs-body-bg, #fff);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem 1rem;
  gap: .5rem;
  min-width: 260px;
}

[data-bs-theme="dark"] .search-box { background: rgba(255,255,255,.05); }

.search-box i { color: var(--gray); font-size: .9rem; }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: .875rem;
  color: inherit;
  width: 100%;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 100;
  max-height: 360px;
  overflow-y: auto;
}

.search-results.show { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  transition: var(--transition);
  cursor: pointer;
}
.search-result-item:hover { background: var(--light); }
.search-result-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }

/* Buttons */
.btn-icon {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray);
  transition: var(--transition);
}
.btn-icon:hover { background: var(--light); color: var(--dark); }
[data-bs-theme="dark"] .btn-icon:hover { background: rgba(255,255,255,.08); color: #fff; }

/* User Menu */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
  color: inherit;
  transition: var(--transition);
}
.user-menu-btn:hover { background: var(--light); }
[data-bs-theme="dark"] .user-menu-btn:hover { background: rgba(255,255,255,.08); }

.user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
}

/* Notification */
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-dropdown {
  width: 340px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.notif-item {
  display: flex;
  gap: .875rem;
  padding: .875rem 1.25rem;
  transition: var(--transition);
  color: inherit;
  border-bottom: 1px solid var(--border);
}
.notif-item:hover { background: var(--light); }
.notif-item.unread { background: rgba(108,92,231,.04); }

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-primary-soft { background: rgba(108,92,231,.12); }
.bg-success-soft  { background: rgba(0,184,148,.12); }
.bg-warning-soft  { background: rgba(253,203,110,.2); }
.bg-danger-soft   { background: rgba(214,48,49,.1); }
.bg-info-soft     { background: rgba(9,132,227,.1); }

.notif-title  { font-size: .875rem; font-weight: 600; margin-bottom: .1rem; }
.notif-text   { font-size: .78rem; color: var(--gray); }
.notif-time   { font-size: .72rem; color: var(--gray); margin-top: .2rem; }

/* Page Content */
.page-content {
  flex: 1;
  padding: 1.75rem 1.5rem;
}

.dashboard-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

[data-bs-theme="dark"] .card {
  background: var(--card-bg);
  border-color: var(--border);
}

.stat-card {
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: .78rem; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-change { font-size: .8rem; font-weight: 600; }

/* ── Welcome Card ───────────────────────────────────────────── */
.welcome-card {
  background: linear-gradient(135deg, var(--primary) 0%, #4c3dd4 60%, var(--secondary) 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.welcome-card::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 60px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.wallet-balance-display {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ── Quick Actions ──────────────────────────────────────────── */
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  color: inherit;
  text-decoration: none;
  background: var(--bs-body-bg, #fff);
}

.quick-action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(108,92,231,.15);
  transform: translateY(-3px);
  color: var(--primary);
}

.quick-action-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(108,92,231,.1);
  color: var(--primary);
}

.quick-action-label {
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ── Product Cards ──────────────────────────────────────────── */
.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bs-body-bg, #fff);
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: rgba(108,92,231,.3);
}

.product-card.out-of-stock { cursor: default; opacity: .7; }
.product-card.out-of-stock:hover { transform: none; box-shadow: var(--shadow); }

.product-image-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f1f2f6;
}

.product-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.product-card:hover .product-image-wrap img { transform: scale(1.04); }

.product-badge {
  position: absolute;
  top: .6rem; left: .6rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.product-body {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: .8rem;
  color: var(--gray);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .75rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

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

.product-stock {
  font-size: .75rem;
  color: var(--gray);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
}
.btn-gradient:hover {
  background: linear-gradient(135deg, var(--primary-dark), #00b0ac);
  color: #fff;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table th {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray);
  white-space: nowrap;
}

.table td { vertical-align: middle; font-size: .875rem; }

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.status-pending     { background: rgba(253,203,110,.2);  color: #b7791f; }
.status-processing  { background: rgba(9,132,227,.12);   color: #0984e3; }
.status-completed   { background: rgba(0,184,148,.15);   color: #00897b; }
.status-cancelled   { background: rgba(214,48,49,.1);    color: #d63031; }
.status-refunded    { background: rgba(108,92,231,.12);  color: var(--primary); }

/* ── Landing Page ───────────────────────────────────────────── */
.hero-section {
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f0e1a 0%, #1e1b4b 50%, #12124e 100%);
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
}

.hero-section::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,.3) 0%, transparent 70%);
  top: -100px; right: -100px;
}

.hero-section::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,206,201,.2) 0%, transparent 70%);
  bottom: -50px; left: -50px;
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(108,92,231,.2);
  border: 1px solid rgba(108,92,231,.4);
  color: var(--primary-light);
  padding: .4rem 1rem;
  border-radius: 20px;
  font-size: .825rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.7);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.1);
}

.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.hero-stat-label {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: .2rem;
}

.hero-mockup {
  position: relative;
  z-index: 1;
}

.hero-dashboard-card {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 1.5rem;
  color: #fff;
}

/* Feature Cards */
.feature-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
  height: 100%;
  background: var(--bs-body-bg, #fff);
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(108,92,231,.12);
  transform: translateY(-4px);
}

.feature-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(108,92,231,.15), rgba(0,206,201,.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary);
  margin: 0 auto 1.25rem;
}

/* How It Works */
.step-card {
  position: relative;
  text-align: center;
  padding: 2rem 1.5rem;
}

.step-number {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.step-connector {
  position: absolute;
  top: 50px;
  right: -30%;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: .3;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #4c3dd4 60%, var(--secondary) 100%);
  color: #fff;
  border-radius: 24px;
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  top: -80px; right: -80px;
}

/* Public Nav */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(15,14,26,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: .875rem 0;
}

.public-nav .navbar-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.public-nav .nav-link {
  color: rgba(255,255,255,.75) !important;
  font-size: .875rem;
  font-weight: 500;
  padding: .4rem .85rem !important;
  transition: var(--transition);
}

.public-nav .nav-link:hover { color: #fff !important; }

/* ── Responsive / Mobile Sidebar ────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1035;
  display: none;
}

.sidebar-overlay.show { display: block; }

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .page-content { padding: 1.25rem 1rem; }

  .hero-mockup { display: none; }

  .hero-stats { gap: 1.25rem; }

  .step-connector { display: none; }
}

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

.rounded-xl  { border-radius: var(--radius) !important; }
.rounded-2xl { border-radius: 20px !important; }

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: .75rem;
}

.section-subtitle {
  color: var(--gray);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* Loading spinner */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Admin Sidebar (lighter variant) */
.admin-sidebar {
  --sidebar-bg: #1e293b;
  --sidebar-active-bg: rgba(108,92,231,.4);
}

/* Pagination */
.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.page-link { color: var(--primary); }
.page-link:hover { color: var(--primary-dark); }

/* Wallet Page */
.wallet-card-big {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 20px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Form styles */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,.15);
}

.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .4rem; }

/* Toast */
.toast-container { z-index: 9999; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state-icon {
  font-size: 4rem;
  color: var(--gray);
  opacity: .4;
  margin-bottom: 1rem;
}
