/**
 * manage_wow_video_player.css
 * Centralized styles for the video player modals.
 * Enforces strictly square top corners and consistent branding.
 */

.wow-vplayer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    font-family: 'Open Sans', sans-serif;
}

.wow-vplayer-modal {
    background: #000;
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease;
    /* Important for hugging */
    align-self: center;
}

/* DEFENSIVE STYLING: Force square corners at the top join */
.wow-vplayer-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
    /* Allow the flex parent to shrink below its content */
}

.wow-vplayer-title-box {
    min-width: 0;
}

.wow-vplayer-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: white !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wow-vplayer-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wow-vplayer-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wow-vplayer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.wow-vplayer-content {
    position: relative;
    width: 100%;
    background: #000;
    /* This is the divider that MUST be square */
    border-top: none;
}

.wow-vplayer-target {
    width: 100%;
    height: 100%;
    position: relative;
}

/* SIZING STRATEGY: Modal size is driven by .wow-vplayer-content (JS set pixels) */
.wow-vplayer-modal.v-landscape,
.wow-vplayer-modal.v-portrait,
.wow-vplayer-modal.v-square {
    width: fit-content;
    height: auto;
}

.wow-vplayer-content {
    display: block;
    overflow: hidden;
    background: #000;
}

.wow-vplayer-target {
    width: 100%;
    height: 100%;
    position: relative;
}

/* RE-ENFORCE SQUARE CORNERS ON PLAYER ELEMENTS */
.wow-vplayer-content,
.wow-vplayer-target,
.video-container,
.player-iframe,
video,
iframe,
.start-overlay,
.question-overlay,
.end-screen-overlay {
    border-radius: 0 !important;
}

/* Response Overlays (Matching Interests style) */
.subject-warning-banner {
    background: rgba(245, 158, 11, 0.15);
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    padding: 12px;
    margin-top: 15px;
    text-align: left;
}

.warning-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.warning-text {
    font-size: 0.9rem;
    color: #fbbf24;
    font-weight: 500;
}

.warning-subjects-list {
    font-size: 0.8rem;
    color: #fcd34d;
    opacity: 0.8;
    margin-top: 5px;
    padding-left: 28px;
}

@media (max-width: 768px) {
    .wow-vplayer-overlay {
        padding: 10px;
        align-items: center;
    }

    /* REMOVE PADDING AND MAX-WIDTH FOR PORTRAIT VIDEOS */
    .wow-vplayer-overlay.v-portrait-overlay {
        padding: 0 !important;
        background: black !important;
        /* Ensure black background */
    }

    .wow-vplayer-modal {
        background: transparent !important;
        /* No container background */
        border: none !important;
        /* No border */
        box-shadow: none !important;
        /* No shadow */
        border-radius: 12px;
        width: 100% !important;
        height: auto !important;
        max-height: 85vh;
        margin: auto;
        display: flex;
        flex-direction: column;
    }

    /* FULL VIEWPORT FOR PORTRAIT */
    .wow-vplayer-modal.v-portrait {
        width: 100vw !important;
        height: 100vh !important;
        max-height: none !important;
        max-width: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .wow-vplayer-header {
        padding: 10px 15px;
        border-radius: 12px 12px 0 0;
        background: transparent !important;
        justify-content: flex-end;
        /* Push close btn to right */
        border: none !important;
    }

    .wow-vplayer-title,
    .wow-vplayer-subtitle {
        display: none !important;
    }

    /* SQUARE HEADER FOR PORTRAIT */
    .wow-vplayer-modal.v-portrait .wow-vplayer-header {
        border-radius: 0 !important;
    }

    .wow-vplayer-content {
        aspect-ratio: 16/9;
        width: 100% !important;
    }

    /* FILL HEIGHT FOR PORTRAIT CONTENT */
    .wow-vplayer-modal.v-portrait .wow-vplayer-content {
        aspect-ratio: unset !important;
        /* Let it fill flex space */
        flex: 1;
        height: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* HIDE SPINNER COMPLETELY ON MOBILE */
    .wow-vplayer-loading {
        display: none !important;
    }

    /* TRANSPARENT BACKGROUNDS FOR "NO CONTAINER" LOOK (Default Mobile State) */
    .wow-vplayer-content,
    .wow-vplayer-target .video-container {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* RESTORE CONTEXT FOR LANDSCAPE/SQUARE VIDEOS ON MOBILE */
    .wow-vplayer-modal.v-landscape .wow-vplayer-header,
    .wow-vplayer-modal.v-square .wow-vplayer-header {
        background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        justify-content: space-between !important;
        /* Restore standard layout */
    }

    .wow-vplayer-modal.v-landscape .wow-vplayer-title,
    .wow-vplayer-modal.v-landscape .wow-vplayer-subtitle,
    .wow-vplayer-modal.v-square .wow-vplayer-title,
    .wow-vplayer-modal.v-square .wow-vplayer-subtitle {
        display: block !important;
    }

    .wow-vplayer-modal.v-landscape,
    .wow-vplayer-modal.v-square {
        background: #000 !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5) !important;
        /* Re-apply max-width logic? Or keep full width but styled? User liked purple header. keep full width. */
    }
}

/* =====================================================
   SPINNER STYLES (Ported from manage_wow_interests.css)
   ===================================================== */

.wow-vplayer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: transparent;
    pointer-events: none;
    /* Let clicks pass through if needed, though overlay handles closes */
}

.wow-vplayer-spinner-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
}

.wow-vplayer-spinner-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    padding: 0 !important;
    margin: 0 !important;
}

.wow-vplayer-loading-text {
    margin-top: 16px;
    color: #6B7280;
    font-size: 16px;
    font-weight: 500;
}