/* ============================================================
   STYLE KUSTOM BERSAMA — dipakai di semua halaman TopUpGame
   ============================================================ */

/* ---------------- THEME VARIABLES (for custom CSS components) ---------------- */
:root {
  /* Light mode — soft warm tones, not too bright */
  --color-text-primary: #1E293B;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;
  --color-bg-overlay: rgba(15, 23, 42, 0.4);
  --color-scrollbar: #CBD5E1;
  --color-scrollbar-thumb: #94A3B8;
  --color-table-header: #EEF0F4;
  --color-table-border: #D5D9E0;
  --color-table-row-hover: rgba(124, 58, 237, 0.04);
  --color-modal-bg: #F8F9FB;
  --color-modal-border: #D5D9E0;
  --color-processing-bg: rgba(238, 240, 244, 0.92);
}

html.dark {
  --color-text-primary: #F9FAFB;
  --color-text-secondary: #D4D4D8;
  --color-text-muted: #A1A1AA;
  --color-bg-overlay: rgba(0, 0, 0, 0.65);
  --color-scrollbar: #26262D;
  --color-scrollbar-thumb: #3f3f46;
  --color-table-header: #121214;
  --color-table-border: #26262D;
  --color-table-row-hover: rgba(124, 58, 237, 0.06);
  --color-modal-bg: #121214;
  --color-modal-border: #26262D;
  --color-processing-bg: rgba(10, 10, 13, 0.85);
}

/* ---------------- THEME TRANSITION ---------------- */
body,
aside,
header,
main,
.modal-panel,
.dataTables_wrapper,
.dataTables_wrapper select,
.dataTables_wrapper .dataTables_filter input {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ---------------- BASE STYLES ---------------- */
body {
  font-family: 'Inter', sans-serif;
  background-color: #0A0A0D;
  color: var(--color-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}
html:not(.dark) body {
  background-color: #EEF0F4;
}

h1, h2, h3, .font-display {
  font-family: 'Poppins', sans-serif;
}

/* ---------------- TEXT COLOR OVERRIDES (Light Mode) ---------------- */
html:not(.dark) .text-zinc-100 { color: #1E293B !important; }
html:not(.dark) .text-zinc-200 { color: #334155 !important; }
html:not(.dark) .text-zinc-300 { color: #475569 !important; }
html:not(.dark) .text-zinc-400 { color: #64748B !important; }
html:not(.dark) .text-zinc-500 { color: #94A3B8 !important; }
html:not(.dark) .text-zinc-600 { color: #94A3B8 !important; }
html:not(.dark) .hover\:text-white:hover { color: #1E293B !important; }
html:not(.dark) .placeholder\:text-zinc-600::placeholder { color: #94A3B8 !important; }

/* ---------------- LIGHT MODE: TAILWIND BASE-* OVERRIDES ---------------- */
/* Background */
html:not(.dark) .bg-base-950 { background-color: #EEF0F4 !important; }
html:not(.dark) .bg-base-950\/80 { background-color: rgba(238, 240, 244, 0.8) !important; }
html:not(.dark) .bg-base-900 { background-color: #F5F6F8 !important; }
html:not(.dark) .bg-base-900\/50 { background-color: rgba(245, 246, 248, 0.5) !important; }
html:not(.dark) .bg-base-800 { background-color: #E2E5EA !important; }
html:not(.dark) .bg-base-800\/50 { background-color: rgba(226, 229, 234, 0.5) !important; }
html:not(.dark) .bg-base-800\/80 { background-color: rgba(226, 229, 234, 0.8) !important; }
html:not(.dark) .bg-base-700 { background-color: #D1D5DB !important; }
html:not(.dark) .bg-base-700\/50 { background-color: rgba(209, 213, 219, 0.5) !important; }

/* Hover background */
html:not(.dark) .hover\:bg-base-800:hover { background-color: #D5D9E0 !important; }
html:not(.dark) .hover\:bg-base-700:hover { background-color: #CBD5E1 !important; }
html:not(.dark) .hover\:bg-base-900:hover { background-color: #F0F1F4 !important; }

/* Border */
html:not(.dark) .border-base-700 { border-color: #D5D9E0 !important; }
html:not(.dark) .border-base-600 { border-color: #C0C5CE !important; }
html:not(.dark) .border-base-700\/50 { border-color: rgba(213, 217, 224, 0.5) !important; }

/* Divider (border-t, border-b with base-700) */
html:not(.dark) .divide-base-700 > :not([hidden]) ~ :not([hidden]) { border-color: #D5D9E0 !important; }

/* ---------------- SCROLLBAR ---------------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------------- Homepage: kartu game ---------------- */
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(135deg, #7C3AED, transparent 40%, #22D3EE);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.game-card:hover::before { opacity: 1; }

/* ---------------- Halaman Detail Game: kartu nominal & metode bayar ---------------- */
.option-card.selected {
  border-color: #7C3AED;
  background: linear-gradient(180deg, rgba(124,58,237,0.12), rgba(34,211,238,0.05));
  box-shadow: 0 0 0 1px #7C3AED, 0 0 20px -6px rgba(124,58,237,0.55);
}
html.dark .option-card.selected {
  background: linear-gradient(180deg, rgba(124,58,237,0.12), rgba(34,211,238,0.05));
}
html:not(.dark) .option-card.selected {
  background: linear-gradient(180deg, rgba(124,58,237,0.10), rgba(34,211,238,0.04));
}
.option-card.selected .check-badge { opacity: 1; transform: scale(1); }
.check-badge { opacity: 0; transform: scale(0.5); transition: all 0.2s ease; }

/* ---------------- Halaman Status Pembayaran: timeline ---------------- */
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px; top: 32px;
  width: 2px; height: calc(100% - 8px);
  background: #26262D;
}
html:not(.dark) .timeline-item:not(:last-child)::after { background: #D5D9E0; }
.timeline-item.done:not(:last-child)::after { background: #7C3AED; }

/* ---------------- Halaman Auth: indikator kekuatan password ---------------- */
.strength-bar { height: 4px; border-radius: 999px; background: #26262D; transition: background 0.25s ease; }
html:not(.dark) .strength-bar { background: #D5D9E0; }
.strength-bar.active-weak { background: #EF4444; }
.strength-bar.active-mid { background: #F59E0B; }
.strength-bar.active-strong { background: #10B981; }

/* ---------------- Welcome Card (Member Dashboard) ---------------- */
.welcome-card {
  background: linear-gradient(135deg, rgba(88,28,135,0.4), #1B1B20 40%, rgba(8,145,178,0.2));
}
html:not(.dark) .welcome-card {
  background: linear-gradient(135deg, rgba(139,92,246,0.1), #E2E5EA 40%, rgba(34,211,238,0.06));
}

/* ---------------- Dashboard Admin & Member: sidebar ---------------- */
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(124,58,237,0.18), rgba(34,211,238,0.06));
  color: #fff;
  border-left: 2px solid #7C3AED;
}
html:not(.dark) .sidebar-link.active {
  color: #1E293B;
}
.sidebar-link.active .sidebar-icon { color: #A78BFA; }

/* Overlay & drawer sidebar mobile */
#sidebarOverlay { transition: opacity 0.25s ease; }
#sidebar { transition: transform 0.3s ease; }

/* ---------------- Badge status transaksi (dipakai admin & member) ---------------- */
.badge-success { background: rgba(16,185,129,0.12); color: #34D399; border: 1px solid rgba(16,185,129,0.3); }
.badge-pending { background: rgba(245,158,11,0.12); color: #FBBF24; border: 1px solid rgba(245,158,11,0.3); }
.badge-failed  { background: rgba(239,68,68,0.12); color: #F87171; border: 1px solid rgba(239,68,68,0.3); }

/* ---------------- Bar chart sederhana (dashboard admin) ---------------- */
.chart-bar {
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #7C3AED, #22D3EE);
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  opacity: 0.85;
}
.chart-bar:hover { opacity: 1; }

/* Scrollbar tipis untuk tabel yang bisa digeser horizontal di mobile */
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: #26262D; border-radius: 999px; }
html:not(.dark) .table-scroll::-webkit-scrollbar-thumb { background: #C0C5CE; }

/* ============================================================
   DATATABLES THEME OVERRIDES
   ============================================================ */
.dataTables_wrapper {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Top section: length menu + search */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  padding: 12px 16px;
  color: var(--color-text-muted);
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.dataTables_wrapper select {
  background-color: #1B1B20;
  color: var(--color-text-secondary);
  border: 1px solid #26262D;
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font-size: 0.8125rem;
  outline: none;
  appearance: auto;
  transition: border-color 0.2s, background-color 0.3s, color 0.3s;
}
html:not(.dark) .dataTables_wrapper select {
  background-color: #E2E5EA;
  border-color: #D5D9E0;
}

.dataTables_wrapper select:focus {
  border-color: #7C3AED;
}

.dataTables_wrapper .dataTables_filter input {
  background-color: #121214;
  color: var(--color-text-secondary);
  border: 1px solid #26262D;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
}
html:not(.dark) .dataTables_wrapper .dataTables_filter input {
  background-color: #F5F6F8;
  border-color: #D5D9E0;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Table */
#transactionsTable.dataTable {
  width: 100% !important;
  border-collapse: collapse;
}

#transactionsTable.dataTable thead th {
  background-color: var(--color-table-header);
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-table-border);
  white-space: nowrap;
}

#transactionsTable.dataTable thead th.sorting,
#transactionsTable.dataTable thead th.sorting_asc,
#transactionsTable.dataTable thead th.sorting_desc {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 22px;
}

#transactionsTable.dataTable thead th.sorting::after,
#transactionsTable.dataTable thead th.sorting_asc::after,
#transactionsTable.dataTable thead th.sorting_desc::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #52525b;
  opacity: 0;
}

#transactionsTable.dataTable thead th.sorting_asc::after {
  opacity: 1;
  border-top: none;
  border-bottom: 5px solid #a78bfa;
}

#transactionsTable.dataTable thead th.sorting_desc::after {
  opacity: 1;
  border-top: 5px solid #a78bfa;
}

#transactionsTable.dataTable tbody tr {
  border-bottom: 1px solid var(--color-table-border);
  transition: background-color 0.15s;
}

#transactionsTable.dataTable tbody tr:hover {
  background-color: var(--color-table-row-hover);
}

#transactionsTable.dataTable tbody td {
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Footer: info + paginate */
.dataTables_wrapper .dataTables_info {
  padding: 12px 16px;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate {
  padding: 12px 16px;
  text-align: right;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  margin: 0 2px;
  border: 1px solid #26262D;
  border-radius: 8px;
  background: #1B1B20;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  box-sizing: border-box;
}
html:not(.dark) .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-color: #D5D9E0;
  background: #E2E5EA;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #26262D;
  color: var(--color-text-secondary);
  border-color: #3f3f46;
}
html:not(.dark) .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #D5D9E0;
  border-color: #C0C5CE;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(135deg, #7C3AED, #22D3EE);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.3;
  cursor: not-allowed;
  background: transparent;
  color: #52525b;
  border-color: transparent;
}

/* Processing overlay */
.dataTables_processing {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  background: var(--color-processing-bg);
  backdrop-filter: blur(4px);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-align: center;
  padding: 24px;
  z-index: 10;
}

/* No data */
.dataTables_empty {
  text-align: center;
  color: #52525b;
  padding: 48px 16px !important;
  font-size: 0.875rem;
}

/* Search icon in input */
.dataTables_wrapper .dataTables_filter input[type="search"] {
  padding-left: 12px;
}

/* ============================================================
   MODAL — Single Hit
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-panel {
  background: var(--color-modal-bg);
  border: 1px solid var(--color-modal-border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.92) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.modal-overlay.active .modal-panel {
  transform: scale(1) translateY(0);
}

/* Toast / notification */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
}

.toast.show { transform: translateX(0); }
.toast.success { background: linear-gradient(135deg, #059669, #10B981); }
.toast.error   { background: linear-gradient(135deg, #DC2626, #EF4444); }
.toast.info    { background: linear-gradient(135deg, #7C3AED, #A78BFA); }

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  background-color: #1B1B20;
  color: var(--color-text-primary);
}
html:not(.dark) .theme-toggle:hover {
  background-color: #F3F4F6;
}

html.dark .theme-toggle [data-theme-icon="sun"],
html.dark .theme-toggle [data-lucide="sun"] { display: none !important; }
html.dark .theme-toggle [data-theme-icon="moon"],
html.dark .theme-toggle [data-lucide="moon"] { display: block !important; }
html:not(.dark) .theme-toggle [data-theme-icon="sun"],
html:not(.dark) .theme-toggle [data-lucide="sun"] { display: block !important; }
html:not(.dark) .theme-toggle [data-theme-icon="moon"],
html:not(.dark) .theme-toggle [data-lucide="moon"] { display: none !important; }
