/**
 * Ilm LMS - Plyr Skin (Phase 1.5)
 *
 * Customizes Plyr's default look to match Ilm LMS branding.
 * Loads AFTER plyr.css.
 */

/* ============================================================
 * Container
 * ========================================================== */
.ilm-video-shell {
    margin: 0 0 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
}

.ilm-video-shell .plyr {
    border-radius: 10px;
    --plyr-color-main: #2271b1;
    --plyr-video-background: #000;
    --plyr-menu-background: rgba(20, 20, 20, 0.95);
    --plyr-menu-color: #fff;
    --plyr-menu-arrow-color: #fff;
    --plyr-menu-back-border-color: #333;
    --plyr-audio-controls-background: transparent;
}

/* ============================================================
 * Plyr base look
 * ========================================================== */
.ilm-video-shell .plyr--video {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

/* Big play button in the middle */
.ilm-video-shell .plyr__control--overlaid {
    background: rgba(34, 113, 177, 0.9);
    padding: 22px;
    border: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.ilm-video-shell .plyr__control--overlaid:hover {
    background: rgba(34, 113, 177, 1);
    transform: scale(1.06);
}

.ilm-video-shell .plyr__control--overlaid svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    left: 2px;
    position: relative;
}

/* Progress bar */
.ilm-video-shell .plyr__progress input[type=range]::-webkit-slider-thumb {
    background: #2271b1;
}

.ilm-video-shell .plyr__progress input[type=range]::-moz-range-thumb {
    background: #2271b1;
}

.ilm-video-shell .plyr__progress__buffer {
    background: rgba(255, 255, 255, 0.25);
}

/* Current time / duration */
.ilm-video-shell .plyr__time {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3px;
}

/* Control buttons — subtle glow on hover */
.ilm-video-shell .plyr__controls .plyr__control:hover {
    background: rgba(34, 113, 177, 0.9);
}

/* Volume slider */
.ilm-video-shell .plyr__volume input[type=range]::-webkit-slider-thumb {
    background: #2271b1;
}
.ilm-video-shell .plyr__volume input[type=range]::-moz-range-thumb {
    background: #2271b1;
}

/* ============================================================
 * Menu (settings, captions, speed, quality)
 * ========================================================== */
.ilm-video-shell .plyr__menu__container {
    background: rgba(20, 20, 20, 0.97);
    color: #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.ilm-video-shell .plyr__menu__container .plyr__control {
    color: #e5e7eb;
}

.ilm-video-shell .plyr__menu__container .plyr__control:hover {
    background: rgba(34, 113, 177, 0.85);
}

.ilm-video-shell .plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before {
    background: #2271b1;
}

/* ============================================================
 * Hide YouTube branding aggressively (defense in depth)
 * Plyr already covers it, but these add extra safety.
 * ========================================================== */
.ilm-video-shell .plyr__video-embed iframe {
    /* Plyr uses oversized iframe to push YouTube corner UI off-screen */
    pointer-events: auto;
}

/* Prevent any accidental YouTube logo showing through */
.ilm-video-shell .plyr__video-wrapper {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

/* ============================================================
 * Loading spinner
 * ========================================================== */
.ilm-video-shell .plyr__video-embed .plyr__control--overlaid {
    z-index: 3;
}

/* ============================================================
 * Note toolbar (below the player)
 * ========================================================== */
.ilm-video-notes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 13px;
}

.ilm-note-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #374151;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.ilm-note-add:hover { background: #4b5563; }
.ilm-note-add .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ilm-note-current-time {
    font-family: 'Courier New', monospace;
    background: #111827;
    padding: 4px 10px;
    border-radius: 4px;
    color: #9ca3af;
    letter-spacing: 0.5px;
}

/* ============================================================
 * Fullscreen adjustments
 * ========================================================== */
.ilm-video-shell .plyr--fullscreen-fallback {
    border-radius: 0;
}

/* ============================================================
 * Responsive
 * ========================================================== */
@media (max-width: 480px) {
    .ilm-video-shell {
        border-radius: 6px;
        margin: 0 -12px 16px;
    }
    .ilm-video-shell .plyr {
        border-radius: 6px;
    }
    .ilm-video-notes {
        padding: 8px 12px;
        font-size: 12px;
    }
    .ilm-note-add {
        padding: 5px 10px;
        font-size: 12px;
    }
}