:root {
    --bg-main: #09080f;
    --card-bg: #13121d;
    --card-surface: #1b1929;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(168, 85, 247, 0.45);
    --accent-purple: #a855f7;
    --accent-teal: #14b8a6;
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #14b8a6 100%);
    --danger: #f43f5e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.16) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.14) 0%, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* GÓRNY PASEK */
.top-header {
    height: 62px;
    min-height: 62px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(9, 8, 15, 0.8);
    backdrop-filter: blur(12px);
}

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

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-teal);
    box-shadow: 0 0 12px var(--accent-teal);
}

.header-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.header-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* GŁÓWNY UKŁAD PIONOWY (ZAMIAST LEWA-PRAWA) */
.dashboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 24px 24px;
    overflow: hidden;
}

/* GÓRNY DOCK NAWIGACYJNY */
.panel-left {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 14px 22px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.dock-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dock-divider {
    width: 1px;
    height: 54px;
    background: var(--border-subtle);
}

.panel-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

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

/* PRZYCISKI W DOCKU */
.btn {
    background: var(--card-surface);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: #242136;
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}

.btn-main.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

/* KONTROLKA AUDIO W DOCKU */
.volume-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0c0b13;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.btn-vol {
    width: 42px;
    height: 38px;
    padding: 0;
    font-size: 1.2rem;
    border-radius: 9px;
}

.btn-vol:active {
    background: var(--accent-teal);
    color: #000;
    transform: scale(0.94);
}

.vol-display-box {
    min-width: 64px;
    text-align: center;
    font-family: monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-teal);
}

/* DOLNA SCENA ROBOCZA (100% SZEROKOŚCI) */
.panel-right {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 26px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
}

/* EKRAN POWITALNY / IDLE */
.idle-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.orb-ring {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    padding: 3px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.3);
    margin-bottom: 6px;
}

.placeholder-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #ffffff;
}

.idle-placeholder h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.idle-placeholder p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* AKTYWNY WIDOK STREFY */
.active-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
    animation: slideUp 0.3s 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: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.selected-label {
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-label span {
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.4);
    color: var(--accent-teal);
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.btn-back {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fda4af;
    border-radius: 999px;
    padding: 9px 18px;
    gap: 8px;
}

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

/* PODZIAŁ BENTO WEWNĄTRZ SCENY: KAFELKI ŹRÓDEŁ (2/3) + PANEL JASNOŚCI (1/3) */
.workspace-split {
    flex: 1;
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 22px;
    min-height: 0;
}

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

.btn-action {
    height: 112px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, #1d1b2e 0%, #141320 100%);
    text-align: left;
}

.btn-action .action-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 9px;
    border-radius: 6px;
}

.btn-action strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-action:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.2);
}

.btn-action.active {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.25) 0%, rgba(20, 184, 166, 0.18) 100%);
    border-color: var(--accent-purple);
    box-shadow: 0 0 28px rgba(168, 85, 247, 0.35);
}

.btn-action.active .action-tag {
    background: var(--accent-purple);
    color: #ffffff;
}

/* BOCZNA KARTA JASNOŚCI */
.slider-container {
    background: #0e0d16;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    max-height: fit-content;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
}

.slider-hint {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.slider-badge {
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 999px;
    font-family: monospace;
    font-size: 1.15rem;
    font-weight: 800;
}

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #1e1c2e;
    outline: none;
    margin: 12px 0;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid var(--accent-purple);
    cursor: pointer;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.7);
    transition: var(--transition);
}

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

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

/* IFRAME PLAYLISTY */
.iframe-container {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #07060c;
    border: 1px solid var(--border-subtle);
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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