/**
 * Joyn Player Pro - YouTube Override Styles
 * YouTube 브랜딩 완전 차단
 * @version 1.0.0
 */

/* ==================== YouTube iframe 컨테이너 ==================== */

.joyn-player-youtube .joyn-player-youtube-container,
.joyn-player-youtube_live .joyn-player-youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

/* iframe 클릭 차단 (커스텀 컨트롤 사용) */
.joyn-player-youtube .joyn-player-youtube-container iframe,
.joyn-player-youtube_live .joyn-player-youtube-container iframe {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 오버레이에서만 클릭 허용 */
.joyn-player-youtube .joyn-player-overlay,
.joyn-player-youtube_live .joyn-player-overlay {
    pointer-events: auto;
}

/* ==================== YouTube 내장 UI 숨김 ==================== */

/* YouTube 로고/워터마크 숨김 */
.ytp-watermark,
.ytp-watermark-icon {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 상단 버튼들 숨김 (제목, 공유 등) */
.ytp-chrome-top,
.ytp-chrome-top-buttons,
.ytp-show-cards-title,
.ytp-title,
.ytp-title-text,
.ytp-title-link {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* YouTube 로고 클릭 영역 숨김 */
.ytp-youtube-button,
.ytp-youtube-icon {
    display: none !important;
    pointer-events: none !important;
}

/* 하단 컨트롤바 전체 숨김 */
.ytp-chrome-bottom,
.ytp-chrome-controls {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 그라데이션 오버레이 숨김 */
.ytp-gradient-bottom,
.ytp-gradient-top {
    display: none !important;
}

/* ==================== 개별 컨트롤 요소 숨김 ==================== */

/* 재생/일시정지 버튼 */
.ytp-play-button {
    display: none !important;
}

/* 볼륨 컨트롤 */
.ytp-volume-area,
.ytp-mute-button,
.ytp-volume-slider-handle,
.ytp-volume-slider {
    display: none !important;
}

/* 시간 표시 */
.ytp-time-display,
.ytp-time-current,
.ytp-time-separator,
.ytp-time-duration {
    display: none !important;
}

/* 진행 바 */
.ytp-progress-bar-container,
.ytp-progress-bar,
.ytp-progress-list,
.ytp-scrubber-container {
    display: none !important;
}

/* 자막 버튼 */
.ytp-subtitles-button,
.ytp-caption-window-container {
    display: none !important;
}

/* 설정 버튼 */
.ytp-settings-button,
.ytp-settings-menu {
    display: none !important;
}

/* 미니플레이어 버튼 */
.ytp-miniplayer-button {
    display: none !important;
}

/* 전체화면 버튼 */
.ytp-fullscreen-button {
    display: none !important;
}

/* PiP 버튼 */
.ytp-pip-button {
    display: none !important;
}

/* 챕터 */
.ytp-chapter-container,
.ytp-chapter-title {
    display: none !important;
}

/* ==================== 영상 종료 화면 숨김 ==================== */

/* 종료 화면 관련 영상 */
.ytp-endscreen-content,
.ytp-ce-element,
.ytp-ce-covering-overlay,
.ytp-ce-element-shadow,
.ytp-ce-covering-image,
.ytp-ce-expanding-image,
.ytp-ce-video,
.ytp-ce-playlist,
.ytp-ce-channel,
.ytp-ce-website,
.ytp-ce-large-round {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 더보기/추천 영상 */
.ytp-suggestion-set,
.ytp-videowall-still,
.ytp-endscreen-previous,
.ytp-endscreen-next {
    display: none !important;
}

/* 재생 버튼 오버레이 (종료 시) */
.ytp-large-play-button {
    display: none !important;
}

/* ==================== 주석/카드 숨김 ==================== */

/* 카드/주석 */
.ytp-cards-button,
.ytp-cards-button-icon,
.ytp-cards-teaser,
.ytp-ce-element,
.annotation,
.iv-card,
.iv-card-image,
.iv-click-target {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 정보 카드 */
.ytp-info-panel-preview,
.ytp-info-panel {
    display: none !important;
}

/* ==================== 광고 관련 숨김 ==================== */

/* 광고 오버레이 */
.ytp-ad-overlay-container,
.ytp-ad-text-overlay,
.ytp-ad-image-overlay {
    display: none !important;
}

/* 광고 건너뛰기 버튼 (선택적 - 필요시 표시) */
.ytp-ad-skip-button-container {
    /* display: none !important; */
}

/* 광고 정보 */
.ytp-ad-info-dialog-container {
    display: none !important;
}

/* ==================== 로딩/버퍼링 숨김 ==================== */

/* YouTube 기본 로딩 스피너 (커스텀 사용) */
.ytp-spinner,
.ytp-spinner-container {
    display: none !important;
}

/* ==================== 오류 메시지 숨김 ==================== */

/* YouTube 오류 화면 (커스텀 사용) */
.ytp-error,
.ytp-error-content,
.ytp-error-content-wrap {
    display: none !important;
}

/* ==================== 기타 UI 요소 숨김 ==================== */

/* 공유 버튼 */
.ytp-share-button,
.ytp-share-button-visible {
    display: none !important;
}

/* 더보기 버튼 */
.ytp-overflow-button,
.ytp-overflow-panel {
    display: none !important;
}

/* 키보드 네비게이션 포커스 */
.ytp-button:focus,
.ytp-button.ytp-button-focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 채널 아바타 */
.ytp-ce-channel-title,
.ytp-ce-channel-metadata {
    display: none !important;
}

/* ==================== 반응형 조정 ==================== */

/* 모바일에서 터치 오버레이 숨김 */
.ytp-touch-overlay,
.ytp-touch-overlay-highlight {
    display: none !important;
}

/* 모바일 컨트롤 */
.ytp-mobile-controls {
    display: none !important;
}

/* ==================== 추가 보안 레이어 ==================== */

/* YouTube iframe 위에 투명 오버레이 */
.joyn-player-youtube .joyn-player-container::before,
.joyn-player-youtube_live .joyn-player-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    /* 클릭 이벤트는 오버레이(.joyn-player-overlay)에서 처리 */
}

/* 커스텀 오버레이가 항상 위에 오도록 */
.joyn-player-youtube .joyn-player-overlay,
.joyn-player-youtube_live .joyn-player-overlay {
    z-index: 10;
}

/* ==================== 특수 상태 ==================== */

/* 생방송 모드에서 라이브 배지 강조 */
.joyn-player-youtube_live .joyn-player-live-badge {
    animation: joyn-live-glow 2s ease-in-out infinite;
}

@keyframes joyn-live-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    }
}

/* 전체화면에서 YouTube 요소 추가 숨김 */
.joyn-player-fullscreen .ytp-chrome-bottom,
.joyn-player-fullscreen .ytp-chrome-top,
.joyn-player-fullscreen .ytp-gradient-bottom,
.joyn-player-fullscreen .ytp-gradient-top {
    display: none !important;
    opacity: 0 !important;
}

/* ==================== 접근성 ==================== */

/* 스크린 리더용 숨김 (시각적으로만 숨김) */
.joyn-player-youtube .ytp-chrome-bottom[aria-hidden="true"],
.joyn-player-youtube_live .ytp-chrome-bottom[aria-hidden="true"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
