/* ============================================================================
   Q-Service theme toggle (Day / Night mode switch)
   Always-loaded (light + dark aware). The heavy dark-mode overrides live in
   qs-theme-dark.css; this file only styles the toggle control itself and the
   sun/moon icon swap, so it must NOT be scoped entirely under [data-theme].
   ============================================================================ */

.qs-theme-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.qs-theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.qs-theme-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

/* Light mode shows the moon (click -> go dark). Dark mode shows the sun (click -> go light). */
.qs-theme-icon--sun { display: none; }
html[data-theme="dark"] .qs-theme-icon--moon { display: none; }
html[data-theme="dark"] .qs-theme-icon--sun { display: inline-flex; }

/* Navbar variant (OLD dark-blue navbar only — do NOT extend to `.tb`, the GPG
   redesign's topbar: this rule's white-tinted translucent pill background was
   designed to read against a dark background and would be nearly invisible
   (white-on-white) on `.tb`'s light surface. The redesign's topbar buttons
   instead get their pill styling from the plain `.tb-btn` class added
   alongside `.qs-theme-toggle` in _LayoutNavbar.cshtml — no rule needed here
   for that case. */
.navbar .qs-theme-toggle {
    color: var(--qs-nav-fg);
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0 var(--qs-space-2);               /* keep it from sticking to the bell / language selector */
    border-radius: 10px;
    background: rgba(var(--qs-white-rgb), 0.12);
    border: 1px solid rgba(var(--qs-white-rgb), 0.28);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
/* breathing room between the navbar action items so the icons don't cram together */
.navbar .notification-bell-wrapper { margin: 0 var(--qs-space-1); }
.navbar-nav.align-items-center > .nav-item { display: flex; align-items: center; }
.navbar .qs-theme-toggle:hover {
    color: var(--qs-nav-fg);
    background: rgba(var(--qs-white-rgb), 0.22);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--qs-shadow-rgb), 0.25);
}
.navbar .qs-theme-toggle .qs-theme-icon svg { width: 18px; height: 18px; }
/* the sun (dark-mode) reads best with a warm tint; the moon stays crisp white.
   `.tb` included too (GPG redesign topbar) — this is color-only, no background
   conflict with `.tb-btn`, so it's safe to apply in both contexts. */
html[data-theme="dark"] .navbar .qs-theme-toggle .qs-theme-icon--sun,
html[data-theme="dark"] .tb .qs-theme-toggle .qs-theme-icon--sun { color: var(--qs-warning-solid); }

/* Floating variant (account / login pages that have no navbar) */
.qs-theme-toggle--floating {
    position: fixed;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 1050;
    width: var(--qs-tap-min);
    height: var(--qs-tap-min);
    border-radius: var(--qs-radius-circle);
    background: var(--qs-surface);
    color: var(--qs-text);
    border: 1px solid rgba(var(--qs-shadow-rgb), 0.1);
    box-shadow: 0 4px 14px rgba(var(--qs-shadow-rgb), 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.qs-theme-toggle--floating:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 6px 18px rgba(var(--qs-shadow-rgb), 0.18);
}
html[data-theme="dark"] .qs-theme-toggle--floating {
    background: var(--qs-surface-2);
    color: var(--qs-text);
    border-color: var(--qs-border);
    box-shadow: 0 4px 14px rgba(var(--qs-shadow-rgb), 0.5);
}
