/* MySSL.info Custom Styles */

/* ===== Theme System ===== */

:root {
    --page-bg: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-hover: rgba(255, 255, 255, 1);
    --surface-border: rgba(148, 163, 184, 0.28);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --nav-bg: rgba(255, 255, 255, 0.75);
    --nav-border: rgba(148, 163, 184, 0.25);
    --nav-text: #334155;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(148, 163, 184, 0.3);
    --input-bg: #ffffff;
    --input-border: rgba(148, 163, 184, 0.3);
    --input-text: #0f172a;
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --footer-heading: #e2e8f0;
    --btn-primary-bg: #0f172a;
    --btn-primary-text: #ffffff;
    --scanner-bg: #0B1220;
    --backdrop-blur: blur(16px);
    --heading-color: #0f172a;
    --font-heading: 'DM Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

/* ===== Canvas for Three.js ===== */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: none;
}

/* ===== Navbar ===== */
#main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    transition: background 0.3s, border-color 0.3s;
}
.nav-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}
.nav-logo-icon {
    width: 30px;
    height: 30px;
    color: var(--accent);
    transition: color 0.2s;
}
.nav-brand:hover .nav-logo-icon { color: var(--accent-hover); }
.nav-wordmark {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.nav-wordmark-dot {
    color: var(--text-muted);
    font-weight: 500;
}
.nav-links {
    display: none;
    align-items: center;
    gap: 0.25rem;
}
@media (min-width: 768px) {
    .nav-links { display: flex; }
}
.nav-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.15);
}
.nav-cta {
    margin-left: 0.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--btn-primary-text);
    background: var(--btn-primary-bg);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: opacity 0.15s, transform 0.15s;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }
.nav-mobile-btn {
    display: block;
    padding: 0.5rem;
    color: var(--nav-text);
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}
@media (min-width: 768px) { .nav-mobile-btn { display: none; } }
.nav-mobile-menu {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.nav-mobile-menu.hidden { display: none; }
.nav-mobile-link {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.15s;
}
.nav-mobile-link:hover { background: var(--surface-border); }
.nav-mobile-cta {
    margin-top: 0.5rem;
    padding: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--btn-primary-text);
    background: var(--btn-primary-bg);
    text-decoration: none;
    border-radius: 0.5rem;
    text-align: center;
}

/* ===== Footer ===== */
#main-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--surface-border);
    margin-top: auto;
    padding: 3rem 0;
    color: var(--footer-text);
}
.footer-brand-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--footer-heading);
}
.footer-brand-dot { color: var(--footer-text); font-weight: 500; }
.footer-desc { margin-top: 0.5rem; font-size: 0.875rem; color: var(--footer-text); }
.footer-heading {
    font-weight: 600;
    color: var(--footer-heading);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
.footer-link {
    font-size: 0.875rem;
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-link:hover { color: var(--accent); }
.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
@media (min-width: 768px) {
    .footer-bottom { flex-direction: row; justify-content: space-between; }
}
.footer-copyright { font-size: 0.875rem; color: var(--footer-text); }
.footer-tagline { font-size: 0.875rem; color: var(--text-muted); }

/* ===== Global Font Variables ===== */
body.themed {
    background-color: var(--page-bg) !important;
    color: var(--text-primary);
    font-family: var(--font-heading), sans-serif;
    transition: background-color 0.4s ease, color 0.3s ease;
}
body.themed > *:not(#bg-canvas):not(#theme-toggle-btn):not(#theme-picker-panel) {
    position: relative;
    z-index: 1;
}
body.themed h1, body.themed h2, body.themed h3, body.themed h4, body.themed h5, body.themed h6 {
    font-family: var(--font-heading) !important;
    color: var(--heading-color, var(--text-primary)) !important;
}
body.themed code, body.themed pre, body.themed .font-mono, body.themed .font-mono-data {
    font-family: var(--font-mono) !important;
}

/* ===== Dark Theme Overrides ===== */

/* Backgrounds */
body.theme-dark .bg-gray-50,
body.theme-dark .bg-slate-50 { background-color: var(--page-bg) !important; }
body.theme-dark .bg-white { background-color: var(--surface) !important; }
body.theme-dark .bg-gray-100,
body.theme-dark .bg-slate-100,
body.theme-dark .bg-gray-50\/50 { background-color: var(--surface) !important; }

/* Text colors */
body.theme-dark .text-gray-900, body.theme-dark .text-slate-900 { color: var(--text-primary) !important; }
body.theme-dark .text-gray-800, body.theme-dark .text-slate-800 { color: var(--text-primary) !important; }
body.theme-dark .text-gray-700, body.theme-dark .text-slate-700 { color: var(--text-secondary) !important; }
body.theme-dark .text-gray-600, body.theme-dark .text-slate-600 { color: var(--text-secondary) !important; }
body.theme-dark .text-gray-500, body.theme-dark .text-slate-500 { color: var(--text-muted) !important; }
body.theme-dark .text-gray-400, body.theme-dark .text-slate-400 { color: var(--text-muted) !important; }
body.theme-dark .text-gray-300 { color: var(--text-muted) !important; }
body.theme-dark .text-white { color: #ffffff !important; }

/* Heading overrides — force high contrast on dark */
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3 {
    color: var(--heading-color, var(--text-primary)) !important;
}
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6 {
    color: var(--text-primary) !important;
}
body.theme-dark .font-bold, body.theme-dark .font-semibold {
    color: inherit;
}

/* Borders */
body.theme-dark .border-gray-200, body.theme-dark .border-gray-100,
body.theme-dark .border-slate-200, body.theme-dark .border-slate-100,
body.theme-dark .border-gray-300, body.theme-dark .divide-gray-200 > * {
    border-color: var(--surface-border) !important;
}

/* Cards — soft gradient borders, no harsh lines */
body.theme-dark .info-card,
body.theme-dark .group.bg-white,
body.theme-dark [class*="rounded-2xl"].bg-white,
body.theme-dark [class*="rounded-xl"].bg-white,
body.theme-dark .bg-white.rounded-xl,
body.theme-dark .bg-white.rounded-lg,
body.theme-dark article.bg-white {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    backdrop-filter: var(--backdrop-blur);
    box-shadow:
        0 0 0 1px var(--card-border),
        0 4px 24px -4px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.03) !important;
}
body.theme-dark .info-card-header {
    background: var(--surface) !important;
    border-color: transparent !important;
    border-bottom: 1px solid var(--surface-border) !important;
}
body.theme-dark .group.bg-white:hover {
    background: var(--surface-hover) !important;
    box-shadow:
        0 0 0 1px var(--accent),
        0 8px 32px -4px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
}

/* Inputs & forms */
body.theme-dark input:not([type="checkbox"]):not([type="radio"]):not(.scanner-console-input),
body.theme-dark select,
body.theme-dark textarea {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--input-text) !important;
}
body.theme-dark label { color: var(--text-secondary) !important; }
body.theme-dark input::placeholder, body.theme-dark textarea::placeholder { color: var(--text-muted) !important; }

/* Indigo/purple gradient sections → tinted dark (handled by specific rules below) */
/* ===== Semantic Tinted Backgrounds — preserve color identity on dark ===== */

/* Red/danger tints — visible red glow */
body.theme-dark .bg-red-50,
body.theme-dark .bg-red-100 { background-color: rgba(239, 68, 68, 0.12) !important; }

/* Green/success tints — visible green glow */
body.theme-dark .bg-green-50,
body.theme-dark .bg-green-100,
body.theme-dark .bg-emerald-50,
body.theme-dark .bg-emerald-100 { background-color: rgba(34, 197, 94, 0.12) !important; }

/* Blue/info tints */
body.theme-dark .bg-blue-50,
body.theme-dark .bg-blue-100,
body.theme-dark .bg-cyan-50,
body.theme-dark .bg-cyan-100 { background-color: rgba(56, 189, 248, 0.12) !important; }

/* Indigo/purple/violet tints */
body.theme-dark .bg-indigo-50,
body.theme-dark .bg-indigo-100,
body.theme-dark .bg-purple-50,
body.theme-dark .bg-purple-100,
body.theme-dark .bg-violet-50,
body.theme-dark .bg-violet-100 { background-color: rgba(129, 140, 248, 0.14) !important; }

/* Warning tints */
body.theme-dark .bg-yellow-50,
body.theme-dark .bg-yellow-100,
body.theme-dark .bg-orange-50,
body.theme-dark .bg-orange-100 { background-color: rgba(245, 158, 11, 0.14) !important; }

/* ===== Semantic Tinted Borders — matching color identity ===== */
body.theme-dark .border-red-100,
body.theme-dark .border-red-200 { border-color: rgba(248, 113, 113, 0.35) !important; }

body.theme-dark .border-green-100,
body.theme-dark .border-green-200,
body.theme-dark .border-emerald-100 { border-color: rgba(74, 222, 128, 0.35) !important; }

body.theme-dark .border-blue-100,
body.theme-dark .border-blue-200,
body.theme-dark .border-cyan-100 { border-color: rgba(125, 211, 252, 0.35) !important; }

body.theme-dark .border-indigo-100,
body.theme-dark .border-indigo-200,
body.theme-dark .border-purple-100,
body.theme-dark .border-purple-200,
body.theme-dark .border-violet-100 { border-color: rgba(167, 139, 250, 0.35) !important; }

body.theme-dark .border-yellow-100,
body.theme-dark .border-orange-100 { border-color: rgba(251, 191, 36, 0.35) !important; }

/* ===== Dark-on-dark text fix: flip dark semantic colors to light versions ===== */

/* Red text — was dark maroon, now light rose/coral */
body.theme-dark .text-red-900,
body.theme-dark .text-red-800 { color: #fecaca !important; }
body.theme-dark .text-red-700,
body.theme-dark .text-red-600 { color: #fca5a5 !important; }
body.theme-dark .text-red-500 { color: #f87171 !important; }

/* Green text — was dark forest, now light mint */
body.theme-dark .text-green-900,
body.theme-dark .text-green-800,
body.theme-dark .text-emerald-900,
body.theme-dark .text-emerald-800 { color: #bbf7d0 !important; }
body.theme-dark .text-green-700,
body.theme-dark .text-green-600,
body.theme-dark .text-green-500,
body.theme-dark .text-emerald-700,
body.theme-dark .text-emerald-600 { color: #86efac !important; }

/* Blue text — was dark navy, now light sky */
body.theme-dark .text-blue-900,
body.theme-dark .text-blue-800,
body.theme-dark .text-blue-700 { color: #bfdbfe !important; }
body.theme-dark .text-blue-500 { color: #60a5fa !important; }

/* Indigo/Purple/Violet text — already handled for 600-800, add 700-900 */
body.theme-dark .text-indigo-900,
body.theme-dark .text-purple-900,
body.theme-dark .text-violet-800,
body.theme-dark .text-violet-700 { color: #c4b5fd !important; }

/* Yellow/Amber text */
body.theme-dark .text-yellow-800,
body.theme-dark .text-yellow-900,
body.theme-dark .text-amber-800,
body.theme-dark .text-amber-900 { color: #fde68a !important; }
body.theme-dark .text-yellow-700,
body.theme-dark .text-amber-700 { color: #fcd34d !important; }

/* Orange text */
body.theme-dark .text-orange-800,
body.theme-dark .text-orange-900 { color: #fed7aa !important; }

/* Indigo text → accent */
body.theme-dark .text-indigo-600, body.theme-dark .text-indigo-700,
body.theme-dark .text-indigo-800 { color: var(--accent) !important; }
body.theme-dark .text-purple-600, body.theme-dark .text-purple-700,
body.theme-dark .text-purple-800 { color: var(--accent) !important; }

/* Buttons — indigo/purple buttons → theme primary */
body.theme-dark .bg-indigo-600, body.theme-dark .bg-indigo-700 {
    background-color: var(--btn-primary-bg) !important;
}
body.theme-dark .hover\:bg-indigo-700:hover {
    opacity: 0.9 !important;
}

/* ===== Badge/pill chips on dark — readable with tinted glass look ===== */
body.theme-dark .inline-block.rounded-full.bg-indigo-100,
body.theme-dark .inline-flex.rounded-full.bg-indigo-100,
body.theme-dark span.rounded-full.bg-indigo-100 {
    background-color: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
}
body.theme-dark .inline-block.rounded-full.bg-purple-100,
body.theme-dark .inline-flex.rounded-full.bg-purple-100,
body.theme-dark span.rounded-full.bg-purple-100 {
    background-color: rgba(167, 139, 250, 0.15) !important;
    border: 1px solid rgba(167, 139, 250, 0.3) !important;
}
body.theme-dark span.rounded-full .text-indigo-700,
body.theme-dark .rounded-full.text-indigo-700 { color: #bae6fd !important; }
body.theme-dark span.rounded-full .text-purple-700,
body.theme-dark .rounded-full.text-purple-700 { color: #ddd6fe !important; }

/* ===== Scan result badges on dark — adapt hardcoded colors ===== */
body.theme-dark .badge-good { background-color: rgba(34, 197, 94, 0.15) !important; color: #86efac !important; }
body.theme-dark .badge-warn { background-color: rgba(245, 158, 11, 0.15) !important; color: #fcd34d !important; }
body.theme-dark .badge-bad { background-color: rgba(239, 68, 68, 0.15) !important; color: #fca5a5 !important; }
body.theme-dark .badge-neutral { background-color: rgba(148, 163, 184, 0.12) !important; color: var(--text-muted) !important; }
body.theme-dark .card-status-pass { background-color: rgba(34, 197, 94, 0.15) !important; color: #86efac !important; }
body.theme-dark .card-status-warn,
body.theme-dark .card-status-pill-warn { background-color: rgba(245, 158, 11, 0.15) !important; color: #fcd34d !important; }
body.theme-dark .card-status-fail { background-color: rgba(239, 68, 68, 0.15) !important; color: #fca5a5 !important; }

/* ===== Feature cards — "Learn more" colored links on dark ===== */
body.theme-dark .group .text-indigo-600,
body.theme-dark .group .text-green-600,
body.theme-dark .group .text-purple-600,
body.theme-dark .group .text-blue-600,
body.theme-dark .group .text-pink-600 { color: var(--accent) !important; }
body.theme-dark .group:hover .group-hover\:text-indigo-700,
body.theme-dark .group:hover .group-hover\:text-green-700,
body.theme-dark .group:hover .group-hover\:text-purple-700 { color: var(--accent-hover) !important; }

/* Feature card hover borders on dark */
body.theme-dark .group.hover\:border-indigo-200:hover,
body.theme-dark .group.hover\:border-green-200:hover,
body.theme-dark .group.hover\:border-purple-200:hover,
body.theme-dark .group.hover\:border-blue-200:hover,
body.theme-dark .group.hover\:border-pink-200:hover,
body.theme-dark .group.hover\:border-yellow-200:hover {
    border-color: rgba(56, 189, 248, 0.4) !important;
}

/* ===== Integrations gradient section — tinted dark instead of flat ===== */
body.theme-dark .bg-gradient-to-r.from-indigo-600 {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(109, 40, 217, 0.2), rgba(15, 23, 42, 0.95)) !important;
    border: 1px solid rgba(129, 140, 248, 0.25) !important;
}
body.theme-dark .text-indigo-200 { color: #c7d2fe !important; }

/* Integration icon cards — more visible on dark gradient */
body.theme-dark .bg-white\/10 {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}
body.theme-dark .hover\:bg-white\/20:hover {
    background-color: rgba(255, 255, 255, 0.16) !important;
}

/* Tables */
body.theme-dark table, body.theme-dark thead, body.theme-dark tbody {
    border-color: var(--surface-border) !important;
}
body.theme-dark thead.bg-gray-50, body.theme-dark thead .bg-gray-50 {
    background-color: var(--surface) !important;
}
body.theme-dark tbody .bg-white, body.theme-dark td {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
}
body.theme-dark th {
    color: var(--text-muted) !important;
}

/* Learn page sidebar */
body.theme-dark .learn-sidebar {
    background: var(--card-bg) !important;
    box-shadow: none !important;
}

/* Learn page callouts */
body.theme-dark .callout-info { background-color: rgba(59, 130, 246, 0.1) !important; border-left-color: var(--accent) !important; }
body.theme-dark .callout-warning { background-color: rgba(245, 158, 11, 0.1) !important; }
body.theme-dark .callout-success { background-color: rgba(16, 185, 129, 0.1) !important; }
body.theme-dark .callout-danger { background-color: rgba(239, 68, 68, 0.1) !important; }
body.theme-dark .callout { color: var(--text-secondary) !important; }
body.theme-dark .callout strong { color: var(--text-primary) !important; }

/* Shadow overrides — soft glow instead of hard drop shadows */
body.theme-dark .shadow-sm {
    box-shadow:
        0 0 0 1px var(--surface-border),
        0 2px 8px -2px rgba(0, 0, 0, 0.3) !important;
}
body.theme-dark .shadow {
    box-shadow:
        0 0 0 1px var(--surface-border),
        0 4px 16px -4px rgba(0, 0, 0, 0.35) !important;
}
body.theme-dark .shadow-md {
    box-shadow:
        0 0 0 1px var(--surface-border),
        0 8px 24px -4px rgba(0, 0, 0, 0.4) !important;
}
body.theme-dark .shadow-lg, body.theme-dark .shadow-xl {
    box-shadow:
        0 0 0 1px var(--surface-border),
        0 12px 40px -8px rgba(0, 0, 0, 0.5) !important;
}

/* Dark theme: gradient fade dividers instead of hard borders */
body.theme-dark hr,
body.theme-dark .divide-y > * + * {
    border-color: var(--surface-border) !important;
}
/* Subtle top-edge highlight on cards (glass illusion) */
body.theme-dark .rounded-xl,
body.theme-dark .rounded-2xl,
body.theme-dark .rounded-lg {
    position: relative;
}

/* Scanner console theming */
body.themed .scanner-console {
    background-color: var(--scanner-bg) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.04) !important;
}

/* Glass theme */
body.theme-glass .bg-white, body.theme-glass .group.bg-white,
body.theme-glass .info-card {
    backdrop-filter: var(--backdrop-blur) !important;
    -webkit-backdrop-filter: var(--backdrop-blur) !important;
}

/* ===== Dark Theme Gradient Fade Effects ===== */

/* Gradient border effect on major containers */
body.theme-dark #main-nav {
    border-bottom: none !important;
    box-shadow:
        0 1px 0 0 var(--nav-border),
        0 4px 24px -4px rgba(0, 0, 0, 0.3);
}
body.theme-dark #main-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.15;
    pointer-events: none;
}

/* Footer top gradient line */
body.theme-dark #main-footer {
    border-top: none !important;
    position: relative;
}
body.theme-dark #main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.12;
}

/* Section separators with gradient fade */
body.theme-dark .border-b {
    border-bottom-color: var(--surface-border) !important;
}
body.theme-dark .border-t {
    border-top-color: var(--surface-border) !important;
}

/* ===== Theme Picker ===== */
#theme-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.2s ease;
}
#theme-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--accent);
}

#theme-picker-panel {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 9999;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
#theme-picker-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.theme-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--surface-border);
}
.theme-picker-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
}
.theme-picker-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 20px 8px;
    font-family: 'IBM Plex Mono', monospace;
}
#theme-picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
#theme-picker-close:hover { color: var(--text-primary); }

.theme-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px 16px;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}
.theme-swatch:hover { background: var(--surface-hover); }
.theme-swatch.active {
    border-color: var(--accent);
    background: var(--surface-hover);
}
.theme-swatch.active .swatch-label { color: var(--accent); }

.swatch-preview {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    display: block;
    border: 1px solid rgba(128, 128, 128, 0.15);
    transition: transform 0.15s;
}
.theme-swatch:hover .swatch-preview { transform: scale(1.04); }

.swatch-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}

/* ===== Typography ===== */
.font-heading { font-family: var(--font-heading, 'DM Sans', sans-serif); }
.font-mono-data { font-family: var(--font-mono, 'IBM Plex Mono', monospace); }

/* ===== Scanner Console (Dark Card) ===== */
.scanner-console {
    background-color: #0B1220;
    border-radius: 1rem;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.scanner-console::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
}

.scanner-console-input {
    width: 100%;
    background-color: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    color: #F1F5F9;
    font-size: 1rem;
    height: 48px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scanner-console-input::placeholder {
    color: #4B5563;
}

.scanner-console-input:focus {
    outline: none;
    border-color: #38BDF8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* ===== Scan Mode Selector (Quick/Full segmented control) ===== */
.scan-mode-selector {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    padding: 3px;
    gap: 2px;
}

.scan-mode-selector [role="radio"] {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    white-space: nowrap;
    user-select: none;
}

.scan-mode-selector [role="radio"]:hover {
    color: rgba(255, 255, 255, 0.75);
}

.scan-mode-selector [role="radio"][aria-checked="true"] {
    background: rgba(255, 255, 255, 0.1);
    color: #F1F5F9;
    border-color: rgba(255, 255, 255, 0.1);
}

.scan-mode-selector [role="radio"]:focus-visible {
    outline: 2px solid #38BDF8;
    outline-offset: 1px;
}

/* ===== Scan Button (Green CTA) ===== */
.scan-btn-primary {
    background-color: #22C55E;
    color: white;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
    height: 48px;
}

.scan-btn-primary:hover:not(:disabled) {
    background-color: #16A34A;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.scan-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Info Card V2 (Result page cards with left border) ===== */
.info-card-v2 {
    background: #F8FAFC;
    border-radius: 1rem;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    border-left: 4px solid #E2E8F0;
    transition: box-shadow 0.2s ease;
}

.info-card-v2:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.info-card-v2.status-pass {
    border-left-color: #22C55E;
}

.info-card-v2.status-warn {
    border-left-color: #F59E0B;
}

.info-card-v2.status-fail {
    border-left-color: #EF4444;
}

.info-card-v2 .info-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #E2E8F0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    background: white;
}

.info-card-v2 .info-card-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Status pills for card headers */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.status-pill-pass {
    background-color: #DCFCE7;
    color: #166534;
}

.status-pill-warn {
    background-color: #FEF3C7;
    color: #92400E;
}

.status-pill-fail {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* ===== Scanner tab pills for secondary scanners ===== */
.scanner-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.scanner-pill:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.scanner-pill.active {
    color: #38BDF8;
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.08);
}

/* Grade badges */
.grade-aplus { background-color: #10b981; color: white; }
.grade-a { background-color: #34d399; color: white; }
.grade-b { background-color: #fbbf24; color: black; }
.grade-c { background-color: #f97316; color: white; }
.grade-d { background-color: #ef4444; color: white; }
.grade-f { background-color: #dc2626; color: white; }
.grade-t { background-color: #6b7280; color: white; }

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 1rem;
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.status-healthy { background-color: #10b981; }
.status-warning { background-color: #fbbf24; }
.status-critical { background-color: #ef4444; }
.status-unknown { background-color: #6b7280; }

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-slow {
    animation: pulse 3s infinite;
}

/* Scan progress */
.scan-progress {
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.scan-progress-bar {
    height: 100%;
    background-color: #4f46e5;
    transition: width 0.3s ease;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card-hover:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Cost Meter Styles */
.cost-meter-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cost-meter-svg {
    filter: drop-shadow(0 4px 6px rgba(99, 102, 241, 0.15));
}

.cost-meter-progress {
    stroke-dashoffset: 534;
}

.cost-meter-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.cost-meter-value {
    font-variant-numeric: tabular-nums;
}

.cost-meter-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: cost-meter-pulse 2s ease-in-out infinite;
}

@keyframes cost-meter-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* Cost Breakdown Bars */
.cost-breakdown-bar {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.cost-breakdown-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cost-breakdown-item {
    opacity: 0;
    animation: cost-breakdown-fade-in 0.5s ease forwards;
}

.cost-breakdown-item[data-delay="100"] { animation-delay: 0.1s; }
.cost-breakdown-item[data-delay="200"] { animation-delay: 0.2s; }
.cost-breakdown-item[data-delay="300"] { animation-delay: 0.3s; }
.cost-breakdown-item[data-delay="400"] { animation-delay: 0.4s; }

@keyframes cost-breakdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Period Progress Bar */
.period-progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.period-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status Grid for Uptime Dashboard */
.status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
}

.status-grid-item {
    position: relative;
    cursor: pointer;
}

.status-grid-dot-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
    transition: all 0.2s ease;
}

.status-grid-item:hover .status-grid-dot-wrapper {
    background-color: #e5e7eb;
    transform: scale(1.1);
}

.status-grid-dot {
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.status-grid-up {
    background-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-grid-down {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-grid-pulse {
    animation: status-grid-pulse-animation 2s ease-in-out infinite;
}

@keyframes status-grid-pulse-animation {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.4);
    }
}

/* Status Grid Tooltip */
.status-grid-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.5rem);
    background-color: #1f2937;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.status-grid-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.status-grid-item:hover .status-grid-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-0.75rem);
}

/* Toggle Switch Styles for Integrations */
.toggle-switch {
    position: relative;
    display: inline-block;
}

.toggle-bg {
    width: 2.5rem;
    height: 1.25rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    transition: background-color 0.2s ease-in-out;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-dot {
    position: absolute;
    left: 0.125rem;
    top: 0.125rem;
    width: 1rem;
    height: 1rem;
    background-color: white;
    border-radius: 9999px;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert-toggle:checked + .toggle-bg {
    background-color: rgb(79, 70, 229);
}

.alert-toggle:checked + .toggle-bg + .toggle-dot {
    transform: translateX(1.25rem);
}

/* Uptime Percentage Display */
.uptime-percentage {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.uptime-percentage-excellent {
    color: #22c55e;
}

.uptime-percentage-good {
    color: #eab308;
}

.uptime-percentage-poor {
    color: #ef4444;
}

/* Uptime Progress Ring Animation */
.uptime-ring {
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Uptime Stats Card Animation */
.uptime-stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uptime-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Incident Timeline Styles */
.incident-item {
    transition: background-color 0.2s ease;
}

.incident-item:hover {
    background-color: #f9fafb;
}

.incident-details {
    animation: incident-expand 0.3s ease-out;
}

@keyframes incident-expand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.incident-chevron {
    transition: transform 0.2s ease-in-out;
}

.incident-chevron.rotate-180 {
    transform: rotate(180deg);
}

/* Ongoing Incident Pulse */
.incident-ongoing {
    animation: incident-pulse 2s ease-in-out infinite;
}

@keyframes incident-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Response Time Chart Gradient */
.response-time-good {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0) 100%);
}

.response-time-warning {
    background: linear-gradient(180deg, rgba(234, 179, 8, 0.2) 0%, rgba(234, 179, 8, 0) 100%);
}

.response-time-critical {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0) 100%);
}

/* Toast Notifications */
#toast-container {
    z-index: 9999;
}

.toast-enter {
    animation: toast-slide-in 0.3s ease-out;
}

.toast-exit {
    animation: toast-slide-out 0.3s ease-in;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Integration Type Card Hover */
.integration-type-card {
    transition: all 0.2s ease;
}

.integration-type-card:hover {
    transform: translateY(-2px);
}

.integration-type-card.selected {
    border-color: #6366f1;
    background-color: #eef2ff;
}

/* Delivery Log Entry Animation */
.delivery-log-entry {
    animation: log-fade-in 0.3s ease forwards;
}

@keyframes log-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cost Meter Smooth Animation Override */
.cost-meter-progress {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Number Counter Animation */
.counter-animate {
    font-variant-numeric: tabular-nums;
}

/* General Utility Animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease forwards;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease forwards;
}

/* Smooth transitions for interactive elements */
.smooth-transition {
    transition: all 0.2s ease;
}

/* Loading spinner for async operations */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
