
/* StreamK Global Flat Design System */
:root {
    color-scheme: light;
    --sk-green: #0dbf65;
    --sk-green-dark: #078f4a;
    --sk-page: #f5f8f6;
    --sk-surface: #ffffff;
    --sk-surface-alt: #edf3ef;
    --sk-text: #202b25;
    --sk-muted: #718078;
    --sk-border: #dce6df;
    --sk-input: #ffffff;
    --sk-hover: #e9f7ef;
}

html[data-sk-theme="dark"] {
    color-scheme: dark;
    --sk-page: #151a17;
    --sk-surface: #202722;
    --sk-surface-alt: #29332d;
    --sk-text: #e8f0eb;
    --sk-muted: #a4b2a9;
    --sk-border: #39463e;
    --sk-input: #202722;
    --sk-hover: #2c3d32;
}

html, body {
    background-color: var(--sk-page) !important;
    color: var(--sk-text);
}

body {
    background-image: none !important;
}

html[data-sk-theme="dark"] body {
    color: var(--sk-text) !important;
}

/* Flat design: remove glow and decorative shadows */
* {
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Main page surfaces */
header, nav, footer,
main, section, article,
.card, .form-container, .form-card,
.login-box, .player-card, .log-card,
.ops-header, .ops-metric, .ops-welcome,
.station-card, .mini-player,
.table-container, .content-card {
    color: var(--sk-text);
    border-color: var(--sk-border);
}

html[data-sk-theme="dark"] header,
html[data-sk-theme="dark"] nav,
html[data-sk-theme="dark"] footer,
html[data-sk-theme="dark"] main,
html[data-sk-theme="dark"] section,
html[data-sk-theme="dark"] article,
html[data-sk-theme="dark"] .card,
html[data-sk-theme="dark"] .form-container,
html[data-sk-theme="dark"] .form-card,
html[data-sk-theme="dark"] .login-box,
html[data-sk-theme="dark"] .player-card,
html[data-sk-theme="dark"] .log-card,
html[data-sk-theme="dark"] .ops-header,
html[data-sk-theme="dark"] .ops-metric,
html[data-sk-theme="dark"] .ops-welcome,
html[data-sk-theme="dark"] .station-card,
html[data-sk-theme="dark"] .mini-player,
html[data-sk-theme="dark"] .table-container,
html[data-sk-theme="dark"] .content-card {
    background-color: var(--sk-surface) !important;
    color: var(--sk-text) !important;
    border-color: var(--sk-border) !important;
    background-image: none !important;
}

/* Common text */
html[data-sk-theme="dark"] h1,
html[data-sk-theme="dark"] h2,
html[data-sk-theme="dark"] h3,
html[data-sk-theme="dark"] h4,
html[data-sk-theme="dark"] p,
html[data-sk-theme="dark"] label,
html[data-sk-theme="dark"] strong,
html[data-sk-theme="dark"] span,
html[data-sk-theme="dark"] td,
html[data-sk-theme="dark"] th {
    color: inherit;
}

html[data-sk-theme="dark"] .muted,
html[data-sk-theme="dark"] small,
html[data-sk-theme="dark"] .log-info,
html[data-sk-theme="dark"] .mini-info span {
    color: var(--sk-muted) !important;
}

/* Form fields */
input, select, textarea {
    border-color: var(--sk-border);
}

html[data-sk-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-sk-theme="dark"] select,
html[data-sk-theme="dark"] textarea {
    background: var(--sk-input) !important;
    color: var(--sk-text) !important;
    border-color: var(--sk-border) !important;
}

html[data-sk-theme="dark"] input::placeholder,
html[data-sk-theme="dark"] textarea::placeholder {
    color: var(--sk-muted);
}

/* Tables */
html[data-sk-theme="dark"] table,
html[data-sk-theme="dark"] tbody,
html[data-sk-theme="dark"] tr {
    background-color: var(--sk-surface) !important;
    color: var(--sk-text) !important;
}

html[data-sk-theme="dark"] th {
    background-color: var(--sk-surface-alt) !important;
    color: var(--sk-text) !important;
}

html[data-sk-theme="dark"] td {
    border-color: var(--sk-border) !important;
}

/* Links and controls */
a {
    text-underline-offset: 3px;
}

button, .button, input[type="submit"] {
    box-shadow: none !important;
}

html[data-sk-theme="dark"] a:not(.theme-toggle) {
    color: #55d991;
}

html[data-sk-theme="dark"] .nav,
html[data-sk-theme="dark"] .ops-nav {
    background: var(--sk-surface) !important;
    border-color: var(--sk-border) !important;
}

html[data-sk-theme="dark"] .nav-links a,
html[data-sk-theme="dark"] .ops-nav a {
    color: var(--sk-text) !important;
}

html[data-sk-theme="dark"] .nav-links a:hover,
html[data-sk-theme="dark"] .nav-links a.active,
html[data-sk-theme="dark"] .ops-nav a:hover,
html[data-sk-theme="dark"] .ops-nav a.active {
    background: var(--sk-hover) !important;
    color: #55d991 !important;
}

/* Keep StreamK buttons green and flat */
button,
.mini-play,
.station-action,
.download-btn,
.print-button,
input[type="submit"] {
    box-shadow: none !important;
}

html[data-sk-theme="dark"] .mini-play,
html[data-sk-theme="dark"] .station-action,
html[data-sk-theme="dark"] button[type="submit"],
html[data-sk-theme="dark"] input[type="submit"] {
    border-color: var(--sk-green) !important;
}

/* Player visualizer: no glow */
.streamk-vu-dot,
.mini-vu-bar {
    box-shadow: none !important;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    z-index: 99999;
    top: 12px;
    right: 14px;
    min-width: 42px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--sk-border);
    border-radius: 7px;
    background: var(--sk-surface);
    color: var(--sk-text);
    font: 600 13px Arial, sans-serif;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--sk-hover);
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 700px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        min-width: 38px;
        height: 36px;
        padding: 0 9px;
    }
}

/* Preserve print reports */
@media print {
    .theme-toggle {
        display: none !important;
    }
}


/* StreamK responsive floating theme toggle */
#streamk-theme-toggle {
    position: fixed !important;
    right: max(18px, env(safe-area-inset-right)) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 900 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    min-width: 46px !important;
    min-height: 46px !important;
    padding: 10px 13px !important;

    border: 1px solid #0dbf65 !important;
    border-radius: 28px !important;
    background: #ffffff !important;
    color: #087d43 !important;

    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer !important;
    font: 600 13px/1.2 Arial, sans-serif !important;
    transition: background .2s ease, color .2s ease !important;
}

#streamk-theme-toggle:hover {
    background: #eafaf1 !important;
}

html[data-sk-theme="dark"] #streamk-theme-toggle {
    background: #202820 !important;
    color: #72e5a6 !important;
    border-color: #0dbf65 !important;
}

html[data-sk-theme="dark"] #streamk-theme-toggle:hover {
    background: #29382e !important;
}

#streamk-theme-toggle .sk-theme-icon {
    font-size: 19px !important;
    line-height: 1 !important;
}

#streamk-theme-toggle .sk-theme-label {
    white-space: nowrap !important;
}

@media (max-width: 600px) {
    #streamk-theme-toggle {
        right: max(12px, env(safe-area-inset-right)) !important;
        top: auto !important;
        bottom: max(105px, calc(env(safe-area-inset-bottom) + 90px)) !important;
        transform: none !important;
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    #streamk-theme-toggle .sk-theme-label {
        display: none !important;
    }
}

@media (max-height: 500px) and (min-width: 601px) {
    #streamk-theme-toggle {
        top: auto !important;
        bottom: 20px !important;
        transform: none !important;
    }
}

/* StreamK floating theme switch */
#streamk-theme-toggle {
    position: fixed !important;
    top: 50% !important;
    right: 18px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 900 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    min-width: 48px !important;
    min-height: 48px !important;
    padding: 10px 15px !important;

    border: 1px solid #0dbf65 !important;
    border-radius: 30px !important;
    background: #ffffff !important;
    color: #087d43 !important;

    font: 600 13px Arial, sans-serif !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#streamk-theme-toggle:hover {
    background: #e9f9f0 !important;
}

#streamk-theme-toggle .sk-theme-icon {
    font-size: 21px !important;
    line-height: 1 !important;
}

#streamk-theme-toggle .sk-theme-label {
    white-space: nowrap !important;
}

html[data-sk-theme="dark"] #streamk-theme-toggle {
    background: #202c24 !important;
    color: #72e5a6 !important;
    border-color: #0dbf65 !important;
}

@media (max-width: 600px) {
    #streamk-theme-toggle {
        top: auto !important;
        right: 14px !important;
        bottom: calc(125px + env(safe-area-inset-bottom)) !important;
        transform: none !important;

        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    #streamk-theme-toggle .sk-theme-label {
        display: none !important;
    }
}

@media (max-height: 500px) and (min-width: 601px) {
    #streamk-theme-toggle {
        top: auto !important;
        bottom: 18px !important;
        transform: none !important;
    }
}
