﻿.panapana-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure Plyr takes full width */
.panapana-plyr-player {
    width: 100%;
}

/* Hide YouTube elements that might leak through */
.plyr__video-embed iframe {
    pointer-events: none;
    /* Critical for blocking external clicks */
}

/* Custom styling to match Tutor LMS feel */
.plyr--video {
    --plyr-color-main: #0073aa;
    /* Match Panapaná/WordPress blue */
    --plyr-video-background: #000;
}

/* Ensure captions are visible and styled nicely */
.plyr__caption {
    background: rgba(0, 0, 0, 0.7);
    font-family: 'Inter', sans-serif;
    /* Match theme font */
}

/* Custom subtitle overlay for YouTube embeds - now inside .plyr container */
.panapana-subtitle-overlay {
    position: absolute;
    bottom: 80px;
    /* Above Plyr controls */
    left: 50%;
    transform: translateX(-50%);
    max-width: 80%;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 18px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    border-radius: 4px;
    z-index: 5;
    /* Below controls but above video */
    pointer-events: none;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.panapana-subtitle-overlay:empty {
    display: none;
}

/* Adjust subtitle position when controls are hidden */
.plyr--hide-controls .panapana-subtitle-overlay {
    bottom: 20px;
}

/* Fullscreen adjustments */
.plyr--fullscreen-active .panapana-subtitle-overlay,
.plyr:fullscreen .panapana-subtitle-overlay {
    font-size: 24px;
    bottom: 100px;
    padding: 12px 24px;
}

.plyr--fullscreen-active.plyr--hide-controls .panapana-subtitle-overlay,
.plyr:fullscreen.plyr--hide-controls .panapana-subtitle-overlay {
    bottom: 40px;
}

/* Responsive subtitle sizing */
@media (max-width: 768px) {
    .panapana-subtitle-overlay {
        font-size: 14px;
        bottom: 70px;
        max-width: 90%;
        padding: 6px 12px;
    }
}

/* CC Toggle Button - Inside player, bottom-right, above controls */
.panapana-cc-toggle {
    position: absolute;
    bottom: 55px;
    /* Above the controls bar */
    right: 10px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.panapana-cc-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

/* Off state - more faded */
.panapana-cc-toggle.panapana-cc-off {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    text-decoration: line-through;
}

.panapana-cc-toggle.panapana-cc-off:hover {
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.7);
}

/* Hide when controls are hidden */
.plyr--hide-controls .panapana-cc-toggle {
    opacity: 0;
    pointer-events: none;
}

/* Fullscreen adjustments */
.plyr--fullscreen-active .panapana-cc-toggle,
.plyr:fullscreen .panapana-cc-toggle {
    bottom: 70px;
    right: 15px;
    font-size: 14px;
    padding: 6px 12px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .panapana-cc-toggle {
        bottom: 50px;
        right: 8px;
        font-size: 11px;
        padding: 3px 6px;
    }
}