/**
 * SophEva Video Platform - Player & Gallery CSS
 */

/* =========================================
   1. VIDEO PLAYER CONTAINER
   ========================================= */

.svp-video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background-color: #111;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    aspect-ratio: 16 / 9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.svp-video-card__player .svp-video-player {
    border-radius: 12px 12px 0 0;
    box-shadow: none;
    margin-bottom: 0;
}

@supports not (aspect-ratio: 16 / 9) {
    .svp-video-player {
        padding-top: 56.25%;
        height: 0;
    }

    .svp-video-player>* {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.svp-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    z-index: 10;
}

/* =========================================
   2. STATUS / ERROR STATES
   ========================================= */

.svp-video-player__status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 5;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

.svp-video-player-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.95);
    color: #ff6b6b;
    font-size: 0.9rem;
    padding: 1rem;
    box-sizing: border-box;
    z-index: 5;
    text-align: center;
}

.svp-video-player__message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    z-index: 5;
}

/* =========================================
   3. PLAY BUTTON TEASER (Locked Video)
   ========================================= */

.svp-fake-play-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 5;
    cursor: pointer;
    transition: background 0.3s ease;
}

.svp-fake-play-wrapper:hover {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.45) 100%);
}

.svp-fake-play-btn {
    width: clamp(52px, 10vw, 76px);
    height: clamp(52px, 10vw, 76px);
    border-radius: 50%;
    background: rgba(156, 65, 61, 0.88);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 5px rgba(255, 255, 255, 0.12);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.svp-fake-play-btn svg {
    width: 40%;
    height: 40%;
    margin-left: 6%;
}

.svp-fake-play-wrapper:hover .svp-fake-play-btn {
    transform: scale(1.1);
    background: rgb(156, 65, 61);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 7px rgba(255, 255, 255, 0.18);
}

/* =========================================
   4. PREMIUM MODAL POPUP
   ========================================= */

.svp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.svp-modal-overlay.svp-modal-visible {
    opacity: 1;
    visibility: visible;
}

.svp-modal-content {
    background: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    max-width: 90%;
    width: 440px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
    transform: translateY(28px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    text-align: center;
    color: #fff;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.svp-modal-overlay.svp-modal-visible .svp-modal-content {
    transform: translateY(0) scale(1);
}

.svp-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
}

.svp-modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.svp-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(156, 65, 61, 0.12);
    border: 1px solid rgba(156, 65, 61, 0.25);
    margin-bottom: 1.25rem;
    color: #c97370;
}

.svp-lock-icon {
    width: 48%;
    height: 48%;
}

.svp-overlay-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.6rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.svp-overlay-text {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.93rem;
    line-height: 1.65;
    margin: 0 0 1.75rem 0;
}

.svp-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.svp-premium-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2.25rem;
    background: var(--wp--preset--color--primary, #9c413d);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    cursor: pointer;
    width: 100%;
    max-width: 260px;
    box-shadow: 0 4px 14px rgba(156, 65, 61, 0.35);
    letter-spacing: 0.01em;
}

.svp-premium-btn:hover {
    background: #8a3734;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(156, 65, 61, 0.5);
}

.svp-premium-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(156, 65, 61, 0.3);
}

.svp-premium-btn:focus {
    outline: 2px solid rgba(156, 65, 61, 0.6);
    outline-offset: 3px;
}

/* =========================================
   5. GALLERY GRID
   ========================================= */

.svp-video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
    width: 100%;
    padding: 0.5rem 0 1.5rem;
}

/* =========================================
   6. VIDEO CARD
   ========================================= */

.svp-video-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.svp-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.13);
}

.svp-video-card__player {
    width: 100%;
    flex-shrink: 0;
}

.svp-video-card__content {
    padding: 1.25rem 1.25rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.svp-video-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.svp-video-card__excerpt {
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.svp-video-card__excerpt p {
    margin: 0;
}

/* =========================================
   7. EMPTY STATE
   ========================================= */

.svp-video-gallery-empty {
    color: #9ca3af;
    font-size: 0.95rem;
    text-align: center;
    padding: 3rem 1rem;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    width: 100%;
}

/* =========================================
   8. ANIMATIONS
   ========================================= */

@keyframes svpPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

/* =========================================
   9. RESPONSIVE
   ========================================= */

@media (max-width: 640px) {
    .svp-video-gallery {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .svp-modal-content {
        padding: 2rem 1.25rem 1.5rem;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .svp-video-card,
    .svp-fake-play-btn,
    .svp-premium-btn,
    .svp-modal-content,
    .svp-modal-overlay {
        transition: none;
    }
}

/* =========================================
   10. GALLERY CARD THUMBNAIL
   ========================================= */

.svp-video-card__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
    cursor: pointer;
}

.svp-video-card__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(38px, 4vw, 50px);
    height: clamp(38px, 4vw, 50px);
    border-radius: 50%;
    background: rgba(156, 65, 61, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 0 5px rgba(255, 255, 255, 0.12);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.svp-video-card__play-btn svg {
    width: 40%;
    height: 40%;
    color: #fff;
    margin-left: 6%;
}

.svp-video-card:hover .svp-video-card__play-btn {
    transform: translate(-50%, -50%) scale(1.12);
    background: rgb(156, 65, 61);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 7px rgba(255, 255, 255, 0.18);
}

/* =========================================
   11. LIGHTBOX
   ========================================= */

.svp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000000;
    display: none;
    /* JS sets display:flex when opening */
    align-items: center;
    justify-content: center;
}

.svp-lightbox--open {
    display: flex;
}

.svp-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.svp-lightbox--open .svp-lightbox__backdrop {
    opacity: 1;
}

.svp-lightbox__inner {
    position: relative;
    z-index: 1;
    width: min(90vw, 960px);
    transform: scale(0.94) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.svp-lightbox--open .svp-lightbox__inner {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.svp-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0.75rem 0;
}

.svp-lightbox__title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.svp-lightbox__close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.svp-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.svp-lightbox__close svg {
    width: 16px;
    height: 16px;
}

.svp-lightbox__player {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}

.svp-lightbox__player .svp-video-player {
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .svp-lightbox__inner {
        width: 96vw;
    }

    .svp-lightbox__title {
        font-size: 0.95rem;
    }
}

/* =========================================
   12. ACCESSIBILITY - FOCUS STYLES
   ========================================= */

/* Gallery card keyboard focus */
.svp-video-card:focus {
    outline: none;
}

.svp-video-card:focus-visible {
    outline: 3px solid var(--wp--preset--color--primary, #9c413d);
    outline-offset: 3px;
    border-radius: 14px;
}

/* Lightbox close button focus */
.svp-lightbox__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

/* Premium modal close button focus */
.svp-modal-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

/* Skip to lightbox link (screen readers) - visually hidden until focused */
.svp-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.svp-skip-link:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: #1a1a1f;
    color: #fff;
    border-radius: 6px;
    z-index: 9999999;
    font-size: 0.9rem;
}

/* =========================================
   13. SKELETON LOADER
   ========================================= */

.svp-skeleton {
    position: absolute;
    inset: 0;
    background: #111;
    border-radius: inherit;
    overflow: hidden;
    z-index: 5;
}

.svp-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.04) 40%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.04) 60%,
            transparent 100%);
    background-size: 200% 100%;
    animation: svpSkeletonShimmer 1.8s ease-in-out infinite;
}

.svp-skeleton__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.12);
}

.svp-skeleton__icon svg {
    width: 40%;
    height: 40%;
    margin-left: 4%;
}

@keyframes svpSkeletonShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* =========================================
   14. PROGRESS UI
   ========================================= */

.svp-progress-wrapper {
    margin-top: 0.5rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
}

.svp-progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.svp-progress-bar-fill {
    height: 100%;
    background: var(--wp--preset--color--primary, #9c413d);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.svp-progress-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    /* Green */
    background: #d1fae5;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}