/* ProAiMax enhanced video player */
.pam-video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    font-family: 'Inter', 'Rethink Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.pam-video-player.pam-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    width: 100vw;
    height: 100vh;
}

.pam-video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.pam-video-player.pam-youtube .pam-video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.pam-video-center-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.pam-video-player.pam-paused .pam-video-center-play,
.pam-video-player.pam-idle .pam-video-center-play {
    opacity: 1;
}

.pam-video-center-play i {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #003a5b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    padding-left: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s;
}

.pam-video-center-play:hover i {
    transform: scale(1.08);
}

.pam-video-resume {
    position: absolute;
    left: 16px;
    bottom: 72px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(15, 39, 66, 0.92);
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.pam-video-resume button {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pam-video-resume .pam-resume-yes {
    background: #008a8a;
    color: #fff;
}

.pam-video-resume .pam-resume-no {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.pam-video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 8px 12px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
    opacity: 1;
    transition: opacity 0.25s;
}

.pam-video-player.pam-hide-controls .pam-video-controls {
    opacity: 0;
    pointer-events: none;
}

.pam-video-progress-wrap {
    position: relative;
    height: 18px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 4px;
}

.pam-video-progress-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    overflow: hidden;
}

.pam-video-progress-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 999px;
}

.pam-video-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: #008a8a;
    border-radius: 999px;
}

.pam-video-progress-wrap:hover .pam-video-progress-track {
    height: 6px;
}

.pam-video-progress-input {
    position: relative;
    width: 100%;
    height: 18px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.pam-video-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pam-video-btn {
    background: transparent;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background 0.15s;
}

.pam-video-btn:hover,
.pam-video-btn:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

.pam-video-time {
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    white-space: nowrap;
}

.pam-video-spacer {
    flex: 1;
    min-width: 8px;
}

.pam-video-speed-wrap {
    position: relative;
}

.pam-video-speed-btn {
    min-width: 44px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pam-video-speed-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 88px;
    background: rgba(15, 39, 66, 0.96);
    border-radius: 10px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pam-video-speed-menu.open {
    display: flex;
}

.pam-video-speed-menu button {
    border: none;
    background: transparent;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.pam-video-speed-menu button:hover,
.pam-video-speed-menu button.active {
    background: rgba(0, 138, 138, 0.45);
}

.pam-video-volume-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pam-video-volume {
    width: 72px;
    height: 4px;
    accent-color: #008a8a;
    cursor: pointer;
}

.pam-video-history-wrap {
    position: relative;
}

.pam-video-history-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: min(320px, 85vw);
    max-height: 280px;
    overflow-y: auto;
    background: rgba(15, 39, 66, 0.97);
    border-radius: 12px;
    padding: 8px;
    display: none;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.pam-video-history-menu.open {
    display: block;
}

.pam-video-history-menu h4 {
    margin: 4px 8px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.pam-video-history-item {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: #fff;
    text-align: left;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.pam-video-history-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.pam-video-history-item strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.pam-video-history-item small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.pam-video-history-empty {
    padding: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    text-align: center;
}

.pam-video-error {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    z-index: 6;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.pam-video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    z-index: 5;
    font-size: 14px;
    gap: 10px;
}

@media (max-width: 640px) {
    .pam-video-volume {
        width: 56px;
    }

    .pam-video-time {
        min-width: 76px;
        font-size: 11px;
    }

    .pam-video-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Host pages */
.lesson-video-wrapper,
#mainVideoPlayer {
    min-height: 360px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-wrapper-fixed .pam-video-player {
    min-height: 100%;
}
