/*
 * Airwave shared Light/Dark appearance layer - Web v1.0.3
 * Presentation only. No licensing/payment/admin action logic lives here.
 */

:root {
    --aw-theme-toggle-bg: #1e3a5f;
    --aw-theme-toggle-fg: #ffffff;
    --aw-theme-toggle-border: #1e3a5f;
    --aw-theme-toggle-shadow: rgba(30,64,100,.24);
}
html[data-theme="dark"] {
    --aw-theme-toggle-bg: #182338;
    --aw-theme-toggle-fg: #f8fafc;
    --aw-theme-toggle-border: #475569;
    --aw-theme-toggle-shadow: rgba(0,0,0,.35);
}

#airwaveUniversalThemeToggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2147483000;
    appearance: none;
    border: 1px solid var(--aw-theme-toggle-border);
    border-radius: 999px;
    background: var(--aw-theme-toggle-bg);
    color: var(--aw-theme-toggle-fg);
    padding: 9px 13px;
    font: 700 13px/1.2 Arial, Helvetica, sans-serif;
    box-shadow: 0 6px 22px var(--aw-theme-toggle-shadow);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
#airwaveUniversalThemeToggle:hover { transform: translateY(-1px); }
#airwaveUniversalThemeToggle:focus-visible {
    outline: 3px solid rgba(37,99,235,.35);
    outline-offset: 2px;
}

/* Light mode overrides legacy hard-coded dark SSRN/admin pages. */
html[data-theme="light"] body {
    background: #f4f7fb !important;
    color: #14213d !important;
}
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .box,
html[data-theme="light"] .stat,
html[data-theme="light"] .watchbox,
html[data-theme="light"] .section,
html[data-theme="light"] .container,
html[data-theme="light"] .login-card {
    background: #ffffff !important;
    color: #14213d !important;
    border-color: #cbd8e6 !important;
    box-shadow: 0 8px 24px rgba(30,64,100,.10);
}
html[data-theme="light"] .stat {
    background: #eef4fb !important;
}
html[data-theme="light"] a {
    color: #1d4ed8 !important;
}
html[data-theme="light"] .muted,
html[data-theme="light"] .small,
html[data-theme="light"] .subtle {
    color: #52647a !important;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #b8c7d8 !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #718096 !important;
}
html[data-theme="light"] pre,
html[data-theme="light"] code,
html[data-theme="light"] .codes,
html[data-theme="light"] .keybox,
html[data-theme="light"] .progress {
    background: #edf3fa !important;
    color: #1e3a5f !important;
    border-color: #cbd8e6 !important;
}
html[data-theme="light"] table {
    color: #14213d !important;
}
html[data-theme="light"] th,
html[data-theme="light"] td {
    border-color: #d8e2ec !important;
}
html[data-theme="light"] hr {
    border-color: #d8e2ec !important;
}
html[data-theme="light"] .nav a {
    color: #1d4ed8 !important;
}

/* Keep semantic alert/button colors readable instead of washing them out. */
html[data-theme="light"] .msg,
html[data-theme="light"] .ok {
    color: #ecfdf5 !important;
}
html[data-theme="light"] .err,
html[data-theme="light"] .bad,
html[data-theme="light"] .danger {
    color: #fff !important;
}
html[data-theme="light"] .warn,
html[data-theme="light"] .warning {
    color: inherit;
}


/*
 * Web v1.0.3 button contrast repair.
 * On the Light theme, every actionable button/link-button keeps white text.
 * Backgrounds are intentionally saturated/dark enough for readable contrast.
 */
html[data-theme="light"] button,
html[data-theme="light"] input[type="button"],
html[data-theme="light"] input[type="submit"],
html[data-theme="light"] input[type="reset"],
html[data-theme="light"] a.btn,
html[data-theme="light"] .btn,
html[data-theme="light"] a.button,
html[data-theme="light"] .button {
    color: #ffffff !important;
}

html[data-theme="light"] button:not(.danger):not(.red):not(.warn):not(.warning):not(.warnbtn):not(.orange):not(.green):not(.good):not(.success):not(.gray):not(.gold),
html[data-theme="light"] input[type="button"],
html[data-theme="light"] input[type="submit"],
html[data-theme="light"] input[type="reset"],
html[data-theme="light"] a.btn:not(.danger):not(.red):not(.warn):not(.warning):not(.warnbtn):not(.orange):not(.green):not(.good):not(.success):not(.gray):not(.gold),
html[data-theme="light"] .btn:not(.danger):not(.red):not(.warn):not(.warning):not(.warnbtn):not(.orange):not(.green):not(.good):not(.success):not(.gray):not(.gold) {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

html[data-theme="light"] .secondary,
html[data-theme="light"] button.secondary,
html[data-theme="light"] a.secondary,
html[data-theme="light"] .gray,
html[data-theme="light"] button.gray,
html[data-theme="light"] a.gray {
    background: #475569 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .green,
html[data-theme="light"] .good,
html[data-theme="light"] .success,
html[data-theme="light"] button.green,
html[data-theme="light"] button.good,
html[data-theme="light"] button.success,
html[data-theme="light"] a.green,
html[data-theme="light"] a.good,
html[data-theme="light"] a.success {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .orange,
html[data-theme="light"] .warn,
html[data-theme="light"] .warning,
html[data-theme="light"] .warnbtn,
html[data-theme="light"] button.orange,
html[data-theme="light"] button.warn,
html[data-theme="light"] button.warning,
html[data-theme="light"] button.warnbtn,
html[data-theme="light"] a.orange,
html[data-theme="light"] a.warn,
html[data-theme="light"] a.warning,
html[data-theme="light"] a.warnbtn {
    background: #a24b00 !important;
    border-color: #a24b00 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .red,
html[data-theme="light"] .danger,
html[data-theme="light"] .bad,
html[data-theme="light"] button.red,
html[data-theme="light"] button.danger,
html[data-theme="light"] a.red,
html[data-theme="light"] a.danger {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

html[data-theme="light"] .gold,
html[data-theme="light"] button.gold,
html[data-theme="light"] a.gold,
html[data-theme="light"] .btn.gold {
    background: #8a5200 !important;
    border-color: #8a5200 !important;
    color: #ffffff !important;
}

/* The integrated public theme switch must follow the same white-text rule. */
html[data-theme="light"] .theme-toggle {
    background: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: #ffffff !important;
}
html[data-theme="light"] .theme-toggle:hover {
    background: #16304f !important;
}

/* Disabled controls remain visibly disabled while preserving readable text. */
html[data-theme="light"] button:disabled,
html[data-theme="light"] input[type="button"]:disabled,
html[data-theme="light"] input[type="submit"]:disabled,
html[data-theme="light"] .btn.disabled {
    background: #64748b !important;
    border-color: #64748b !important;
    color: #ffffff !important;
    opacity: .72;
}

body {
    transition: background-color .15s ease, color .15s ease;
}

@media (max-width: 700px) {
    #airwaveUniversalThemeToggle {
        top: 8px;
        right: 8px;
        padding: 8px 11px;
    }
}

/* Web v1.0.4 administrator status badge colors. */
.pill.status-active,
html[data-theme="light"] .pill.status-active,
html[data-theme="dark"] .pill.status-active {
    background: #047857 !important;
    border: 1px solid #10b981 !important;
    color: #ffffff !important;
}

.pill.status-inactive,
html[data-theme="light"] .pill.status-inactive,
html[data-theme="dark"] .pill.status-inactive {
    background: #b91c1c !important;
    border: 1px solid #ef4444 !important;
    color: #ffffff !important;
}

