/**
 * Dark mode — Aim Cheats / SellAuth-inspired green on charcoal (#1e1f22)
 * Loads after theme-cheat-light.css; only [data-bs-theme="dark"]
 */
[data-bs-theme="dark"] {
  color-scheme: dark;

  /* Brand tokens */
  --cheat-bg: #1e1f22;
  --cheat-bg-elevated: #24262b;
  --cheat-surface: #2a2c31;
  --cheat-surface-2: #2a2c31;
  --cheat-text: #eceef2;
  --cheat-muted: #9ba1ad;
  --cheat-primary: #8fe3c0;
  --cheat-primary-dim: #8aa8ff;
  --cheat-accent: #8fe3c0;
  --cheat-accent-glow: rgba(143, 227, 192, 0.35);
  --cheat-danger: #f87171;
  --cheat-success: #8fe3c0;
  --cheat-border: rgba(255, 255, 255, 0.07);
  --cheat-grid: transparent;

  /* Bootstrap overrides (replaces template purple) */
  --bs-body-bg: var(--cheat-bg);
  --bs-body-bg-rgb: 30, 31, 34;
  --bs-body-color: #c7cbd3;
  --bs-body-color-rgb: 184, 190, 200;
  --bs-emphasis-color: var(--cheat-text);
  --bs-secondary-bg: var(--cheat-surface);
  --bs-tertiary-bg: var(--cheat-surface-2);
  --bs-border-color: rgba(255, 255, 255, 0.08);
  --bs-border-color-translucent: rgba(255, 255, 255, 0.1);
  --bs-heading-color: var(--cheat-text);
  --bs-link-color: var(--cheat-accent);
  --bs-link-hover-color: #b5f0d6;
  --bs-link-color-rgb: 143, 227, 192;
  --bs-link-hover-color-rgb: 181, 240, 214;
  --bs-primary: var(--cheat-primary);
  --bs-primary-rgb: 143, 227, 192;
  --bs-primary-text: var(--cheat-accent);
  --bs-success: var(--cheat-success);
  --bs-success-rgb: 143, 227, 192;
  --bs-mode: var(--cheat-bg-elevated);
  --bs-light: #33363d;
  --bs-dark: #17181b;
  --bs-nav-pills-link-active-bg: var(--cheat-primary);
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] #BodyMaster {
  background-color: var(--cheat-bg) !important;
  background-image:
    linear-gradient(var(--cheat-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--cheat-grid) 1px, transparent 1px),
    radial-gradient(circle at 15% 0%, rgba(143, 227, 192, 0.12), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(138, 168, 255, 0.06), transparent 38%),
    linear-gradient(180deg, #1e1f22 0%, var(--cheat-bg) 45%, #1e1f22 100%) !important;
  background-size: 36px 36px, 36px 36px, auto, auto, auto !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1,
[data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5,
[data-bs-theme="dark"] .h6 {
  color: var(--cheat-text) !important;
}

[data-bs-theme="dark"] a,
[data-bs-theme="dark"] .nav-link,
[data-bs-theme="dark"] .btn-link {
  color: var(--cheat-accent);
}

[data-bs-theme="dark"] a:hover,
[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .btn-link:hover {
  color: #b5f0d6;
}

[data-bs-theme="dark"] .text-dark {
  color: var(--cheat-text) !important;
}

[data-bs-theme="dark"] .text-muted {
  color: var(--cheat-muted) !important;
}

/* Surfaces */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .dropdown-menu {
  background: linear-gradient(165deg, var(--cheat-surface) 0%, var(--cheat-surface-2) 100%) !important;
  border-color: var(--cheat-border) !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(143, 227, 192, 0.06) !important;
  color: var(--cheat-text);
}

[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] header,
[data-bs-theme="dark"] header.header-sticky-on {
  background: rgba(12, 12, 14, 0.92) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cheat-border) !important;
}

[data-bs-theme="dark"] .navbar-light-static .nav-link {
  color: var(--cheat-muted) !important;
}

[data-bs-theme="dark"] .navbar-light-static .nav-link:hover,
[data-bs-theme="dark"] .navbar-light-static .nav-link:focus,
[data-bs-theme="dark"] .navbar-light-static .nav-link.active {
  color: var(--cheat-accent) !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background: rgba(143, 227, 192, 0.12) !important;
  color: var(--cheat-accent) !important;
}

[data-bs-theme="dark"] .dropdown-item.active {
  background: rgba(143, 227, 192, 0.2) !important;
  color: #fff !important;
}

/* Buttons */
[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .bg-primary {
  background: linear-gradient(135deg, var(--cheat-primary-dim), var(--cheat-primary)) !important;
  border-color: transparent !important;
  color: #0f1f19 !important;
  box-shadow: 0 4px 18px var(--cheat-accent-glow);
}

[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:focus {
  background: linear-gradient(135deg, var(--cheat-primary), var(--cheat-accent)) !important;
  color: #0f1f19 !important;
}

[data-bs-theme="dark"] .btn-success,
[data-bs-theme="dark"] .bg-success {
  background: linear-gradient(135deg, #8aa8ff, var(--cheat-primary)) !important;
  border-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
  color: var(--cheat-accent) !important;
  border-color: var(--cheat-primary) !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background: var(--cheat-primary) !important;
  color: #0f1f19 !important;
}

/* Forms */
[data-bs-theme="dark"] input.form-control,
[data-bs-theme="dark"] select.form-select,
[data-bs-theme="dark"] textarea.form-control {
  background: var(--cheat-bg-elevated) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--cheat-text) !important;
}

[data-bs-theme="dark"] input.form-control:focus,
[data-bs-theme="dark"] select.form-select:focus,
[data-bs-theme="dark"] textarea.form-control:focus {
  border-color: var(--cheat-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(143, 227, 192, 0.2) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #6b7280;
}

/* Tables */
[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--cheat-text);
  --bs-table-border-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table-light th {
  background: rgba(143, 227, 192, 0.1) !important;
  color: var(--cheat-accent) !important;
  border-color: var(--cheat-border) !important;
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  background: rgba(143, 227, 192, 0.06) !important;
  color: var(--cheat-text);
}

/* Tabs (refill, etc.) */
[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: var(--cheat-muted);
}

[data-bs-theme="dark"] .nav-bottom-line .nav-link.active,
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  color: var(--cheat-accent) !important;
  border-bottom-color: var(--cheat-primary) !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link.active {
  background: var(--cheat-primary) !important;
  color: #0f1f19 !important;
}

/* Alerts */
[data-bs-theme="dark"] .alert-warning {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.25);
  color: #fde68a;
}

[data-bs-theme="dark"] .alert-success {
  background: rgba(143, 227, 192, 0.12);
  border-color: var(--cheat-border);
  color: #bbf7d0;
}

[data-bs-theme="dark"] .alert-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

/* Badges */
[data-bs-theme="dark"] .badge.text-bg-warning {
  background: rgba(234, 179, 8, 0.85) !important;
  color: #1a1400 !important;
}

/* Aside member menu */
[data-bs-theme="dark"] section .card.shadow-sm {
  background: linear-gradient(165deg, var(--cheat-surface), var(--cheat-surface-2)) !important;
  border-color: var(--cheat-border) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--cheat-muted);
}

[data-bs-theme="dark"] .asidemenu .btn-primary,
[data-bs-theme="dark"] section .btn-primary {
  box-shadow: 0 2px 12px var(--cheat-accent-glow);
}

/* DataTables */
[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select {
  color: var(--cheat-muted);
}

[data-bs-theme="dark"] .dataTables_paginate .paginate_button.current {
  background: var(--cheat-primary) !important;
  border-color: var(--cheat-primary) !important;
  color: #0f1f19 !important;
}

/* Refill history block */
[data-bs-theme="dark"] .refill-history-card {
  background: linear-gradient(165deg, var(--cheat-surface), var(--cheat-surface-2)) !important;
  border-color: var(--cheat-border) !important;
}

[data-bs-theme="dark"] .refill-history-toolbar.dataTables_wrapper .row:first-child {
  background: rgba(143, 227, 192, 0.08);
  border-color: var(--cheat-border);
}

[data-bs-theme="dark"] .refill-history-table-wrap {
  border-color: var(--cheat-border);
  background: var(--cheat-bg-elevated);
}

[data-bs-theme="dark"] .refill-history-table thead th {
  background: rgba(143, 227, 192, 0.12) !important;
  color: var(--cheat-accent) !important;
  border-color: var(--cheat-border) !important;
}

[data-bs-theme="dark"] .refill-history-table tbody td {
  border-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .refill-history-col-amount {
  color: var(--cheat-accent);
}

[data-bs-theme="dark"] .refill-history-badge--success {
  background: rgba(143, 227, 192, 0.2);
  color: #b5f0d6;
}

[data-bs-theme="dark"] .refill-history-badge--warning {
  background: rgba(234, 179, 8, 0.2);
  color: #fde68a;
}

[data-bs-theme="dark"] .refill-history-badge--dark {
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

[data-bs-theme="dark"] .refill-history-badge--danger {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

[data-bs-theme="dark"] .refill-history-channel-tag {
  background: var(--cheat-primary);
  color: #0f1f19;
}

/* Buy page */
[data-bs-theme="dark"] .buy-page .buy-program-card,
[data-bs-theme="dark"] .buy-page .buy-filter-card {
  border-color: var(--cheat-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .buy-page .buy-search-panel {
  background: linear-gradient(180deg, var(--cheat-surface) 0%, var(--cheat-bg-elevated) 100%) !important;
  border-color: var(--cheat-border) !important;
}

[data-bs-theme="dark"] .buy-page .buy-filter-pills .form-check-label {
  background: var(--cheat-bg-elevated);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--cheat-muted);
}

[data-bs-theme="dark"] .buy-page .buy-filter-pills .form-check-input:checked + .form-check-label {
  background: var(--cheat-primary) !important;
  border-color: var(--cheat-primary) !important;
  color: #0f1f19 !important;
}

[data-bs-theme="dark"] .buy-page .buy-meta {
  color: var(--cheat-muted) !important;
}

[data-bs-theme="dark"] .buy-page .buy-program-card:hover {
  box-shadow: 0 12px 28px rgba(143, 227, 192, 0.15) !important;
}

/* Home page — dark green instead of forced light sky */
[data-bs-theme="dark"] .page-home-ezpro {
  color-scheme: dark;
  --cat-sky-top: #1e1f22;
  --cat-sky-mid: #1e1f22;
  --cat-sky-bottom: #1e1f22;
  --cat-primary: #8fe3c0;
  --cat-primary-dark: #8aa8ff;
  --cat-card: rgba(22, 24, 28, 0.94);
  --cat-text: #eef0f3;
  --cat-muted: #9aa3b2;
  --cat-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --bs-body-bg: var(--cat-sky-mid);
  --bs-body-color: var(--cat-text);
}

[data-bs-theme="dark"] .page-home-ezpro #BodyMaster {
  background: var(--cat-sky-mid) !important;
  background-image:
    linear-gradient(hsla(0, 0%, 100%, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, hsla(0, 0%, 100%, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 20% 5%, rgba(143, 227, 192, 0.14), transparent 45%),
    linear-gradient(180deg, #1e1f22 0%, var(--cat-sky-mid) 50%, #1e1f22 100%) !important;
  background-size: 36px 36px, 36px 36px, auto, auto !important;
  color: var(--cat-text) !important;
}

[data-bs-theme="dark"] .page-home-ezpro #BodyMaster::before,
[data-bs-theme="dark"] .page-home-ezpro #BodyMaster::after {
  opacity: 0.15;
}

[data-bs-theme="dark"] .page-home-ezpro .header-sticky .navbar {
  background: var(--cat-card) !important;
  border: 1px solid var(--cheat-border);
}

[data-bs-theme="dark"] .page-home-ezpro .cat-panel,
[data-bs-theme="dark"] .page-home-ezpro .cat-announce {
  background: var(--cat-card) !important;
  border-color: var(--cheat-border) !important;
}

[data-bs-theme="dark"] .page-home-ezpro .cat-panel-title {
  border-bottom-color: var(--cheat-border);
}

[data-bs-theme="dark"] .page-home-ezpro .cat-program-tile .cat-tile-icon {
  background: var(--cheat-bg-elevated);
  border-color: rgba(143, 227, 192, 0.2);
}

[data-bs-theme="dark"] .page-home-ezpro .cat-quick-links a {
  background: rgba(143, 227, 192, 0.1);
  color: var(--cat-primary);
}

[data-bs-theme="dark"] .page-home-ezpro .cat-quick-links a:hover {
  background: rgba(143, 227, 192, 0.2);
  color: var(--cheat-accent);
}

[data-bs-theme="dark"] .page-home-ezpro .cat-discord-float {
  background: var(--cat-card);
  border-color: rgba(88, 101, 242, 0.35);
  color: var(--cat-text);
}

[data-bs-theme="dark"] .page-home-ezpro footer.bg-dark {
  background: rgba(8, 9, 10, 0.9) !important;
  border-top-color: var(--cheat-border) !important;
}
