/**
 * BBF Gallery - Video CSS
 * Styles for video thumbnails and consent
 * 
 * @author BBFDesign
 * @version 2.0.0
 */

/* ===================================
   VIDEO THUMBNAIL
   =================================== */

.bbf-thumbnail.is-video {
    position: relative;
}

.bbf-thumbnail.is-video .video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
}

.bbf-thumbnail.is-video .video-play-overlay i {
    color: #fff;
    font-size: 24px;
    margin-left: 3px;
    /* Optical centering */
}

.bbf-thumbnail.is-video:hover .video-play-overlay {
    background: var(--bbf-accent-color, #007bff);
    transform: translate(-50%, -50%) scale(1.1);
}

.bbf-thumbnail.is-video .video-type-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 10px;
    color: #fff;
    pointer-events: none;
}

/* ===================================
   VIDEO CONSENT OVERLAY
   =================================== */

.bbf-thumbnail.consent-required {
    position: relative;
    opacity: 0.6;
}

.video-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: inherit;
}

.video-consent-overlay .consent-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-consent-overlay .consent-icon i {
    color: #fff;
    font-size: 16px;
}

.video-consent-overlay .consent-text {
    color: #fff;
    font-size: 11px;
    text-align: center;
    font-weight: 500;
}

/* ===================================
   VIDEO CONSENT MODAL
   =================================== */

.bbf-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bbf-consent-modal.show {
    opacity: 1;
    visibility: visible;
}

.bbf-consent-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.bbf-consent-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.bbf-consent-modal.show .bbf-consent-content {
    transform: scale(1);
}

.bbf-consent-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.bbf-consent-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.bbf-consent-body {
    padding: 20px;
}

.bbf-consent-body p {
    margin: 0 0 20px;
    color: #666;
    line-height: 1.6;
}

.bbf-consent-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.bbf-consent-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bbf-consent-actions .btn-secondary {
    background: #f8f9fa;
    color: #666;
}

.bbf-consent-actions .btn-secondary:hover {
    background: #e2e6ea;
}

.bbf-consent-actions .btn-primary {
    background: var(--bbf-accent-color, #007bff);
    color: #fff;
}

.bbf-consent-actions .btn-primary:hover {
    background: #0056b3;
}

/* ===================================
   VIDEO PLACEHOLDER (no consent)
   =================================== */

.video-consent-placeholder {
    width: 100%;
    min-height: 400px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.video-consent-placeholder .consent-message {
    text-align: center;
    max-width: 400px;
}

.video-consent-placeholder .consent-message i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.video-consent-placeholder .consent-message p {
    margin: 0 0 20px;
    color: #666;
    line-height: 1.6;
}

.video-consent-placeholder .consent-message button {
    padding: 12px 24px;
    background: var(--bbf-accent-color, #007bff);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-consent-placeholder .consent-message button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* ===================================
   VIDEO PLAYER
   =================================== */

.bbf-video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    max-height: 80vh;
}

/* In lightbox */
.gslide-media .bbf-video-player {
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */

@media (max-width: 576px) {
    .bbf-consent-content {
        width: 95%;
    }

    .bbf-consent-header {
        padding: 16px;
    }

    .bbf-consent-body {
        padding: 16px;
    }

    .bbf-consent-actions {
        flex-direction: column;
    }

    .bbf-consent-actions .btn {
        width: 100%;
    }

    .video-consent-placeholder {
        min-height: 300px;
        padding: 30px 20px;
    }

    .video-consent-placeholder .consent-message i {
        font-size: 36px;
    }
}

/* ===================================
   DARK MODE
   =================================== */

@media (prefers-color-scheme: dark) {
    .bbf-consent-content {
        background: #2a2a2a;
        color: #fff;
    }

    .bbf-consent-header {
        border-bottom-color: #444;
    }

    .bbf-consent-header h3 {
        color: #fff;
    }

    .bbf-consent-body p {
        color: #ccc;
    }

    .video-consent-placeholder {
        background: #2a2a2a;
        border-color: #444;
    }

    .video-consent-placeholder .consent-message p {
        color: #ccc;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.bbf-consent-actions .btn:focus {
    outline: 2px solid var(--bbf-accent-color, #007bff);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .bbf-consent-modal {
        background: rgba(0, 0, 0, 0.95);
    }

    .bbf-consent-content {
        border: 3px solid #fff;
    }

    .video-consent-overlay {
        background: rgba(0, 0, 0, 0.95);
        border: 2px solid #fff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .bbf-consent-modal,
    .bbf-consent-content,
    .bbf-thumbnail.is-video .video-play-overlay,
    .bbf-consent-actions .btn {
        transition: none;
    }
}

/* ── Video Accessibility ── */

.bbf-thumbnail.is-video:focus-visible {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bbf-video-player,
    .video-consent-overlay {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
