/* Infustar theme toggle — single ownership for light/dark surfaces.
   Backend token values live in assets/backend/css/admin-tokens.css;
   this file owns the toggle button + frontend dark surfaces. */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border, #EBECEE);
    background: var(--bg-card, #fff);
    color: var(--text-primary, #1E242E);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.theme-toggle:hover {
    background: var(--bg-muted, #F3F4F6);
}

.theme-toggle:active {
    transform: scale(0.96);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary, #8A2CE6);
    outline-offset: 2px;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Icon visibility is driven by the theme on <html>, so every
   toggle instance on the page stays in sync with no extra JS. */
.theme-toggle .theme-toggle-icon-moon {
    display: block;
}

.theme-toggle .theme-toggle-icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .theme-toggle-icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .theme-toggle-icon-sun {
    display: block;
}

/* ── Frontend dark surfaces (v2 Tailwind + legacy Bootstrap) ── */
html[data-theme="dark"] body {
    background: #0F1115;
    color: #D1D5DB;
}

html[data-theme="dark"] header.sticky,
html[data-theme="dark"] .influencer-header,
html[data-theme="dark"] .navbar-area {
    background: #181A20 !important;
    border-color: #24262E !important;
}

html[data-theme="dark"] .v2-nav-menu > li > a,
html[data-theme="dark"] .v2-nav-menu .sub-menu a {
    color: #D1D5DB;
}

html[data-theme="dark"] .v2-nav-menu > li.current-menu-item > a,
html[data-theme="dark"] .v2-nav-menu .sub-menu a:hover {
    color: #F3F4F6;
}

html[data-theme="dark"] #v2-primary-nav {
    background: #181A20 !important;
    border-color: #24262E !important;
}

html[data-theme="dark"] .v2-nav-menu li.menu-item-has-children > .sub-menu {
    background: #181A20 !important;
    border-color: #24262E !important;
}

html[data-theme="dark"] #v2-search-panel,
html[data-theme="dark"] #v2-user-menu-panel,
html[data-theme="dark"] .v2-modal-panel {
    background: #181A20 !important;
    border-color: #24262E !important;
    color: #D1D5DB;
}

html[data-theme="dark"] #v2-search-input,
html[data-theme="dark"] #v2-search-type,
html[data-theme="dark"] .custom-form-builder-form .form-control {
    background: #1E2028 !important;
    border-color: #24262E !important;
    color: #F3F4F6 !important;
}

/* Legacy Bootstrap navbar */
html[data-theme="dark"] .bg_white {
    background: #181A20 !important;
}

html[data-theme="dark"] .navbar-area .nav-container .navbar-collapse .navbar-nav li a {
    color: #D1D5DB !important;
}

html[data-theme="dark"] .navbar-area .nav-container .navbar-collapse .navbar-nav li a:hover {
    color: #fff !important;
}

html[data-theme="dark"] .banner-inner-area.bg_gray {
    background: #181A20 !important;
}

/* ── Backend extra polish (tokens carry the bulk) ── */
html[data-theme="dark"] .dashboard-area.section-bg-2 {
    background: #0F1115 !important;
}
