/* 커스텀 비디오 플레이어 스타일 */
.custom-video-container {
    position: relative;
    width: 100%;
    max-width: 670px;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.custom-video-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
/* 영상 제목 오버레이 */
.video-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding: 15px 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.custom-video-container.show-controls .video-title-overlay {
    opacity: 1;
}

.video-title-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

/* 모바일 반응형 */
@media screen and (max-width: 768px) {
    .video-title-overlay {
        padding: 12px 15px;
    }
    
    .video-title-text {
        font-size: 14px;
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 480px) {
    .video-title-overlay {
        padding: 10px 12px;
    }
    
    .video-title-text {
        font-size: 13px;
    }
}
/* 전체화면 시 비디오 중앙 정렬 및 비율 유지 */
.custom-video-container:-webkit-full-screen,
.custom-video-container:-moz-full-screen,
.custom-video-container:fullscreen {
    position: relative;
    overflow: hidden;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    border-radius: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
}

.custom-video-container:-webkit-full-screen video,
.custom-video-container:-moz-full-screen video,
.custom-video-container:fullscreen video {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
}

.custom-video-container {
    position: relative;
    width: 100%;
    max-width: 670px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.custom-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 컨트롤 바 */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.custom-video-container.show-controls .video-controls {
    opacity: 1;
}

/* 프로그레스 바 */
.progress-container {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    margin-bottom: 8px;
    border-radius: 2px;
    position: relative;
}

/* 버퍼링 바 (다운로드된 부분) */
.buffered-bar {
    position: absolute;
    height: 100%;
    background: rgba(255,255,255,0.5);
    width: 0%;
    border-radius: 2px;
    z-index: 1;
}

.progress-bar {
    height: 100%;
    background: #ff0000;
    width: 0%;
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover .progress-bar::after,
.progress-container.dragging .progress-bar::after {
    opacity: 1;
}

/* 타임 프리뷰 툴팁 */
.time-tooltip {
    position: absolute;
    bottom: 15px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 3;
}

.time-tooltip.show {
    opacity: 1;
}

/* 모바일용 타임 툴팁 스타일 */
@media screen and (max-width: 768px) {
    .time-tooltip {
        bottom: 25px;
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* 컨트롤 버튼 레이아웃 */
.controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 버튼 공통 스타일 */
.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* 볼륨 컨트롤 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider {
    width: 0;
    height: 4px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: width 0.3s ease;
}

.volume-control:hover .volume-slider {
    width: 60px;
}

.volume-level {
    height: 100%;
    background: white;
    width: 100%;
    border-radius: 2px;
}

/* 시간 표시 */
.time-display {
    color: white;
    font-size: 13px;
    font-family: monospace;
    user-select: none;
}

/* 설정 메뉴 */
.settings-menu {
    position: absolute;
    bottom: 50px;
    right: 10px;
    background: rgba(28, 28, 28, 0.95);
    border-radius: 6px;
    padding: 8px 0;
    min-width: 200px;
    display: none;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.settings-menu.active {
    display: block;
}

.settings-item {
    padding: 10px 16px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.settings-item:hover {
    background: rgba(255,255,255,0.1);
}

.settings-item-label {
    font-size: 14px;
}

.settings-item-value {
    font-size: 13px;
    color: #aaa;
}

/* 재생 속도 서브메뉴 */
.speed-submenu {
    position: absolute;
    bottom: 0;
    right: 100%;
    background: rgba(28, 28, 28, 0.95);
    border-radius: 6px;
    padding: 8px 0;
    min-width: 150px;
    display: none;
    margin-right: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.speed-submenu.active {
    display: block;
}

.speed-option {
    padding: 10px 16px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    position: relative;
}

.speed-option:hover {
    background: rgba(255,255,255,0.1);
}

.speed-option.active {
    color: #ff0000;
}

.speed-option.active::before {
    content: '✓';
    position: absolute;
    left: 8px;
}

/* 로딩 스피너 */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 5;
}

.loading-spinner.active {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 센터 재생 버튼 */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}

.center-play-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.center-play-btn svg {
    width: 40px;
    height: 40px;
    fill: white;
    margin-left: 5px;
}

.center-play-btn.hidden {
    display: none;
}

/* 모바일용 센터 재생/일시정지 버튼 */
.mobile-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-center-play.show {
    opacity: 1;
}

.mobile-center-play svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.mobile-center-play svg.play-icon {
    margin-left: 5px;
}

/* 모바일용 화면 중앙 재생/정지 버튼 */
.mobile-center-control-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 8;
    opacity: 0;
}

.custom-video-container.show-controls .mobile-center-control-btn {
    opacity: 1;
}

.mobile-center-control-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
    background: rgba(0, 0, 0, 0.8);
}

.mobile-center-control-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.mobile-center-control-btn svg:first-child {
    margin-left: 3px;
}

/* 더블탭 피드백 스타일 */
.double-tap-feedback {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 15;
}

.double-tap-feedback.left {
    left: 15%;
}

.double-tap-feedback.right {
    right: 15%;
}

.double-tap-feedback.show {
    opacity: 1;
    animation: scaleUp 0.3s ease;
}

.double-tap-feedback svg {
    width: 48px;
    height: 48px;
    fill: white;
    margin-bottom: 4px;
}

.double-tap-feedback span {
    font-size: 14px;
    font-weight: bold;
}

@keyframes scaleUp {
    0% {
        transform: translateY(-50%) scale(0.8);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

/* 반응형 */
@media screen and (max-width: 768px) {
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .time-display {
        font-size: 11px;
    }
    
    .controls-left,
    .controls-right {
        gap: 5px;
    }
    
    .volume-slider {
        display: none;
    }
    
    /* 모바일에서 센터 재생 버튼 표시 */
    .mobile-center-play {
        display: flex;
    }
    
    /* 모바일 화면 중앙 재생/정지 버튼 표시 */
    .mobile-center-control-btn {
        display: flex;
    }
    
    /* 모바일에서 프로그레스 바 터치 영역 확대 */
    .progress-container {
        padding: 4px 0;
        margin-bottom: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
    }
    
    /* 프로그레스 바 내부 요소들 중앙 정렬 */
    .buffered-bar,
    .progress-bar {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left: 0;
    }
    
    .time-tooltip {
        bottom: 35px;
    }
    
    .progress-bar::after {
        width: 14px;
        height: 14px;
    }
}

/* 작은 모바일 화면 (480px 이하) */
@media (max-width: 480px) {
    .double-tap-feedback {
        width: 80px;
        height: 80px;
    }
    
    .double-tap-feedback.left {
        left: 10%;
    }
    
    .double-tap-feedback.right {
        right: 10%;
    }
    
    .double-tap-feedback svg {
        width: 36px;
        height: 36px;
    }
    
    .double-tap-feedback span {
        font-size: 12px;
    }
    
    .center-play-btn {
        width: 70px;
        height: 70px;
    }
    
    .center-play-btn svg {
        width: 35px;
        height: 35px;
    }
    
    .mobile-center-play {
        width: 70px;
        height: 70px;
    }
    
    .mobile-center-play svg {
        width: 35px;
        height: 35px;
    }
    
    .mobile-center-control-btn {
        width: 56px;
        height: 56px;
    }
    
    .mobile-center-control-btn svg {
        width: 28px;
        height: 28px;
    }
}