/**
 * Video Player Wrapper + Mobile Optimizations
 * 영상스트리밍 V2 테마 - Plyr 기본 디자인 + 모바일 최적화
 * wrapper 컨테이너 스타일링 + 모바일 터치 최적화
 */

/* ==========================================================================
   비디오 플레이어 래퍼만 스타일링 - Plyr는 완전 기본값 사용
   ========================================================================== */

.video-player-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   반응형 디자인 - wrapper만 조정
   ========================================================================== */

@media (max-width: 1024px) {
    .video-player-wrapper {
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .video-player-wrapper {
        max-height: 60vh;
        border-radius: 8px;
        box-shadow: 
            0 10px 15px -3px rgba(0, 0, 0, 0.1),
            0 4px 6px -2px rgba(0, 0, 0, 0.05);
        /* 모바일에서 터치 스크롤 개선 */
        overflow: hidden;
        touch-action: auto;
        /* 모바일 전용 추가 스타일 */
        position: relative;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* 모바일에서 비디오 영역 최적화 */
    .video-player-wrapper .plyr {
        border-radius: 8px;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .video-player-wrapper {
        max-height: 50vh;
        border-radius: 6px;
    }
}

/* ==========================================================================
   다크 모드 최적화 - wrapper만
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .video-player-wrapper {
        box-shadow: 
            0 20px 25px -5px rgba(0, 0, 0, 0.3),
            0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }
}

/* ==========================================================================
   비디오 컨테이너 완전 채움 설정
   ========================================================================== */

/* 비디오 원본 전체를 보여주도록 설정 (사용자 요구사항 반영) */
.plyr video {
    object-fit: contain;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Plyr 플레이어가 컨테이너를 완전히 사용하도록 */
.plyr {
    width: 100%;
    height: 100%;
    background: #000;
}

/* 비디오 여백 영역도 검은색으로 통일 */
.video-player-wrapper {
    background: #000;
}

/* ==========================================================================
   모바일 터치 최적화 - 사용자 요구사항 반영
   ========================================================================== */

/* 모바일에서 터치 영역 개선 - 사용자 요구사항 반영 */
@media (max-width: 768px) {
    /* 중앙 재생 버튼 강화 - 작동 문제 해결 */
    .plyr__control--overlaid {
        min-height: 90px !important;
        min-width: 90px !important;
        background: rgba(0, 0, 0, 0.8) !important;
        border: 3px solid rgba(255, 255, 255, 0.9) !important;
        border-radius: 50% !important;
        z-index: 999 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .plyr__control--overlaid:hover,
    .plyr__control--overlaid:focus,
    .plyr__control--overlaid:active {
        background: rgba(59, 130, 246, 0.9) !important;
        border-color: white !important;
        /* transform scale은 모바일에서 위치 이동 문제를 일으키므로 제거 */
    }
    
    /* 모바일 컨트롤바 레이아웃 최적화 */
    .plyr__controls {
        padding: 8px 12px !important;
        gap: 8px !important;
        background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 100%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        border-radius: 0 !important;
    }
    
    .plyr__control {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 8px !important;
        flex-shrink: 0 !important;
        border-radius: 6px !important;
    }
    
    /* 컨트롤바 재생버튼 왼쪽 공백 제거 - 최소한의 수정 */
    .plyr__control[data-plyr="play"] {
        margin-left: 0 !important;
    }
    
    /* 프로그레스바 최대한 길게 - 재생 버튼 다음 위치 */
    .plyr__progress {
        flex: 1 !important;
        margin: 0 8px !important;
        min-width: 120px !important;
        max-width: none !important;
    }
    
    .plyr__progress input[type="range"] {
        height: 8px !important;
        background: transparent !important;
        width: 100% !important;
    }
    
    .plyr__progress input[type="range"]::-webkit-slider-thumb {
        height: 20px !important;
        width: 20px !important;
        border-radius: 50% !important;
        background: #3b82f6 !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
        cursor: pointer !important;
    }
    
    .plyr__progress input[type="range"]::-moz-range-thumb {
        height: 20px !important;
        width: 20px !important;
        border-radius: 50% !important;
        background: #3b82f6 !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
    }
    
    .plyr__control[data-plyr="mute"] {
        position: relative !important;
        flex-shrink: 0 !important;
    }
    
    .plyr__volume {
        position: relative !important;
        flex-shrink: 0 !important;
    }
    
    .plyr__control[data-plyr="fullscreen"] {
        background: rgba(59, 130, 246, 0.1) !important;
        flex-shrink: 0 !important;
    }
    
    /* 볼륨 컨트롤 사용자 요구사항 - 클릭시 조절바 표시 */
    .plyr__volume {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .plyr__volume input[type="range"] {
        position: absolute !important;
        bottom: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) rotate(-90deg) !important;
        width: 80px !important;
        height: 6px !important;
        margin-bottom: 45px !important;
        background: rgba(0,0,0,0.9) !important;
        border-radius: 20px !important;
        padding: 10px !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        z-index: 1000 !important;
        pointer-events: none !important;
    }
    
    .plyr__volume.plyr__volume--pressed input[type="range"] {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .plyr__volume input[type="range"]::-webkit-slider-thumb {
        height: 16px !important;
        width: 16px !important;
        background: #3b82f6 !important;
        border-radius: 50% !important;
        border: 1px solid white !important;
    }
    
    /* 불필요한 컨트롤 숨김 - 사용자 요구사항 */
    .plyr__time,
    .plyr__control[data-plyr="restart"],
    .plyr__control[data-plyr="rewind"],
    .plyr__control[data-plyr="fast-forward"],
    .plyr__control[data-plyr="captions"],
    .plyr__control[data-plyr="settings"],
    .plyr__control[data-plyr="pip"],
    .plyr__control[data-plyr="airplay"] {
        display: none !important;
    }
}

/* 작은 모바일 화면 (480px 이하) 최적화 */
@media (max-width: 480px) {
    .plyr__control {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 6px !important;
    }
    
    .plyr__control--overlaid {
        min-height: 70px !important;
        min-width: 70px !important;
    }
    
    .plyr__controls {
        padding: 6px 8px !important;
        gap: 4px !important;
    }
    
    .plyr__progress {
        margin: 0 8px !important;
        min-width: 100px !important;
    }
    
    .plyr__progress input[type="range"] {
        height: 6px !important;
    }
    
    .plyr__progress input[type="range"]::-webkit-slider-thumb {
        height: 18px !important;
        width: 18px !important;
    }
    
    .plyr__volume input[type="range"] {
        width: 70px !important;
        margin-bottom: 40px !important;
    }
}

/* 터치 디바이스 공통 최적화 */
@media (pointer: coarse) {
    .plyr__control {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 10px !important;
        touch-action: manipulation !important;
    }
    
    .plyr__control:active {
        background: rgba(59, 130, 246, 0.2) !important;
        transform: scale(0.95) !important;
        transition: all 0.1s ease !important;
    }
    
    .plyr__tooltip {
        display: none !important;
    }
    
    /* 터치 스크롤 최적화 */
    .plyr {
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
}

/* iOS 전용 최적화 */
@supports (-webkit-touch-callout: none) {
    .plyr {
        -webkit-user-select: none !important;
        user-select: none !important;
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: transparent !important;
        /* iOS에서 터치 스크롤 개선 */
        -webkit-overflow-scrolling: touch !important;
    }
    
    .plyr__control {
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1) !important;
    }
    
    .plyr__control--overlaid {
        /* iOS에서 중앙 재생 버튼 강화 */
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3) !important;
        cursor: pointer !important;
    }
    
    .plyr__progress input[type="range"] {
        -webkit-appearance: none !important;
        background: transparent !important;
        /* iOS에서 진행바 터치 반응성 개선 */
        touch-action: manipulation !important;
    }
    
    .plyr__volume input[type="range"] {
        -webkit-appearance: none !important;
        /* iOS에서 볼륨 슬라이더 개선 */
        touch-action: manipulation !important;
    }
    
    /* iOS Safari에서 비디오 컨트롤 개선 */
    @media (max-width: 768px) {
        .plyr video {
            /* iOS에서 인라인 재생 보장 */
            -webkit-playsinline: true !important;
            /* iOS에서 비디오 터치 개선 */
            touch-action: manipulation !important;
        }
    }
}

/* Android 전용 최적화 */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (pointer: coarse) {
    .plyr__control {
        transition: all 0.1s ease !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2) !important;
    }
    
    .plyr__control:active {
        background-color: rgba(59, 130, 246, 0.2) !important;
        transform: scale(0.95) !important;
    }
    
    .plyr__control--overlaid:active {
        background: rgba(59, 130, 246, 0.8) !important;
        /* transform scale 제거 - 모바일에서 위치 이동 문제 방지 */
    }
    
    /* Android Chrome에서 볼륨 슬라이더 개선 */
    .plyr__volume input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none !important;
        appearance: none !important;
    }
}

/* 가로/세로 모드 대응 - 갤럭시 노트20 등 고해상도 모바일 포함 */
@media screen and (orientation: landscape) and (max-width: 1024px) and (max-height: 768px) {
    /* 가로 모드에서는 높이 제한을 뷰포트 전체 높이로 설정 */
    .video-player-wrapper {
        max-height: 100vh !important;
        height: 100vh !important;
        /* 가로 모드에서는 화면에 꽉 차므로 radius와 shadow를 제거하는 것이 자연스러움 */
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* 가로 모드에서 컨트롤 컴팩트화 */
    .plyr__controls {
        padding: 4px 8px !important;
        gap: 4px !important;
    }
    
    .plyr__control {
        min-height: 36px !important;
        min-width: 36px !important;
        padding: 4px !important;
    }
    
    .plyr__control--overlaid {
        min-height: 60px !important;
        min-width: 60px !important;
    }
    
    .plyr__progress {
        margin: 0 6px !important;
    }
    
    /* 가로 모드에서 볼륨 조절바 위치와 크기 최적화 */
    .plyr__volume input[type="range"] {
        width: 50px !important;
        margin-bottom: 25px !important;
        transform: translateX(-50%) rotate(-90deg) !important;
        transform-origin: center !important;
    }
    
    /* 갤럭시 노트 20 가로모드 (915x412) 전용 최적화 */
    @media screen and (min-width: 900px) and (max-width: 920px) and (max-height: 420px) {
        .plyr__volume input[type="range"] {
            width: 40px !important;
            margin-bottom: 20px !important;
            padding: 5px !important;
        }
        
        .plyr__volume {
            margin-right: 4px !important;
        }
        
        /* 갤럭시 노트 20 전체화면에서 seek 컨트롤 위치 조정 */
        .plyr.plyr--fullscreen-active .mobile-seek-controls {
            top: 40% !important; /* 중앙(50%)보다 위로 - 화면 높이 412px 고려 */
            transform: translate(-50%, -50%) !important; /* 중앙 정렬 보장 */
        }
        
        /* 갤럭시 노트 20에서 seek 버튼 크기 미세 조정 */
        .mobile-seek-btn {
            min-width: 42px !important;
            min-height: 42px !important;
        }
        
        .mobile-seek-btn.mobile-seek-play {
            min-width: 56px !important;
            min-height: 56px !important;
        }
    }
}

/* 더블 탭 방지 및 선택 방지 */
.plyr * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* 입력 요소는 선택 가능하게 */
.plyr input,
.plyr textarea {
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    touch-action: manipulation !important;
}

/* 모바일에서 비디오 영역 터치 최적화 */
@media (max-width: 768px) {
    .plyr__poster,
    .plyr video {
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    /* 모바일에서 전체화면 버튼 강조 */
    .plyr__control[data-plyr="fullscreen"] {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2)) !important;
        border: 1px solid rgba(59, 130, 246, 0.3) !important;
    }
    
    .plyr__control[data-plyr="fullscreen"]:hover,
    .plyr__control[data-plyr="fullscreen"]:focus {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.3)) !important;
        border-color: rgba(59, 130, 246, 0.5) !important;
    }
}

/* 
   object-fit: contain 사용으로 동영상 원본 전체를 표시
   여백은 검은색 배경으로 자연스럽게 처리
*/

/* ==========================================================================
   모바일 Seek 컨트롤 오버레이 (모바일에서만 표시)
   ========================================================================== */

/* 모바일 seek 컨트롤 컨테이너 */
.mobile-seek-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none; /* 기본적으로 숨김 - 미디어 쿼리에서 모바일만 display: flex */
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10000; /* Plyr 전체화면 요소들보다 높게 */
    opacity: 1; /* 모바일에서 표시될 때는 바로 보이도록 */
    visibility: visible; /* 모바일에서 표시될 때는 바로 보이도록 */
    transition: all 0.3s ease;
    pointer-events: auto; /* 모바일에서 표시될 때는 바로 클릭 가능하도록 */
}

/* 데스크톱에서는 완전히 숨김 - 갤럭시 노트 20 가로모드(915px) 예외 처리 */
@media (min-width: 769px) and (min-height: 500px) {
    .mobile-seek-controls {
        display: none !important;
    }
}

/* 갤럭시 노트 20과 같은 고해상도 모바일 가로모드는 모바일로 처리 */
@media (min-width: 769px) and (max-height: 450px) and (orientation: landscape) {
    .mobile-seek-controls {
        display: flex; /* !important 제거 - JavaScript 제어 허용 */
    }
    
    /* 가로모드에서도 숨김이 우선 적용되도록 */
    .mobile-seek-controls.hide {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        display: none !important; /* 가로모드에서도 완전히 숨김 */
    }
    
    /* 가로모드에서 표시 상태 */
    .mobile-seek-controls.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        display: flex !important;
    }
}

/* 모바일에서만 표시 */
@media (max-width: 768px) {
    .mobile-seek-controls {
        display: flex; /* !important 제거로 JavaScript 제어 허용 */
    }
    
    /* JavaScript에서 숨김 제어할 때 강력하게 적용 */
    .mobile-seek-controls.hide {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* JavaScript에서 명시적으로 표시할 때 사용 */
    .mobile-seek-controls.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    /* 전체화면에서 CSS가 완전 제어 - Plyr 컨트롤 상태와 자동 동기화 */
    .plyr.plyr--fullscreen-active .mobile-seek-controls {
        z-index: 10001 !important;
        display: flex !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    /* 전체화면에서 Plyr 컨트롤이 숨겨지면 seek 컨트롤도 자동 숨김 */
    .plyr.plyr--fullscreen-active:not(.plyr--hide-controls) .mobile-seek-controls {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .plyr.plyr--fullscreen-active.plyr--hide-controls .mobile-seek-controls {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* 전체화면 모드 위치 조정 (표시/숨김은 MutationObserver가 제어) */
    .mobile-seek-controls.fullscreen-forced {
        z-index: 10002 !important; /* 다른 모든 요소보다 위에 */
        display: flex; /* !important 제거 - MutationObserver가 제어 */
    }
    
    /* 전체화면에서도 숨김이 우선 적용되도록 */
    .mobile-seek-controls.fullscreen-forced.hide {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    
    /* 전체화면에서 표시 상태 */
    .mobile-seek-controls.fullscreen-forced.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    /* 갤럭시 노트 20 전체화면에서 강제 모드 추가 조정 */
    @media screen and (min-width: 900px) and (max-width: 920px) and (max-height: 420px) {
        .plyr.plyr--fullscreen-active .mobile-seek-controls.fullscreen-forced {
            top: 40% !important;
            transform: translate(-50%, -50%) !important;
        }
    }
}

/* 개별 seek 버튼 */
.mobile-seek-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    /* 터치 이벤트 충돌 방지를 위한 명확한 설정 */
    touch-action: manipulation;
    pointer-events: auto;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
}


.mobile-seek-btn:hover,
.mobile-seek-btn:focus {
    background: rgba(59, 130, 246, 0.8);
    border-color: white;
    transform: scale(1.05);
}

.mobile-seek-btn:active {
    background: rgba(59, 130, 246, 0.9);
    transform: scale(0.95);
}

.mobile-seek-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    pointer-events: none;
}

/* 중앙 재생 버튼은 더 크게 */
.mobile-seek-btn.mobile-seek-play {
    min-width: 80px;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.8);
    border-width: 3px;
}

.mobile-seek-btn.mobile-seek-play svg {
    width: 36px;
    height: 36px;
}

.mobile-seek-btn.mobile-seek-play:hover,
.mobile-seek-btn.mobile-seek-play:focus {
    background: rgba(59, 130, 246, 0.9);
}

/* 재생/일시정지 아이콘 전환 */
.mobile-seek-btn.mobile-seek-play .play-icon {
    display: block;
}

.mobile-seek-btn.mobile-seek-play .pause-icon {
    display: none;
}

.mobile-seek-btn.mobile-seek-play.playing .play-icon {
    display: none;
}

.mobile-seek-btn.mobile-seek-play.playing .pause-icon {
    display: block;
}

/* seek 피드백 애니메이션 */
.mobile-seek-btn.seeking {
    background: rgba(59, 130, 246, 0.9) !important;
    transform: scale(1.1);
    transition: all 0.1s ease;
}

.mobile-seek-btn.seeking svg {
    transform: scale(1.1);
}

/* 작은 모바일 화면 (480px 이하) 최적화 */
@media (max-width: 480px) {
    .mobile-seek-controls {
        gap: 15px;
    }
    
    .mobile-seek-btn {
        min-width: 50px;
        min-height: 50px;
    }
    
    .mobile-seek-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .mobile-seek-btn.mobile-seek-play {
        min-width: 70px;
        min-height: 70px;
    }
    
    .mobile-seek-btn.mobile-seek-play svg {
        width: 32px;
        height: 32px;
    }
}

/* 가로 모드 최적화 - 갤럭시 노트20(915px) 포함한 모든 모바일 가로 모드 */
@media screen and (orientation: landscape) and (max-width: 1024px) and (max-height: 768px) {
    .mobile-seek-controls {
        gap: 12px;
        /* 가로 모드에서는 크기만 조정, 표시/숨김은 Plyr에 위임 */
    }
    
    .mobile-seek-btn {
        min-width: 45px;
        min-height: 45px;
    }
    
    .mobile-seek-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .mobile-seek-btn.mobile-seek-play {
        min-width: 60px;
        min-height: 60px;
    }
    
    .mobile-seek-btn.mobile-seek-play svg {
        width: 28px;
        height: 28px;
    }
}

/* 터치 디바이스 최적화 */
@media (pointer: coarse) and (max-width: 768px) {
    .mobile-seek-btn {
        min-width: 56px;
        min-height: 56px;
        /* touch-action은 위에서 이미 설정됨 - 중복 제거 */
    }
    
    .mobile-seek-btn:active {
        background: rgba(59, 130, 246, 0.2);
        transform: scale(0.95);
        transition: all 0.1s ease;
    }
}

/* iOS 전용 최적화 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .mobile-seek-btn {
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
            cursor: pointer;
        }
    }
}

/* Android 전용 최적화 */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (pointer: coarse) and (max-width: 768px) {
    .mobile-seek-btn {
        transition: all 0.1s ease;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }

    .mobile-seek-btn:active {
        background-color: rgba(59, 130, 246, 0.2);
        transform: scale(0.95);
    }
}

/* ==========================================================================
   Pre-roll 영상 광고 스타일
   ========================================================================== */

/* 광고 컨테이너 */
.preroll-ad-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    pointer-events: none;
}

/* 클릭 가능 오버레이 (광고 영역 전체) */
.ad-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 60px); /* 하단 컨트롤 제외 */
    cursor: pointer;
    z-index: 50;
    pointer-events: all;
    background: transparent;
}

/* 안내 메시지 */
.ad-info-message {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
    text-align: center;
}

/* 스킵 버튼 (비활성 상태) */
#ad-skip-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    user-select: none;
}

/* 스킵 버튼 (활성 상태) */
#ad-skip-button.ad-skip-enabled {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

#ad-skip-button.ad-skip-enabled:hover {
    background: rgba(37, 99, 235, 1);
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(59, 130, 246, 0.4);
}

#ad-skip-button.ad-skip-enabled:active {
    transform: translateY(0);
}

/* 카운트다운 숫자 강조 */
#ad-countdown {
    font-weight: 700;
    color: #ffffff;
}

/* ==========================================================================
   모바일 최적화 (광고 UI)
   ========================================================================== */

@media (max-width: 768px) {
    .ad-info-message {
        top: 15px;
        left: 15px;
        right: 15px;
        font-size: 13px;
        padding: 8px 14px;
    }

    #ad-skip-button {
        bottom: 15px;
        right: 15px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .ad-info-message {
        top: 10px;
        left: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }

    #ad-skip-button {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* ==========================================================================
   광고 로딩 애니메이션
   ========================================================================== */

@keyframes adPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.ad-loading {
    animation: adPulse 2s ease-in-out infinite;
}