:root {
    --bg-base: #070b14;
    --glass-panel: rgba(255, 255, 255, 0.055);
    --glass-panel-strong: rgba(255, 255, 255, 0.085);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-border-highlight: rgba(255, 255, 255, 0.35);
    --liquid-accent: #38bdf8;
    --liquid-accent-2: #818cf8;
    --liquid-glow: rgba(56, 189, 248, 0.35);
    --danger-glass: rgba(244, 63, 94, 0.22);
    --danger-border: rgba(244, 63, 94, 0.5);
    --text-main: #f8fafc;
    --text-muted: rgba(248, 250, 252, 0.58);
    --radius-lg: 22px;
    --radius-md: 14px;
    --blur-strength: blur(24px) saturate(160%);
    --transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    /* Wielowarstwowe, płynne tło z miękkimi "kroplami" światła pod szkłem */
    background-image:
        radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.22) 0%, transparent 42%),
        radial-gradient(circle at 85% 75%, rgba(129, 140, 248, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        linear-gradient(135deg, #060913 0%, #0d1526 50%, #080d1a 100%);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* WĄSKI PASEK GÓRNY - LIQUID BAR */
.top-header {
    height: 74px;
    min-height: 74px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: var(--blur-strength);
    -webkit-backdrop-filter: var(--blur-strength);
    border-bottom: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 14px #34d399, 0 0 4px #ffffff;
}

.header-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 0%, #bae6fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 999px;
}

/* KONTENER GŁÓWNY */
.dashboard-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

/* PANELE SZKLANE */
.panel {
    background: var(--glass-panel);
    backdrop-filter: var(--blur-strength);
    -webkit-backdrop-filter: var(--blur-strength);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    /* Zewnętrzny cień + wewnętrzny blask górnej krawędzi szkła */
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.25),
        inset 0 -1px 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* KONTROLKI GŁOŚNOŚCI */
.volume-control-group {
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 10px;
    align-items: center;
}

.btn-vol {
    padding: 12px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    border-radius: var(--radius-md);
}

.btn-vol:active {
    background: rgba(56, 189, 248, 0.28);
    border-color: var(--glass-border-highlight);
    box-shadow: 0 0 20px var(--liquid-glow);
    transform: scale(0.95);
}

.vol-display-box {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    text-align: center;
    font-family: 'SF Mono', ui-monospace, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0f2fe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SZKLANE PRZYCISKI (LIQUID BUTTONS) */
.btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.btn:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: var(--glass-border-highlight);
    transform: translateY(-2px);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-main.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.32) 0%, rgba(129, 140, 248, 0.25) 100%);
    border-color: rgba(186, 230, 253, 0.65);
    color: #ffffff;
    box-shadow:
        0 8px 28px var(--liquid-glow),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* PRAWY PANEL */
.panel-right {
    position: relative;
}

.idle-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 16px;
}

.placeholder-icon {
    font-size: 3.2rem;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.active-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 18px;
    animation: liquidFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hidden {
    display: none !important;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border);
}

.selected-label {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-muted);
}

.selected-label span {
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.btn-back {
    background: var(--danger-glass);
    border-color: var(--danger-border);
    color: #fecdd3;
    padding: 8px 18px;
    font-size: 0.9rem;
    border-radius: 999px;
    gap: 6px;
}

.btn-back:hover {
    background: rgba(244, 63, 94, 0.45);
    border-color: #fda4af;
    color: #ffffff;
    box-shadow: 0 0 22px rgba(244, 63, 94, 0.45);
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 185px));
    gap: 16px;
    flex: 1;
    align-content: start;
}

.btn-action {
    height: 86px;
    font-size: 0.98rem;
    text-align: center;
    border-radius: 18px;
}

.btn-action.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35) 0%, rgba(129, 140, 248, 0.28) 100%);
    border-color: rgba(255, 255, 255, 0.65);
    color: #ffffff;
    box-shadow:
        0 8px 25px var(--liquid-glow),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.iframe-container {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.4);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* SZKLANY SUWAK JASNOŚCI */
.slider-container {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.slider-badge {
    background: rgba(56, 189, 248, 0.2);
    color: #e0f2fe;
    border: 1px solid rgba(56, 189, 248, 0.45);
    padding: 4px 14px;
    border-radius: 999px;
    font-family: 'SF Mono', ui-monospace, monospace;
    font-size: 1.05rem;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    outline: none;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #bae6fd 60%, #38bdf8 100%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 16px var(--liquid-glow);
    transition: var(--transition);
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.18);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

@keyframes liquidFadeIn {
    from {
        opacity: 0;
        transform: scale(0.985) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}