/* NETBOARD Movie Archive - Shorts Viewer Styles */

:root {
    --panel-white: rgba(255, 255, 255, 0.96);
    --panel-white-strong: #ffffff;
    --panel-border: rgba(255, 255, 255, 0.92);
    --panel-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    --panel-text: #1f2937;
    --panel-muted: #6b7280;
    --button-bg: rgba(255, 255, 255, 0.98);
    --button-hover: #f8fafc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    height: 100vh;
}

.shorts-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.shorts-wrapper {
    width: 100%;
    height: 100%;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

/* 스크롤바 스타일 */
.shorts-wrapper::-webkit-scrollbar {
    width: 8px;
}

.shorts-wrapper::-webkit-scrollbar-track {
    background: #e9ecef;
}

.shorts-wrapper::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.shorts-wrapper::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.video-item {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    border-bottom: 1px solid #e9ecef;
}

.video-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: #f1f3f5;
}

.video-frame video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 가로형 비디오 (landscape) */
.video-frame.landscape {
    width: 70%;
    height: auto;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
}

.video-frame.landscape video {
    width: 100%;
    height: 100%;
}

/* 세로형 비디오 (portrait) */
.video-frame.portrait {
    width: auto;
    height: 85%;
    max-height: 95vh;
    aspect-ratio: 9 / 16;
}

.video-frame.portrait video {
    width: 100%;
    height: 100%;
}

/* 컨트롤 패널 */
.video-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--panel-white);
    border: 1px solid var(--panel-border);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(14px);
    z-index: 10;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--button-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    color: var(--panel-text);
    box-shadow: 0 4px 14px rgba(148, 163, 184, 0.15);
}

.control-btn:hover {
    background: var(--button-hover);
    color: #111827;
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--panel-white-strong);
    color: #111827;
}

.video-title {
    position: absolute;
    top: 30px;
    left: 30px;
    background: var(--panel-white);
    border: 1px solid var(--panel-border);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--panel-text);
    font-weight: 500;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(14px);
}

.video-counter {
    position: absolute;
    top: 30px;
    right: 30px;
    background: var(--panel-white);
    border: 1px solid var(--panel-border);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--panel-text);
    font-weight: 500;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(14px);
}

.scroll-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: bounce 2s infinite;
    pointer-events: none;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    color: #adb5bd;
}

.scroll-indicator.hide {
    display: none;
}

/* 정보 패널 */
.info-panel {
    position: absolute;
    top: 100px;
    right: 30px;
    background: var(--panel-white);
    border: 1px solid var(--panel-border);
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--panel-text);
    box-shadow: var(--panel-shadow);
    max-width: 200px;
    backdrop-filter: blur(14px);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-panel.show {
    display: block;
    opacity: 1;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--panel-muted);
}

.info-value {
    font-weight: 600;
    color: #212529;
    text-align: right;
}

/* 홈 버튼 */
.home-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    background: var(--panel-white);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--panel-text);
    transition: all 0.3s ease;
    box-shadow: var(--panel-shadow);
    z-index: 20;
    text-decoration: none;
    letter-spacing: 0.5px;
    backdrop-filter: blur(14px);
}

.home-btn:hover {
    background: var(--panel-white-strong);
    color: #111827;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    transform: scale(1.05);
}

.home-btn:active {
    transform: scale(0.95);
}

.video-frame.loading {
    background: linear-gradient(90deg, #e9ecef 25%, #f1f3f5 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 에러 메시지 */
.error-message {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border-radius: 8px;
    margin: 20px;
}

/* 빈 상태 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 20px;
    color: #6c757d;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 18px;
    font-weight: 500;
}

.audio-unlock-overlay {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    z-index: 40;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    padding: 14px 22px;
    background: var(--panel-white-strong);
    color: var(--panel-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--panel-shadow);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .video-frame.landscape {
        width: 95%;
    }

    .video-frame.portrait {
        height: 90%;
    }

    .video-controls {
        bottom: 15px;
        padding: 12px 20px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .video-title {
        top: 15px;
        left: 15px;
        font-size: 12px;
        max-width: 250px;
    }

    .video-counter {
        top: 15px;
        right: 15px;
        font-size: 12px;
    }

    .audio-unlock-overlay {
        bottom: 90px;
        width: calc(100% - 32px);
        max-width: 360px;
        text-align: center;
    }
}
