/* ═══════════════════════════════════════════════════
   VAULT Theme — Light Mode + Header Pill Switcher
   ═══════════════════════════════════════════════════ */

/* ---------- LIGHT MODE VARIABLES ---------- */
:root[data-theme="light"] {
  --bg: #EAE8E1;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(0, 0, 0, 0.10);
  --text: #1a1a2e;
  --muted: #52525b;
  --icon: #374151;
  --hover: rgba(0, 0, 0, 0.05);
  --hero-from: rgba(199, 210, 254, 0.32);
  --hero-to: rgba(234, 232, 225, 0.45);
  --surface-solid: rgba(248, 247, 243, 0.97);
  --btn-solid-bg: #1a1a2e;
  --btn-solid-text: #ffffff;
  --btn-solid-border: transparent;
  --header-bg: rgba(234, 232, 225, 0.88);
  --input-bg: #f5f4f0;
  --logo-bg: #1a1a2e;
  --logo-text: #ffffff;
  --filter-active-bg: #1a1a2e;
  --filter-active-text: #ffffff;
  --scrollbar: rgba(100, 100, 120, 0.3);
}

/* ---------- LIGHT MODE SURFACE OVERRIDES ---------- */
[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
}

[data-theme="light"] header {
  background: var(--header-bg) !important;
}

[data-theme="light"] #sidebar {
  background: var(--surface-solid) !important;
}

[data-theme="light"] .filter-btn.active,
[data-theme="light"] .pagination button.active {
  background: var(--filter-active-bg);
  color: var(--filter-active-text);
  border-color: transparent;
}

[data-theme="light"] #hfilter-all.bg-white,
[data-theme="light"] #filter-all.bg-white,
[data-theme="light"] button.bg-white.text-black {
  background: var(--filter-active-bg) !important;
  color: var(--filter-active-text) !important;
}

[data-theme="light"] .sort-menu,
[data-theme="light"] .saas-toast,
[data-theme="light"] .order-detail-card,
[data-theme="light"] .saas-modal-box {
  background: var(--surface-solid) !important;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color: var(--text);
  background: var(--input-bg) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #9ca3af;
}

[data-theme="light"] .nav-link.bg-white\/5 {
  background: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .cart-box {
  background: linear-gradient(135deg, #374151 0%, #1a1a2e 100%);
  color: #fff;
}

[data-theme="light"] #loading-screen {
  background: #EAE8E1 !important;
}

[data-theme="light"] #sidebar .w-9.h-9.rounded-lg.bg-white,
[data-theme="light"] #screen-login .w-20.h-20.bg-white,
[data-theme="light"] [data-screen="admin-login"] .w-16.h-16.bg-white {
  background: var(--logo-bg) !important;
}

[data-theme="light"] #sidebar .w-9.h-9.rounded-lg.bg-white span,
[data-theme="light"] #screen-login .w-20.h-20.bg-white span {
  color: var(--logo-text) !important;
}

[data-theme="light"] [data-screen="admin-login"] .w-16.h-16.bg-white svg {
  color: var(--logo-text) !important;
}

[data-theme="light"] .hover\:text-white:hover,
[data-theme="light"] a.hover\:text-white:hover,
[data-theme="light"] button.hover\:text-white:hover {
  color: var(--text) !important;
}

[data-theme="light"] #up-eligible-toggle.bg-gray-700 {
  background: #c4c4c4 !important;
}

body,
.glass,
.glass-hero,
.btn-solid,
header,
#sidebar,
.filter-btn,
.pagination button {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

#stars,
#meteors,
#matrix-bg,
canvas {
  transition: none !important;
}

/* ═══════════════════════════════════════════════════
   MATRIX BACKGROUND — Light Mode Only
   ═══════════════════════════════════════════════════ */
#matrix-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  contain: strict;
  display: none;
  background: #EAE8E1;
}

[data-theme="light"] #matrix-bg {
  display: block;
}

[data-theme="light"] #galaxy {
  opacity: 0;
  visibility: hidden;
}

[data-theme="dark"] #galaxy,
:root:not([data-theme="light"]) #galaxy {
  opacity: 1;
  visibility: visible;
}

/* ═══════════════════════════════════════════════════
   PILL SWITCHER — header only, inline, no layout shift
   ═══════════════════════════════════════════════════ */
#theme-switcher-header {
  display: flex;
  align-items: center;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.vault-theme-pill {
  display: inline-flex;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 2px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  height: 28px;
  width: 56px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}

[data-theme="light"] .vault-theme-pill {
  background: rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.vault-theme-pill .vault-pill-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}

[data-theme="light"] .vault-theme-pill .vault-pill-slider {
  transform: translateX(28px);
  background: rgba(26, 26, 46, 0.16);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.vault-theme-pill button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.40);
  position: relative;
  z-index: 1;
  padding: 0;
  margin: 0;
  line-height: 0;
  transition: color 0.2s ease;
}

.vault-theme-pill button svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  display: block;
}

.vault-theme-pill button.active {
  color: #ffffff;
}

[data-theme="light"] .vault-theme-pill button {
  color: rgba(26, 26, 46, 0.38);
}

[data-theme="light"] .vault-theme-pill button.active {
  color: #1a1a2e;
}
