/* ============================================================
   Tema universal do Modo Teatro
   Esta camada é carregada depois dos temas visuais para que os
   controles flutuantes não herdem bevels, vidro ou cores do tema
   selecionado fora do teatro.
   ============================================================ */

body.theater-mode {
    --theater-surface: rgba(24, 24, 24, 0.98);
    --theater-surface-hover: #303030;
    --theater-control-surface: #262626;
    --theater-border: #464646;
    --theater-hover-border: #606060;
    --theater-divider: #3a3a3a;
    --theater-text: #f4f4f4;
    --theater-muted: #a9a9a9;
    --theater-accent: #35bdf2;
    --theater-active-text: #071015;
    --theater-switch: #4a4a4a;
    --theater-switch-border: #5b5b5b;
    --theater-switch-knob: #d8d8d8;
    --theater-track: #565656;
    --theater-thumb: #ffffff;
    --theater-panel-shadow: 0 12px 30px rgba(0, 0, 0, 0.58);
}

html[data-color-mode="light"] body.theater-mode {
    --theater-surface: rgba(250, 250, 250, 0.98);
    --theater-surface-hover: #eeeeee;
    --theater-control-surface: #f2f2f2;
    --theater-border: #c9c9c9;
    --theater-hover-border: #aaaaaa;
    --theater-divider: #d8d8d8;
    --theater-text: #202020;
    --theater-muted: #747474;
    --theater-accent: #079bd3;
    --theater-active-text: #ffffff;
    --theater-switch: #c8c8c8;
    --theater-switch-border: #b9b9b9;
    --theater-switch-knob: #ffffff;
    --theater-track: #c8c8c8;
    --theater-thumb: #ffffff;
    --theater-panel-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

body.theater-mode .transport-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    box-sizing: border-box;
    color: #ffffff;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: none;
    font-family: "Segoe UI", Arial, sans-serif;
}

body.theater-mode .transport-controls {
    height: auto;
    min-height: 0;
    padding: 0;
    gap: 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Temas podem transformar o play/pause em um controle de destaque.
   No Teatro todos os botões voltam à mesma linguagem compacta. */
body.theater-mode #playBtn,
body.theater-mode #pauseBtn {
    width: 32px;
    height: 32px;
    margin: 0;
    color: #ffffff;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: none;
}

body.theater-mode #playBtn:hover,
body.theater-mode #pauseBtn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: transparent;
    box-shadow: none;
}

body.theater-mode .transport-stop-btn {
    margin-right: 4px;
}

body.theater-mode .right-controls {
    gap: 8px;
}

body.theater-mode .view-controls {
    gap: 4px;
    padding-left: 12px;
}

body.theater-mode .view-controls::before {
    height: 20px;
}

body.theater-mode .transport-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    border-color: transparent;
    box-shadow: none;
}

body.theater-mode .transport-btn:active:not(:disabled),
body.theater-mode .transport-btn.is-active {
    color: #ffffff;
    background: rgba(53, 189, 242, 0.2);
    border-color: rgba(53, 189, 242, 0.7);
    box-shadow: none;
    transform: none;
}

body.theater-mode .transport-btn:disabled {
    color: var(--theater-muted);
    opacity: 0.42;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body.theater-mode .playback-settings-panel,
body.theater-mode .volume-popover {
    color: var(--theater-text);
    background: var(--theater-surface);
    border: 1px solid var(--theater-border);
    border-radius: 5px;
    box-shadow: var(--theater-panel-shadow);
    font-family: "Segoe UI", Arial, sans-serif;
    backdrop-filter: none;
}

body.theater-mode .playback-settings-panel {
    padding: 12px;
}

body.theater-mode .playback-settings-title {
    margin: 0 0 7px;
    padding: 0;
    color: var(--theater-text);
    background: transparent;
    border: 0;
    font: 600 12px/1.4 "Segoe UI", Arial, sans-serif;
}

body.theater-mode .playback-speed-heading {
    color: var(--theater-text);
}

body.theater-mode .playback-setting-toggle {
    min-height: 34px;
    padding: 7px 4px;
    color: var(--theater-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: none;
    font-family: "Segoe UI", Arial, sans-serif;
}

body.theater-mode .playback-setting-toggle:hover {
    background: var(--theater-surface-hover);
    border-color: var(--theater-border);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
}

body.theater-mode .setting-switch {
    width: 30px;
    height: 16px;
    padding: 2px;
    box-sizing: border-box;
    background: var(--theater-switch);
    border: 1px solid var(--theater-switch-border);
    border-radius: 10px;
    box-shadow: none;
}

body.theater-mode .setting-switch::after {
    width: 12px;
    height: 12px;
    background: var(--theater-switch-knob);
    border: 0;
    border-radius: 50%;
    box-shadow: none;
}

body.theater-mode .playback-setting-toggle.is-active .setting-switch {
    background: var(--theater-accent);
    border-color: var(--theater-accent);
}

body.theater-mode .playback-setting-toggle.is-active .setting-switch::after {
    background: #ffffff;
    transform: translateX(14px);
}

body.theater-mode .playback-speed-section,
body.theater-mode .compact-settings-controls {
    border-color: var(--theater-divider);
}

body.theater-mode .playback-speed-section {
    margin: 5px 0 0;
    padding-top: 9px;
}

body.theater-mode .playback-speed-slider-row {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 8px;
}

body.theater-mode .playback-speed-step,
body.theater-mode .playback-speed-presets button {
    min-height: 30px;
    color: var(--theater-text);
    background: var(--theater-control-surface);
    border: 1px solid var(--theater-border);
    border-radius: 4px;
    box-shadow: none;
    font-family: "Segoe UI", Arial, sans-serif;
}

body.theater-mode .playback-speed-step {
    width: 30px;
    height: 30px;
    padding: 0;
}

body.theater-mode .playback-speed-presets {
    align-items: stretch;
}

body.theater-mode .playback-speed-step:hover,
body.theater-mode .playback-speed-presets button:hover {
    background: var(--theater-surface-hover);
    border-color: var(--theater-hover-border);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

body.theater-mode .playback-speed-step:active,
body.theater-mode .playback-speed-presets button:active,
body.theater-mode .playback-speed-presets button.is-active {
    color: var(--theater-active-text);
    background: var(--theater-accent);
    border-color: var(--theater-accent);
    box-shadow: none;
}

body.theater-mode .volume-popover-mute {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    color: var(--theater-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: none;
}

body.theater-mode .volume-popover-mute:hover {
    background: var(--theater-surface-hover);
    border-color: var(--theater-border);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

body.theater-mode #settingsSpeedBar,
body.theater-mode .volume-bar {
    height: 4px;
    background: linear-gradient(
        to right,
        var(--theater-accent) 0%,
        var(--theater-accent) var(--fill-percent, 0%),
        var(--theater-track) var(--fill-percent, 0%),
        var(--theater-track) 100%
    );
    border: 0;
    border-radius: 2px;
    box-shadow: none;
}

body.theater-mode #settingsSpeedBar::-webkit-slider-thumb,
body.theater-mode .volume-bar::-webkit-slider-thumb {
    width: 11px;
    height: 11px;
    background: var(--theater-thumb);
    border: 0;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

body.theater-mode #settingsSpeedBar::-moz-range-thumb,
body.theater-mode .volume-bar::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: var(--theater-thumb);
    border: 0;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

body.theater-mode #settingsSpeedBar::-moz-range-track,
body.theater-mode .volume-bar::-moz-range-track {
    height: 4px;
    background: var(--theater-track);
    border: 0;
    border-radius: 2px;
}

body.theater-mode .volume-value {
    color: var(--theater-text);
}

body.theater-mode .compact-settings-controls .transport-btn {
    width: 100%;
    height: 32px;
    padding: 0 7px;
    color: var(--theater-text);
    background: transparent;
    border-color: transparent;
    border-radius: 4px;
    box-shadow: none;
}

body.theater-mode .compact-settings-controls .compact-control-label {
    flex: 1 1 auto;
    text-align: left;
}

body.theater-mode .compact-settings-controls .icon-prev::before {
    border-right-color: currentColor;
}

body.theater-mode .compact-settings-controls .icon-next::before {
    border-left-color: currentColor;
}

body.theater-mode .compact-settings-controls .icon-theater,
body.theater-mode .compact-settings-controls .icon-pip {
    border-color: currentColor;
}

body.theater-mode .compact-settings-controls .icon-fullscreen::before,
body.theater-mode .compact-settings-controls .icon-fullscreen::after {
    border-color: currentColor;
}

body.theater-mode .compact-settings-controls .icon-pip::after {
    background: currentColor;
    border-color: var(--theater-surface);
}

body.theater-mode .compact-settings-controls .transport-btn > .icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.theater-mode .compact-settings-controls .transport-btn:hover:not(:disabled) {
    background: var(--theater-surface-hover);
    border-color: var(--theater-border);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
}
