/* Profit Shop — Admin panel theme (Bootstrap 5.3, premium dark sidebar). */
:root { --sidebar-w: 248px; }

body {
  /* Light slate base + fixed brand mesh so the glass cards have something
     soft and colorful to refract. */
  background-color: #f4f7fe;
  background-image:
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.1) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.12) 0, transparent 50%),
    radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.08) 0, transparent 50%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #1F2937;
}
.admin-shell { display: flex; min-height: 100vh; background: transparent; }
/* The main column stays transparent so the fixed body mesh shows through. */
.admin-main,
.admin-content { background: transparent; }

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(99, 102, 241, 0.24) 0%, rgba(99, 102, 241, 0) 44%),
    linear-gradient(180deg, #0f172a, #1e1b4b);
  color: #e2e8f0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.1rem 1.2rem; color: #fff; text-decoration: none;
  font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.brand-mark.lg { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 14px; }
.admin-nav { padding: .85rem .8rem; display: flex; flex-direction: column; gap: 0; flex: 1; overflow-y: auto; }
.admin-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .72rem .9rem; margin-bottom: 4px;
  border-radius: 12px;
  color: #cbd5e1; text-decoration: none; font-size: .93rem; font-weight: 500;
  transition: all 0.3s ease;
}
.admin-link:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(6px);
  color: #ffffff;
}
.admin-link:focus-visible {
  outline: 2px solid #a5b4fc; outline-offset: 2px; color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.admin-link.active {
  background: linear-gradient(135deg, #4F46E5, #3B82F6);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}
/* The active item keeps its gradient (and glow) on hover. */
.admin-link.active:hover,
.admin-link.active:focus-visible {
  background: linear-gradient(135deg, #4F46E5, #3B82F6);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}
.admin-link i {
  flex: 0 0 20px;
  width: 20px;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
  color: #94a3b8;
  transition: color 0.3s ease;
}
.admin-link:hover i,
.admin-link:focus-visible i,
.admin-link.active i {
  color: #ffffff;
}

/* Slim custom scrollbar for the dark sidebar/nav. */
.admin-sidebar,
.admin-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.admin-sidebar::-webkit-scrollbar,
.admin-nav::-webkit-scrollbar { width: 5px; }
.admin-sidebar::-webkit-scrollbar-track,
.admin-nav::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb,
.admin-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover,
.admin-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
/* Dark sidebar text must stay light — override the light-surface colors that
   admin-modern.css sets for these same elements (this file loads last). */
.admin-sidebar .brand-text { color: #fff; }
.admin-sidebar .admin-brand:focus-visible {
  outline: 2px solid #a5b4fc; outline-offset: 2px;
}
.admin-sidebar .admin-user .fw-semibold { color: #f1f5f9; }
.admin-sidebar .admin-user .text-muted,
.admin-sidebar .admin-side-foot .text-muted { color: #94a3b8 !important; }
.admin-side-foot { padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
/* Logout sits on the dark sidebar — keep it high-contrast. */
.admin-side-foot .btn-outline-primary {
  color: #e2e8f0; border-color: rgba(226,232,240,.45); background: transparent;
}
.admin-side-foot .btn-outline-primary:hover,
.admin-side-foot .btn-outline-primary:focus {
  background: #6366f1; border-color: #6366f1; color: #fff;
}
.admin-user { display: flex; align-items: center; gap: .6rem; }
.admin-user .avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #6366f1; color: #fff; font-weight: 700;
}

/* Main */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px -18px rgba(31, 38, 135, 0.28);
  padding: .9rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10; color: #1f2937;
  gap: .75rem;
}
.topbar-title { font-size: 1.25rem; margin: 0; font-weight: 700; color: #0f172a; }
.admin-content { padding: 1.5rem; width: 100%; }
.topbar-left { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.topbar-left .topbar-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Mobile drawer controls (hidden on desktop). */
.admin-menu-toggle,
.sidebar-close {
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.admin-menu-toggle {
  width: 42px; height: 42px; flex: 0 0 auto;
  border: 1px solid #e2e8f0; border-radius: 10px;
  background: #fff; color: #0f172a; font-size: 1.4rem; line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}
.admin-menu-toggle:hover { background: #f1f5f9; border-color: #cbd5e1; }
.admin-menu-toggle:focus-visible,
.sidebar-close:focus-visible {
  outline: 3px solid rgba(37,99,235,.35); outline-offset: 2px;
}
.sidebar-close {
  position: absolute; top: .85rem; right: .85rem;
  width: 36px; height: 36px; z-index: 2;
  border: 1px solid rgba(255,255,255,.28); border-radius: 10px;
  background: rgba(255,255,255,.10); color: #e2e8f0; font-size: 1rem;
}
.sidebar-close:hover { background: rgba(255,255,255,.20); color: #fff; }

/* Backdrop is only rendered on mobile (see media query below). */
.admin-backdrop { display: none; }

/* Stat cards — aligned with the glassmorphism card theme in admin-modern.css */
.stat-card { border-radius: 24px; }
.stat-icon {
  width: 50px; height: 50px; flex: 0 0 50px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.375rem;
}
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: #1e293b; }
.stat-label { font-size: .875rem; font-weight: 500; color: #64748b; }

/* Login — same light mesh + glass language as the dashboard. */
.login-body {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background-color: #f4f7fe;
  background-image:
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.1) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.12) 0, transparent 50%),
    radial-gradient(at 0% 100%, rgba(139, 92, 246, 0.08) 0, transparent 50%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Soft colour blobs behind the card so the glass has something to refract. */
.login-body::before,
.login-body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(6px);
}

.login-body::before {
  width: 420px;
  height: 420px;
  top: -150px;
  left: -130px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0) 68%);
}

.login-body::after {
  width: 470px;
  height: 470px;
  right: -160px;
  bottom: -190px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.26) 0%, rgba(56, 189, 248, 0) 68%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  border: 0;
}

/* Mobile: off-canvas drawer sidebar (replaces the old horizontal top strip) */
@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .admin-main { width: 100%; }

  /* Fixed vertical drawer, hidden off-screen until .sidebar-open is added. */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out, visibility 0.3s ease;
    visibility: hidden;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.45);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .admin-sidebar.sidebar-open {
    transform: translateX(0);
    visibility: visible;
  }

  /* Keep navigation stacked vertically with visible labels. */
  .admin-nav {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .admin-link span { display: inline; }

  /* Show the mobile-only controls. */
  .admin-menu-toggle,
  .sidebar-close { display: inline-flex; }
  .admin-brand { padding-right: 3.25rem; }

  .admin-topbar { padding: 0.7rem 1rem; }
  .admin-content { padding: 1rem; }

  /* Dark overlay behind the drawer; tap it to close. */
  .admin-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .admin-backdrop.show {
    opacity: 1;
    visibility: visible;
  }

  /* Prevent the page behind the open drawer from scrolling. */
  body.drawer-open { overflow: hidden; }
}

/* =====================================================================
   GLOBAL 3D GLASSMORPHISM UPGRADE
   ---------------------------------------------------------------------
   This file loads after admin-modern.css, so the rules below re-assert the
   glass geometry over Bootstrap's `border-0` / `shadow-*` utilities, which
   use !important on nearly every admin card.
   ===================================================================== */

.card,
.card.border-0,
.card.shadow-sm,
.card.shadow-md,
.card.shadow-lg {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3)) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 24px !important;
  box-shadow: 8px 8px 32px 0 rgba(31, 38, 135, 0.04),
              inset 2px 2px 5px rgba(255, 255, 255, 0.6) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #1F2937;
}

/* Generic cards only deepen their shadow, so tables and action buttons never
   move. Interactive cards (stat widgets, opt-in `.card-hover`) lift. */
.card:hover {
  box-shadow: 12px 12px 38px 0 rgba(31, 38, 135, 0.10),
              inset 2px 2px 5px rgba(255, 255, 255, 0.7) !important;
}

.card-hover:hover,
.interactive-card:hover {
  transform: translateY(-4px);
  box-shadow: 16px 18px 42px -12px rgba(31, 38, 135, 0.20),
              0 10px 24px -12px rgba(31, 38, 135, 0.16),
              inset 2px 2px 5px rgba(255, 255, 255, 0.8) !important;
}

/* Interactive dashboard stat cards lift slightly. The chart/widget cards
   stay put so the pointer never drags the chart. */
.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 16px 18px 42px -12px rgba(31, 38, 135, 0.20),
              0 10px 24px -12px rgba(31, 38, 135, 0.16),
              inset 2px 2px 5px rgba(255, 255, 255, 0.8) !important;
}

.glass-card:hover {
  box-shadow: 12px 12px 40px 0 rgba(31, 38, 135, 0.10),
              inset 2px 2px 5px rgba(255, 255, 255, 0.75) !important;
}

/* Keep the selected ad-network card visibly selected (ads.php). */
.card.border-0.border-primary {
  border: 2px solid #4F46E5 !important;
  box-shadow: 0 12px 32px -14px rgba(79, 70, 229, 0.45),
              inset 2px 2px 5px rgba(255, 255, 255, 0.7) !important;
}

.card-header,
.card-footer {
  background-color: rgba(255, 255, 255, 0.26) !important;
  border-color: rgba(15, 23, 42, 0.05) !important;
}

/* A few headers explicitly ask for a white/transparent strip. */
.card-header.bg-white,
.card-header.bg-transparent {
  background: transparent !important;
}

/* Badges and small icon/counter surfaces get the same soft depth. */
.badge {
  box-shadow: 0 2px 8px rgba(31, 38, 135, 0.08);
}

/* Login card: translucent glass over the light mesh, same surface as the
   dashboard widgets. Kept explicit here so it stays consistent no matter
   which stylesheet a page loads last. */
.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.32)) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 24px !important;
  box-shadow: 8px 8px 32px 0 rgba(31, 38, 135, 0.08),
              inset 2px 2px 5px rgba(255, 255, 255, 0.6) !important;
}

/* Floating surfaces that live above the page (alerts, menus, modals). */
.alert {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px -20px rgba(31, 38, 135, 0.4);
}

.modal-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 60px -20px rgba(15, 23, 42, 0.5);
}

.dropdown-menu {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -22px rgba(31, 38, 135, 0.5);
}
