/* (20261115_1655_극장모드_우측사이드바_검증완료) */
/* ========================================================
   📁 [추억 시네마 앨범] 2. 극장 모드 우측 사이드바 전용 스타일 (pb_fullscreen_right_bar.css)
   - 극장 모드 시 우측에 노출되는 '준비된 사진' 보관함 사이드바
   - 브라우저 창 크기에 따라 유연하게 너비가 반응하는 동적 너비 (20vw, 200px~300px)
   - 좌측 비디오 영역과 명확히 구분되는 독립적인 테두리 및 배경 디자인
   - 전체화면(F11) 전환 시 자동 숨김 처리
   ======================================================== */

:root {
    --pb-theater-sidebar-width: clamp(200px, 18vw, 280px);
}

/* 1. 극장 모드 시 우측 '준비된 사진' 사이드바 노출 (동적 반응형 너비) */
.pb-workspace-grid.no-editor .pb-right-sidebar-workspace,
.pb-workspace-grid.no-editor .pb-sidebar-workspace {
    display: flex !important;
    flex-direction: column !important;
    width: var(--pb-theater-sidebar-width, 18vw) !important;
    min-width: 180px !important;
    max-width: 22vw !important;
    flex: 0 0 var(--pb-theater-sidebar-width, 18vw) !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #0B0E17 !important;
    border-left: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    z-index: 10 !important;
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 12px 10px !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5) !important;
}

/* 2. 극장 모드 우측 사이드바 내부 불필요한 가이드/상단버튼 카드 숨김 */
.pb-workspace-grid.no-editor .pb-sidebar-guide-card,
.pb-workspace-grid.no-editor .pb-sidebar-action-bar {
    display: none !important;
}

/* 🌟 2-1. 전체 모드 시 우측 사이드바 상단 세부 설정 메뉴 카드 */
.pb-fullscreen-top-toolbar {
    display: none;
}

.pb-workspace-grid.no-editor .pb-right-sidebar-workspace .pb-fullscreen-top-toolbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    position: static !important;
    inset: auto !important;
    z-index: 10 !important;
    margin-bottom: 8px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
}

.pb-fullscreen-top-toolbar .pb-theater-toolbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-fullscreen-top-toolbar .pb-theater-toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pb-fullscreen-top-toolbar .pb-theater-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.pb-fullscreen-top-toolbar .pb-control-label {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pb-fullscreen-top-toolbar .pb-subtitle-size-group {
    display: inline-flex;
    gap: 3px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.pb-fullscreen-top-toolbar .pb-speed-btn-group {
    display: inline-flex;
    gap: 2px;
    flex-wrap: nowrap;
}

.pb-fullscreen-top-toolbar .pb-btn-speed-max {
    font-weight: 700;
    color: #FCD34D !important;
    border-color: rgba(252, 211, 77, 0.4) !important;
    background: rgba(252, 211, 77, 0.1) !important;
}

.pb-fullscreen-top-toolbar .pb-btn-speed-max:hover {
    background: rgba(252, 211, 77, 0.25) !important;
    color: #FFFFFF !important;
}

.pb-fullscreen-top-toolbar .pb-btn-speed-max.active {
    background: #F59E0B !important;
    border-color: #F59E0B !important;
    color: #000000 !important;
    font-weight: 800 !important;
}

.pb-fullscreen-top-toolbar .pb-btn-edit-sub {
    font-weight: 700;
    color: #6EE7B7 !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
    background: rgba(16, 185, 129, 0.15) !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pb-fullscreen-top-toolbar .pb-btn-edit-sub:hover {
    background: rgba(16, 185, 129, 0.35) !important;
    color: #FFFFFF !important;
}

.pb-fullscreen-top-toolbar .pb-sub-btn {
    padding: 2.5px 6px;
    font-size: 10.5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(30, 41, 59, 0.7);
    color: #CBD5E1;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.pb-fullscreen-top-toolbar .pb-sub-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #FFFFFF;
}

.pb-fullscreen-top-toolbar .pb-sub-btn.active {
    background: #10B981;
    border-color: #10B981;
    color: #FFFFFF;
    font-weight: 700;
}

.pb-fullscreen-top-toolbar .pb-toolbar-fine-tune {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.pb-fullscreen-top-toolbar .pb-fine-tune-label {
    font-size: 10px;
    color: #64748B;
    font-weight: 600;
}

.pb-fullscreen-top-toolbar .pb-fine-tune-box {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #0B0E17;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 1px 3px;
}

.pb-fullscreen-top-toolbar .pb-fine-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 3px;
    color: #CBD5E1;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.12s;
}

.pb-fullscreen-top-toolbar .pb-fine-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

.pb-fullscreen-top-toolbar .pb-fine-input {
    width: 38px;
    height: 20px;
    padding: 0 2px;
    background: transparent;
    border: none;
    outline: none;
    color: #6EE7B7;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.pb-fullscreen-top-toolbar .pb-fine-input::-webkit-outer-spin-button,
.pb-fullscreen-top-toolbar .pb-fine-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pb-fullscreen-top-toolbar .pb-fine-unit {
    font-size: 10px;
    color: #94A3B8;
    font-weight: 600;
    padding-right: 3px;
}

.pb-fullscreen-top-toolbar .pb-voice-section {
    border-bottom: none;
    padding-bottom: 0;
}

.pb-fullscreen-top-toolbar .pb-voice-select-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 100%;
}

.pb-fullscreen-top-toolbar .pb-voice-select-wrap .pb-select-dark {
    flex: 1;
    max-width: none;
    width: 100%;
}

.pb-fullscreen-top-toolbar .pb-btn-voice-preview {
    padding: 3px 7px;
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
}

.pb-fullscreen-top-toolbar .pb-select-dark {
    flex: 1;
    max-width: 130px;
    background: #1E293B;
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
}

.pb-fullscreen-top-toolbar .pb-btn-close-fs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.pb-fullscreen-top-toolbar .pb-btn-close-fs:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #FFFFFF;
    border-color: #EF4444;
}

/* 3. [준비된 사진] 카드: 사진 줄 수에 따라 세로 높이가 유동적으로 자동 늘어남 */
.pb-workspace-grid.no-editor .pb-right-sidebar-workspace #pbActivePhotosCard {
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 250px) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* 4. 사진 그리드: 4열 조밀 배치, 사진 줄 수만큼 높이 자동 적응, 화면 초과 시 내부 스크롤 */
.pb-workspace-grid.no-editor .pb-right-sidebar-workspace #activePhotosGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    align-content: start !important;
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 300px) !important;
    padding: 6px 4px !important;
}

/* ========================================================
   5. 전체화면(F11 또는 플레이어 전체화면 버튼) 시 우측 사이드바 숨김
   ======================================================== */
@media all and (display-mode: fullscreen) {
    .pb-workspace-grid.no-editor .pb-right-sidebar-workspace,
    .pb-workspace-grid.no-editor .pb-sidebar-workspace {
        display: none !important;
    }
}

body.pb-player-fullscreen-active .pb-workspace-grid.no-editor .pb-right-sidebar-workspace,
body.pb-player-fullscreen-active .pb-workspace-grid.no-editor .pb-sidebar-workspace {
    display: none !important;
}
