/* ============================================================
   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: #0F172A;
  --color-text-secondary: #334155;
  --color-text-muted: #64748B;
  --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(6, 182, 212, 0.04);
  --color-modal-bg: #F8F9FB;
  --color-modal-border: #D5D9E0;
  --color-processing-bg: rgba(238, 240, 244, 0.92);
}

html.dark {
  --color-text-primary: #F8FAFC;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #94A3B8;
  --color-bg-overlay: rgba(3, 7, 18, 0.75);
  --color-scrollbar: #0C0E1E;
  --color-scrollbar-thumb: #1F2440;
  --color-table-header: #0C0E1E;
  --color-table-border: rgba(31, 36, 64, 0.75);
  --color-table-row-hover: rgba(6, 182, 212, 0.05);
  --color-modal-bg: #0C0E1E;
  --color-modal-border: #1F2440;
  --color-processing-bg: rgba(8, 9, 20, 0.9);
}

/* ---------------- 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: #080914;
  color: var(--color-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}
html:not(.dark) body {
  background-color: #F1F4F9;
}

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);
  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.35), rgba(12, 14, 30, 0.8) 40%, rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(31, 36, 64, 0.85);
  backdrop-filter: blur(12px);
}
html:not(.dark) .welcome-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), #FFFFFF 40%, rgba(6, 182, 212, 0.05));
  border: 1px solid #E2E8F0;
}

/* ---------------- Dashboard Admin & Member: sidebar ---------------- */
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.14), rgba(99, 102, 241, 0.06));
  color: #FFFFFF;
  border-left: 2px solid #06B6D4;
}
html:not(.dark) .sidebar-link.active {
  color: #0F172A;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.12), rgba(99, 102, 241, 0.04));
  border-left: 2px solid #0891B2;
}
.sidebar-link.active .sidebar-icon { color: #22D3EE; }

/* 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.14); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-pending { background: rgba(245, 158, 11, 0.14); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-failed  { background: rgba(239, 68, 68, 0.14); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.35); }

/* ---------------- Bar chart sederhana (dashboard admin) ---------------- */
.chart-bar {
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #06B6D4, #6366F1);
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.9;
}
.chart-bar:hover { opacity: 1; transform: scaleY(1.02); }

/* Scrollbar tipis untuk tabel yang bisa digeser horizontal di mobile */
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: #1F2440; border-radius: 999px; }
html:not(.dark) .table-scroll::-webkit-scrollbar-thumb { background: #CBD5E1; }

/* ============================================================
   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;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.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 disabled: permanent dark mode */
.theme-toggle { display: none !important; }

/* ============================================================
   EXECUTIVE DASHBOARD: AMBIENT DEPTH & TACTILE COMPONENTS
   ============================================================ */
.dash-body-bg {
  position: relative;
  background-color: #080914;
  background-image:
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 55%),
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.09) 0px, transparent 55%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.06) 0px, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  background-attachment: fixed;
}
html:not(.dark) .dash-body-bg {
  background-color: #F1F4F9;
  background-image:
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.dash-card {
  position: relative;
  background: rgba(12, 14, 30, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(31, 36, 64, 0.85);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.dash-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.45), 0 0 24px -6px rgba(6, 182, 212, 0.15);
}
html:not(.dark) .dash-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: #E2E8F0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
}
html:not(.dark) .dash-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.1);
}

.dash-glass {
  background: rgba(12, 14, 30, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(31, 36, 64, 0.8);
}
html:not(.dark) .dash-glass {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: #E2E8F0;
}

.stat-card-kpi {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.stat-card-kpi:hover {
  transform: translateY(-3px);
}

/* Table zebra row and glow hover */
.dash-table tbody tr {
  transition: background-color 0.15s ease;
}
.dash-table tbody tr:hover {
  background-color: rgba(6, 182, 212, 0.04);
}
html:not(.dark) .dash-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.04);
}
