/*
 * Shared dark theme for the whole storefront/admin site.
 * Keep global surfaces and navigation here so visual changes only need one edit.
 */
:root {
    color-scheme: dark;
    --site-bg: #000000;
    --site-surface: #0b0c0f;
    --site-surface-2: #101216;
    --site-surface-3: #151820;
    --site-border: rgba(255, 255, 255, 0.10);
    --site-border-strong: rgba(255, 255, 255, 0.16);
    --site-text: #f5f7fa;
    --site-muted: #9ca3af;
}

html,
body {
    min-height: 100%;
    background: var(--site-bg) !important;
    background-color: var(--site-bg) !important;
    color: var(--site-text);
}

body {
    min-height: 100vh;
}

/* Shared translucent surfaces */
.glass,
.payment-panel,
.panel-modern,
.stat-card-modern,
.glass-card,
.glass-card-dark {
    background: rgba(11, 12, 15, 0.88) !important;
    border-color: var(--site-border) !important;
    color: var(--site-text);
}

/* Bootstrap / legacy pages */
.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.offcanvas,
.accordion-item {
    background-color: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer,
.accordion-button,
.table thead,
.table-light,
.table > :not(caption) > * > * {
    background-color: var(--site-surface-2) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

.table,
.table-modern {
    --bs-table-bg: transparent;
    --bs-table-color: var(--site-text);
    --bs-table-border-color: var(--site-border);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.055);
    background: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

.table-modern tbody td {
    border-color: var(--site-border) !important;
}

.table-modern tbody tr:hover {
    background: rgba(255, 255, 255, 0.045) !important;
}

/* Old utility classes that otherwise bring back white panels */
.bg-white,
.bg-light,
.card .bg-white,
.card-header.bg-white,
.panel-modern,
.stat-modern {
    background-color: var(--site-surface-2) !important;
    color: var(--site-text) !important;
}


.text-dark,
.text-body,
.text-black {
    color: var(--site-text) !important;
}

.text-muted,
.text-secondary {
    color: var(--site-muted) !important;
}

/* Forms */
.form-control,
.form-select,
.input-modern,
input:not([type]),
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="file"],
select,
textarea {
    background: #090a0d !important;
    color: #f8fafc !important;
    border-color: var(--site-border) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #6b7280 !important;
    opacity: 1;
}

.form-control:focus,
.form-select:focus,
.input-modern:focus,
input:not([type]):focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    background: #0c0e12 !important;
    color: #ffffff !important;
    border-color: rgba(59, 130, 246, 0.72) !important;
}

select option {
    background: #0a0b0e;
    color: #f8fafc;
}

/* Keep browser autofill from flashing a white field */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #f8fafc !important;
    -webkit-box-shadow: 0 0 0 1000px #090a0d inset !important;
    box-shadow: 0 0 0 1000px #090a0d inset !important;
    caret-color: #f8fafc;
}

/* Shared navigation / drawer. Used by admin, reseller and user nav files. */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 60;
    display: none;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 18rem;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 61;
    background: rgba(7, 8, 10, 0.98) !important;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-overlay.open {
    display: block;
}

#site-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity .35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

.loader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 3px solid rgba(59, 130, 246, 0.14);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: site-premium-spin .8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.35));
}

.loader-text {
    margin-top: 1.5rem;
    color: #60a5fa;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    animation: site-premium-pulse 1.5s ease-in-out infinite;
}

@keyframes site-premium-spin {
    to { transform: rotate(360deg); }
}

@keyframes site-premium-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.95); }
}

/* SweetAlert is used across many pages. Keep it aligned with the site theme. */
.swal2-popup {
    background: #0b0c0f !important;
    color: #f8fafc !important;
    border: 1px solid var(--site-border) !important;
}

.swal2-title,
.swal2-html-container {
    color: #f8fafc !important;
}

/* Scrollbars */
* {
    scrollbar-color: #343945 #08090b;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #08090b;
}

::-webkit-scrollbar-thumb {
    background: #343945;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f5e;
}
