/* ============================================================
   DARK-THEME.CSS - N2 Toys & Accessories Store
   Aesthetic Cyber-Dark & Pure-White Dual Theme Engine
   ============================================================ */

/* ==========================================
   1. ROOT VARIABLES (LIGHT & DARK TOKENS)
   ========================================== */
:root {
  --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  --theme-bg-body-light: linear-gradient(135deg, #fff0f5 0%, #ffe4ef 50%, #f8fafc 100%);
  --theme-card-bg-light: rgba(255, 255, 255, 0.92);
  --theme-text-light: #1e293b;
  --theme-text-muted-light: #64748b;
  --theme-border-light: rgba(226, 232, 240, 0.8);
}

/* ==========================================
   2. DARK MODE CSS VARIABLES OVERRIDES
   ========================================== */
html[data-theme="dark"],
body.dark-theme,
.dark {
  --bs-body-bg: #0b0f19;
  --bs-body-color: #f1f5f9;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: #94a3b8;
  --bs-tertiary-color: #64748b;
  --bs-border-color: #334155;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.12);

  /* Dark Tokens */
  --primary-color: #ec4899;
  --active-color: #f472b6;
  --light-bg: #0b0f19;

  /* Pink Theme Overrides */
  --grad-main: linear-gradient(135deg, #be185d 0%, #831843 50%, #4c0519 100%);
  --grad-header: linear-gradient(135deg, #1e1b4b 0%, #3b0764 45%, #831843 100%);
  --grad-card: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  --grad-bg-soft: linear-gradient(135deg, #070913 0%, #0f172a 50%, #1e1b4b 100%);
  --grad-accent: linear-gradient(45deg, #f43f5e 0%, #ec4899 50%, #a855f7 100%);
  --grad-button: linear-gradient(135deg, #db2777 0%, #e11d48 50%, #9333ea 100%);
  --grad-nav: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);

  --shadow-pink: 0 4px 24px rgba(236, 72, 153, 0.25);
  --shadow-pink-lg: 0 8px 40px rgba(236, 72, 153, 0.35);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.6);

  --glass-bg: rgba(30, 41, 59, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   3. GLOBAL ELEMENT STYLING IN DARK MODE
   ========================================== */
html[data-theme="dark"],
html[data-theme="dark"] body,
body.dark-theme {
  background: linear-gradient(135deg, #070913 0%, #0f172a 40%, #17122a 100%) !important;
  background-attachment: fixed !important;
  color: #f1f5f9 !important;
  transition: var(--theme-transition);
}

/* Page Header in Dark Mode */
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .header-section,
body.dark-theme .page-header,
body.dark-theme .header-section {
  background: linear-gradient(135deg, #1e1b4b 0%, #3b0764 45%, #831843 100%) !important;
  border-bottom: 3px solid #ec4899 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(236, 72, 153, 0.2) !important;
}

/* Cards & Glass Containers in Dark Mode */
html[data-theme="dark"] .card,
body.dark-theme .card,
html[data-theme="dark"] .bg-white:not(.btn-white):not(.badge-white),
body.dark-theme .bg-white:not(.btn-white):not(.badge-white) {
  background: rgba(30, 41, 59, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

html[data-theme="dark"] .card-header,
body.dark-theme .card-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fdf2f8 !important;
}

html[data-theme="dark"] .card-footer,
body.dark-theme .card-footer {
  background: rgba(15, 23, 42, 0.6) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Typography in Dark Mode */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme h4, body.dark-theme h5, body.dark-theme h6 {
  color: #f8fafc !important;
}

html[data-theme="dark"] p, html[data-theme="dark"] span:not(.badge):not(.badge-count),
body.dark-theme p, body.dark-theme span:not(.badge):not(.badge-count) {
  color: #cbd5e1;
}

html[data-theme="dark"] .text-muted,
body.dark-theme .text-muted,
html[data-theme="dark"] .text-slate-400,
html[data-theme="dark"] .text-slate-500 {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .text-dark,
body.dark-theme .text-dark,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-700 {
  color: #f8fafc !important;
}

/* ==========================================
   4. FORM INPUTS & SELECTS IN DARK MODE
   ========================================== */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
body.dark-theme .form-control,
body.dark-theme .form-select {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #ec4899 !important;
  box-shadow: 0 0 0 0.25rem rgba(236, 72, 153, 0.25) !important;
}

html[data-theme="dark"] .input-group-text,
body.dark-theme .input-group-text {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .form-label,
body.dark-theme .form-label {
  color: #e2e8f0 !important;
}

/* ==========================================
   5. TABLES IN DARK MODE
   ========================================== */
html[data-theme="dark"] .table,
body.dark-theme .table {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .table-responsive,
body.dark-theme .table-responsive {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .table thead th,
body.dark-theme .table thead th {
  background: linear-gradient(135deg, #1e1b4b 0%, #311042 100%) !important;
  color: #fdf2f8 !important;
  border-bottom: 2px solid #ec4899 !important;
}

html[data-theme="dark"] .table tbody tr,
body.dark-theme .table tbody tr {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
body.dark-theme .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(15, 23, 42, 0.6) !important;
}

html[data-theme="dark"] .table-hover tbody tr:hover,
body.dark-theme .table-hover tbody tr:hover {
  background-color: rgba(236, 72, 153, 0.12) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .table tbody td,
body.dark-theme .table tbody td {
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* ==========================================
   6. MODALS & DIALOGS IN DARK MODE
   ========================================== */
html[data-theme="dark"] .modal-content,
body.dark-theme .modal-content {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .modal-header,
body.dark-theme .modal-header {
  border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .modal-footer,
body.dark-theme .modal-footer {
  border-top: 1px solid #334155 !important;
  background-color: rgba(15, 23, 42, 0.5) !important;
}

html[data-theme="dark"] .btn-close,
body.dark-theme .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* ==========================================
   7. PAGINATION & NAVIGATION IN DARK MODE
   ========================================== */
html[data-theme="dark"] .page-link,
body.dark-theme .page-link {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .page-item.active .page-link,
body.dark-theme .page-item.active .page-link {
  background: linear-gradient(135deg, #db2777, #9333ea) !important;
  border-color: #db2777 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.4) !important;
}

html[data-theme="dark"] .page-item.disabled .page-link,
body.dark-theme .page-item.disabled .page-link {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
  color: #64748b !important;
}

/* ==========================================
   8. BOTTOM NAVIGATION BAR IN DARK MODE
   ========================================== */
html[data-theme="dark"] .pink-nav,
body.dark-theme .pink-nav {
  background: rgba(15, 23, 42, 0.94) !important;
  border: 1px solid rgba(236, 72, 153, 0.25) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(236, 72, 153, 0.15) !important;
}

html[data-theme="dark"] .pink-nav-item i,
html[data-theme="dark"] .pink-nav-item p,
body.dark-theme .pink-nav-item i,
body.dark-theme .pink-nav-item p {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .pink-nav-item.active i,
html[data-theme="dark"] .pink-nav-item.active p,
body.dark-theme .pink-nav-item.active i,
body.dark-theme .pink-nav-item.active p {
  color: #ec4899 !important;
  text-shadow: 0 0 12px rgba(236, 72, 153, 0.6);
}

/* ==========================================
   9. TAILWIND COMPONENT OVERRIDES IN DARK MODE
   (e.g., galeri_produk.php)
   ========================================== */
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100 {
  background-color: #0f172a !important;
}

html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-slate-200\/80 {
  border-color: #334155 !important;
}

html[data-theme="dark"] .product-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .product-card:hover {
  border-color: #ec4899 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(236, 72, 153, 0.25) !important;
}

html[data-theme="dark"] .slot-upload-box {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] #paginationWrapper {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

/* Autocomplete JQuery UI in Dark Mode */
html[data-theme="dark"] .ui-autocomplete {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .ui-menu-item {
  color: #f1f5f9 !important;
  border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .ui-state-active,
html[data-theme="dark"] .ui-widget-content .ui-state-active {
  background-color: #db2777 !important;
  color: #ffffff !important;
  border: none !important;
}

/* SweetAlert2 / Toast in Dark Mode */
html[data-theme="dark"] .swal2-popup {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

/* ==========================================
   10. AESTHETIC THEME SWITCHER BUTTON
   ========================================== */
.theme-switch-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 64, 129, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12), 0 0 10px rgba(255, 64, 129, 0.2);
  color: #831843;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  text-decoration: none !important;
}

.theme-switch-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 64, 129, 0.35);
  border-color: #ff4081;
}

.theme-switch-btn:active {
  transform: translateY(0) scale(0.96);
}

/* Dark Mode Appearance for Switcher */
html[data-theme="dark"] .theme-switch-btn,
body.dark-theme .theme-switch-btn {
  background: rgba(30, 41, 59, 0.88) !important;
  border: 1.5px solid rgba(236, 72, 153, 0.45) !important;
  color: #fdf2f8 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(236, 72, 153, 0.35) !important;
}

/* Animated Sun / Moon Icons */
.theme-icon-wrap {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff4081, #f06292);
  color: #ffffff;
  font-size: 11px;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

html[data-theme="dark"] .theme-icon-wrap,
body.dark-theme .theme-icon-wrap {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fef08a;
  transform: rotate(360deg);
}

.theme-switch-label {
  letter-spacing: 0.3px;
}

@media (max-width: 576px) {
  .theme-switch-btn {
    top: 12px;
    right: 12px;
    padding: 7px 10px;
    font-size: 11px;
  }
  .theme-switch-label {
    display: none;
  }
}

/* ==========================================
   11. SPECIFIC COMPONENT REFINEMENTS
   ========================================== */

/* POS Penjualan (penjualan_baru.php) */
html[data-theme="dark"] .total-box {
  background: linear-gradient(135deg, #831843 0%, #4338ca 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .summary-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .kembalian-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
  border-color: #10b981 !important;
  color: #ecfdf5 !important;
}

html[data-theme="dark"] .success-icon-anim {
  background: #064e3b !important;
  color: #34d399 !important;
}

html[data-theme="dark"] .quick-cash-btn {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .quick-cash-btn:hover {
  background: #334155 !important;
  color: #ec4899 !important;
}

/* Category box items (manage_produk.php) */
html[data-theme="dark"] .category-box-item {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .category-box-item:hover {
  border-color: #ec4899 !important;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.25) !important;
}

/* Search container & Filter boxes */
html[data-theme="dark"] .search-container,
html[data-theme="dark"] .filter-box {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

/* Detail Penjualan (detail_penjualan.php) */
html[data-theme="dark"] .detail-header-info {
  background: #1e293b !important;
  border-left-color: #ec4899 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .table-detail thead {
  background: linear-gradient(135deg, #831843 0%, #4338ca 100%) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .summary-box {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c0519 100%) !important;
  border: 1px solid #334155 !important;
  color: #ffffff !important;
}

/* Chart Cards (index.php, chart_penjualan.php) */
html[data-theme="dark"] .chart-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .chart-card .card-header h5 {
  color: #f472b6 !important;
}

html[data-theme="dark"] .chart-card .card-header p {
  color: #94a3b8 !important;
}

/* Menu card count badge (index.php) */
html[data-theme="dark"] .menu-card-badge {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #fdf2f8 !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .menu-grid-item:hover .menu-card-badge {
  background: #ec4899 !important;
  color: #ffffff !important;
  box-shadow: 0 5px 14px rgba(236, 72, 153, 0.5) !important;
}

/* Alerts in Dark Mode */
html[data-theme="dark"] .alert-info {
  background-color: rgba(14, 116, 144, 0.25) !important;
  border-color: #0e7490 !important;
  color: #67e8f9 !important;
}

html[data-theme="dark"] .alert-success {
  background-color: rgba(21, 128, 61, 0.25) !important;
  border-color: #15803d !important;
  color: #86efac !important;
}

/* Detail & Analisis Produk Components (detail_produk.php) in Dark Mode */
html[data-theme="dark"] .stat-card-glass,
body.dark-theme .stat-card-glass {
  background: rgba(30, 41, 59, 0.9) !important;
  color: #f1f5f9 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .profit-highlight-box,
body.dark-theme .profit-highlight-box {
  background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 50%, #3b0764 100%) !important;
  border-color: #6b21a8 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .profit-highlight-box .card,
body.dark-theme .profit-highlight-box .card {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: #334155 !important;
}

/* Re-Stock Fund Tracker Box in Dark Mode */
html[data-theme="dark"] .restock-highlight-box,
body.dark-theme .restock-highlight-box {
  background: linear-gradient(135deg, #064e3b 0%, #0f172a 45%, #1e1b4b 100%) !important;
  border-color: #059669 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .restock-highlight-box .card,
body.dark-theme .restock-highlight-box .card {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .restock-progress-wrap,
body.dark-theme .restock-progress-wrap {
  background: #0f172a !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .split-bar-container,
body.dark-theme .split-bar-container {
  background: #0f172a !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .pagination-custom .btn-page,
body.dark-theme .pagination-custom .btn-page {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .pagination-custom .btn-page:hover:not(.disabled),
body.dark-theme .pagination-custom .btn-page:hover:not(.disabled) {
  background-color: #334155 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .pagination-custom .btn-page.active,
body.dark-theme .pagination-custom .btn-page.active {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .pagination-info,
body.dark-theme .pagination-info {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .nav-pills-custom .nav-link,
body.dark-theme .nav-pills-custom .nav-link {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .nav-pills-custom .nav-link.active,
body.dark-theme .nav-pills-custom .nav-link.active {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%) !important;
  color: #ffffff !important;
}


