/*
 * Premium Dark Theme Overlay
 * Loaded AFTER dark-theme.css to apply premium refinements in dark mode.
 */

html.dark-theme {
  --premium-bg: #0f0f0f;
  --premium-surface: #1a1a1a;
  --premium-border: rgba(255, 255, 255, 0.08);
  --premium-border-subtle: rgba(255, 255, 255, 0.06);
  --premium-text-primary: #f5f5f7;
  --premium-text-secondary: #a1a1a6;
  --premium-text-tertiary: #6e6e73;
  --premium-accent: #818cf8;
  --premium-accent-hover: #a5b4fc;
  --premium-accent-light: rgba(129, 140, 248, 0.1);
  --premium-accent-focus: rgba(129, 140, 248, 0.24);
  --premium-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --premium-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --premium-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --premium-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}


/* Dark body */
html.dark-theme body {
  background-color: var(--premium-bg) !important;
  color: var(--premium-text-primary);
}


/* Dark sidebar */
html.dark-theme .sidebar-wrapper,
html.dark-theme .sidebar-wrapper .sidebar-header {
  background-color: var(--premium-surface) !important;
  border-right-color: var(--premium-border) !important;
}

html.dark-theme .sidebar-wrapper .sidebar-header .logo-text {
  color: var(--premium-text-primary) !important;
}

html.dark-theme .sidebar-wrapper .metismenu a {
  color: var(--premium-text-secondary) !important;
}

html.dark-theme .sidebar-wrapper .metismenu a:hover {
  color: var(--premium-text-primary) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .sidebar-wrapper .metismenu .mm-active > a {
  color: var(--premium-accent) !important;
  background-color: var(--premium-accent-light) !important;
}

html.dark-theme .sidebar-wrapper .metismenu ul {
  background: transparent !important;
  border-color: transparent !important;
}


/* Dark header */
html.dark-theme .top-header {
  background-color: var(--premium-surface) !important;
  border-bottom-color: var(--premium-border) !important;
}

html.dark-theme .top-header .navbar .top-navbar-right .nav-item {
  background-color: transparent !important;
}

html.dark-theme .top-header .navbar .top-navbar-right .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .top-header .navbar .top-navbar-right .nav-link {
  color: var(--premium-text-secondary) !important;
}

html.dark-theme .toggle-icon {
  color: var(--premium-text-secondary) !important;
}

html.dark-theme .toggle-icon:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--premium-text-primary) !important;
}


/* Dark cards */
html.dark-theme .card {
  background-color: var(--premium-surface) !important;
  border-color: var(--premium-border) !important;
}

html.dark-theme .card-header {
  background-color: var(--premium-surface) !important;
  border-bottom-color: var(--premium-border) !important;
}


/* Dark forms */
html.dark-theme .form-control,
html.dark-theme .form-select {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--premium-border) !important;
  color: var(--premium-text-primary) !important;
}

html.dark-theme .form-control:focus,
html.dark-theme .form-select:focus {
  border-color: var(--premium-accent) !important;
  box-shadow: 0 0 0 3px var(--premium-accent-focus) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .form-control:disabled,
html.dark-theme .form-control[readonly] {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

html.dark-theme .input-group-text {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--premium-border) !important;
  color: var(--premium-text-secondary) !important;
}

html.dark-theme .form-label,
html.dark-theme .col-form-label {
  color: var(--premium-text-secondary) !important;
}


/* Dark tables */
html.dark-theme .table {
  color: var(--premium-text-primary) !important;
  border-color: var(--premium-border) !important;
}

html.dark-theme .table th {
  color: var(--premium-text-secondary) !important;
}

html.dark-theme .table td {
  border-color: var(--premium-border) !important;
  color: var(--premium-text-primary) !important;
}

html.dark-theme .table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.04) !important;
  --bs-table-color: var(--premium-text-secondary) !important;
  border-color: var(--premium-border) !important;
}

html.dark-theme .table-hover tbody tr:hover {
  --bs-table-hover-bg: rgba(129, 140, 248, 0.04);
}


/* Dark dropdowns */
html.dark-theme .dropdown-menu {
  background-color: #242424 !important;
  border-color: var(--premium-border) !important;
}

html.dark-theme .dropdown-item {
  color: var(--premium-text-primary) !important;
}

html.dark-theme .dropdown-item:hover,
html.dark-theme .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .dropdown-divider {
  border-color: var(--premium-border) !important;
}

/* Hide triangle carets in dark mode too */
html.dark-theme .top-header .navbar .dropdown-menu::after,
html.dark-theme .top-header .navbar .dropdown-user-setting .dropdown-menu::after,
html.dark-theme .top-header .navbar .dropdown-large .dropdown-menu::after {
  display: none !important;
}


/* Dark footer */
html.dark-theme .footer {
  background-color: var(--premium-surface) !important;
  border-top-color: var(--premium-border) !important;
  color: var(--premium-text-tertiary) !important;
}


/* Dark progress */
html.dark-theme .progress {
  background-color: rgba(255, 255, 255, 0.08) !important;
}


/* Dark alerts */
html.dark-theme .alert-danger {
  background-color: rgba(255, 59, 48, 0.12) !important;
  color: #ff6961 !important;
}


/* Dark buttons */
html.dark-theme .btn-primary {
  background-color: var(--premium-accent) !important;
  border-color: var(--premium-accent) !important;
}

html.dark-theme .btn-primary:hover {
  background-color: var(--premium-accent-hover) !important;
  border-color: var(--premium-accent-hover) !important;
}

html.dark-theme .btn-light {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--premium-border) !important;
  color: var(--premium-text-primary) !important;
}

html.dark-theme .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
}


/* Dark offcanvas */
html.dark-theme .offcanvas {
  background-color: var(--premium-surface) !important;
  border-color: var(--premium-border) !important;
}

html.dark-theme .offcanvas-header {
  border-bottom-color: var(--premium-border) !important;
}


/* Dark breadcrumbs */
html.dark-theme .breadcrumb-title {
  border-right-color: var(--premium-border) !important;
  color: var(--premium-text-primary) !important;
}


/* Dark login */
html.dark-theme .bg-theme.bg-theme2 {
  background: linear-gradient(145deg, #0f0f0f 0%, #1a1a1a 100%) !important;
}


/* Dark modal */
html.dark-theme .modal-content {
  background-color: var(--premium-surface) !important;
  border-color: var(--premium-border) !important;
}

html.dark-theme .modal-header {
  border-bottom-color: var(--premium-border) !important;
}

html.dark-theme .modal-footer {
  border-top-color: var(--premium-border) !important;
}


/* Dark selection */
html.dark-theme ::selection {
  background-color: var(--premium-accent-light);
  color: var(--premium-text-primary);
}
