/* ==========================================
   MODAL ESTILO NETFLIX
   VERSÃO 3.0 - BOTÕES VERMELHOS BROTHER LUCAS
   ========================================== */

.netflix-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.netflix-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.netflix-modal.active .modal-container {
    transform: scale(1);
    opacity: 1;
}

/* ==========================================
   🔥 ANIMAÇÃO PULSE VERMELHO 🔥
   ========================================== */

@keyframes pulseRedBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==========================================
   🔥 BOTÃO FECHAR (X) - AGORA NO FOOTER DIREITO VERMELHO! 🔥
   ========================================== */

.modal-close {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    width: 50px;
    height: 50px;
    background: rgba(255, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 0, 0, 1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 0, 0, 0.8);
}

.modal-close:active {
    transform: scale(0.95);
}

/* ==========================================
   🔥 BOTÃO FULLSCREEN (ENTRAR) - TOPO DIREITO VERMELHO! 🔥
   ========================================== */

.modal-fullscreen-enter-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.5);
    animation: pulseRedBtn 2s infinite;
}

.modal-fullscreen-enter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.7);
}

/* 🔥 BOTÃO SAIR FULLSCREEN - FICA DENTRO DO WRAPPER */
.modal-fullscreen-exit-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100000;
    width: 50px;
    height: 50px;
    background: rgba(255, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: none; /* 🔥 ESCONDIDO POR PADRÃO */
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-fullscreen-exit-btn:hover {
    background: rgba(255, 0, 0, 1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 0, 0, 0.8);
}

.modal-fullscreen-exit-btn:active {
    transform: scale(0.95);
}

/* ==========================================
   🔥 BOTÃO FIXO TOPO DIREITO (DESKTOP >800px)
   ========================================== */

.modal-btn-fixed-top {
    position: absolute;
    top: 20px;
    right: 80px;
    z-index: 10;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-btn-fixed-top:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.modal-btn-fixed-top.hidden {
    display: none !important;
}

@media (min-width: 800px) {
    .modal-btn-fixed-top:not(.hidden) {
        display: flex;
    }
    
    /* Ajusta posição do botão fullscreen quando tem botão fixo */
    .modal-fullscreen-enter-btn {
        right: 200px;
    }
}

.modal-content {
    overflow-y: auto;
    max-height: 90vh;
    scrollbar-width: thin;
    scrollbar-color: #4a4a4a #181818;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #181818;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

/* ==========================================
   MEDIA (VÍDEO/IMAGEM/VIMEO)
   ========================================== */

.modal-media-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

/* 🔥 Quando tem dual-video, wrapper se adapta ao vídeo */
.modal-media-wrapper:has(.mdl-video-wrap) {
    aspect-ratio: unset;
    overflow: visible;
}

.modal-media {
    width: 100%;
    height: 100%;
}

.modal-media video,
.modal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vimeo-player-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    padding-bottom: 56.25%;
}

.vimeo-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, #181818, transparent);
    pointer-events: none;
}

.modal-media .vimeo-player-wrapper ~ .modal-gradient {
    display: none;
}

/* ==========================================
   INFORMAÇÕES
   ========================================== */

.modal-info {
    padding: 30px;
    padding-top: 10px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.modal-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    flex: 1;
}

.modal-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.modal-author {
    color: #888;
    font-size: 14px;
    margin: 0 0 20px 0;
}

/* ==========================================
   BOTÕES DE AÇÃO
   ========================================== */

.modal-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.modal-btn-primary,
.modal-btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.modal-btn-primary {
    background: #fff;
    color: #000;
    flex: 1;
    justify-content: center;
    min-width: 180px;
}

.modal-btn-primary:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: scale(1.05);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    min-width: 50px;
    justify-content: center;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* ==========================================
   DESCRIÇÃO E DETALHES
   ========================================== */

.modal-description {
    margin-bottom: 30px;
}

.modal-description h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.modal-description p {
    color: #ccc;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.modal-details {
    display: grid;
    gap: 16px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.modal-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    color: #888;
    font-size: 14px;
}

.detail-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */

.toast-notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    transition: bottom 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    bottom: 40px;
}

/* ==========================================
   EFEITO HOVER NETFLIX (DESKTOP)
   ========================================== */

@media (min-width: 768px) {
    .card-video {
        transition: transform 0.3s ease, z-index 0s 0.3s;
    }
    
    .card-video:hover {
        transform: scale(1.15);
        z-index: 100;
        transition: transform 0.3s ease, z-index 0s;
    }
    
    .gallery-videos {
        padding: 20px;
    }
}

/* ==========================================
   MOBILE RESPONSIVO
   ========================================== */

@media (max-width: 799px) {
    .modal-btn-fixed-top {
        display: none !important;
    }
    
    /* 🔥 Fullscreen fica no topo direito sozinho */
    .modal-fullscreen-enter-btn {
        right: 20px;
    }
}

@media (max-width: 767px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .modal-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn-primary,
    .modal-btn-secondary {
        width: 100%;
    }
    
    /* 🔥 Botão fechar no footer direito - mobile */
    .modal-close {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    /* 🔥 Botão fullscreen no topo direito - mobile */
    .modal-fullscreen-enter-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .modal-fullscreen-exit-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .modal-details {
        padding: 16px;
    }
    
    .vimeo-player-wrapper {
        padding-bottom: 56.25%;
    }
}

@media (max-width: 480px) {
    .modal-title {
        font-size: 20px;
    }
    
    .modal-description h3 {
        font-size: 16px;
    }
    
    .modal-description p {
        font-size: 14px;
    }
}

/* ==========================================
   🔥🔥🔥 FULLSCREEN NO WRAPPER 🔥🔥🔥
   ========================================== */

/* 🔥 WRAPPER EM FULLSCREEN */
.modal-media-wrapper:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: black !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-media-wrapper:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: black !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-media-wrapper:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: black !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 🔥 VÍDEO/IFRAME ESTICA PRA TELA TODA */
.modal-media-wrapper:fullscreen .modal-media,
.modal-media-wrapper:fullscreen .vimeo-player-wrapper,
.modal-media-wrapper:fullscreen .vimeo-iframe,
.modal-media-wrapper:fullscreen video,
.modal-media-wrapper:fullscreen img {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

.modal-media-wrapper:-webkit-full-screen .modal-media,
.modal-media-wrapper:-webkit-full-screen .vimeo-player-wrapper,
.modal-media-wrapper:-webkit-full-screen .vimeo-iframe,
.modal-media-wrapper:-webkit-full-screen video,
.modal-media-wrapper:-webkit-full-screen img {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

.modal-media-wrapper:-moz-full-screen .modal-media,
.modal-media-wrapper:-moz-full-screen .vimeo-player-wrapper,
.modal-media-wrapper:-moz-full-screen .vimeo-iframe,
.modal-media-wrapper:-moz-full-screen video,
.modal-media-wrapper:-moz-full-screen img {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

/* 🔥 ESCONDE GRADIENTE NO FULLSCREEN */
.modal-media-wrapper:fullscreen .modal-gradient,
.modal-media-wrapper:-webkit-full-screen .modal-gradient,
.modal-media-wrapper:-moz-full-screen .modal-gradient {
    display: none !important;
}

/* 🔥 BOTÃO DE SAIR APARECE QUANDO WRAPPER TÁ EM FULLSCREEN */
.modal-media-wrapper:fullscreen .modal-fullscreen-exit-btn,
.modal-media-wrapper:-webkit-full-screen .modal-fullscreen-exit-btn,
.modal-media-wrapper:-moz-full-screen .modal-fullscreen-exit-btn {
    display: flex !important;
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 100000 !important;
}

/* 🔥 REMOVE padding-bottom do vimeo wrapper no fullscreen */
.modal-media-wrapper:fullscreen .vimeo-player-wrapper,
.modal-media-wrapper:-webkit-full-screen .vimeo-player-wrapper,
.modal-media-wrapper:-moz-full-screen .vimeo-player-wrapper {
    padding-bottom: 0 !important;
    position: relative !important;
}

/* ==========================================
   🔥 CLASSE video-fullscreen-mode (fallback)
   ========================================== */

.netflix-modal.video-fullscreen-mode .modal-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    z-index: 99999 !important;
}

.netflix-modal.video-fullscreen-mode .modal-media-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
}

.netflix-modal.video-fullscreen-mode .modal-info {
    display: none !important;
}

.netflix-modal.video-fullscreen-mode .modal-close,
.netflix-modal.video-fullscreen-mode .modal-fullscreen-enter-btn,
.netflix-modal.video-fullscreen-mode .modal-btn-fixed-top {
    display: none !important;
}

.netflix-modal.video-fullscreen-mode .modal-fullscreen-exit-btn {
    display: flex !important;
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 100000 !important;
}

.netflix-modal.video-fullscreen-mode .vimeo-iframe {
    width: 100vw !important;
    height: 100vh !important;
}

/* ==============================================
   🔥🔥🔥 DUAL VIDEO NO MODAL - CLASSES MDL- 🔥🔥🔥
   Desktop: mdl-video-dk | Mobile: mdl-video-mb
   ============================================== */

.mdl-video-wrap {
    position: relative;
    width: 100%;
    background: #000;
}

/* 🔥 DESKTOP - mostra dk, esconde mb */
.modal-media .mdl-video-wrap .mdl-video-dk {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    cursor: pointer;
}

.modal-media .mdl-video-wrap .mdl-video-mb {
    display: none !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    cursor: pointer;
}

/* 🔥 MOBILE - troca */
@media (max-width: 768px) {
    .modal-media .mdl-video-wrap .mdl-video-dk {
        display: none !important;
    }
    .modal-media .mdl-video-wrap .mdl-video-mb {
        display: block !important;
    }
}

/* 🔥 BOTÃO PAUSE/PLAY FLUTUANTE NO MODAL */
.mdl-pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90px;
    height: 90px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 🔥 FULLSCREEN - vídeo contain pra ver tudo */
#modalMediaWrapper:fullscreen .mdl-video-dk,
#modalMediaWrapper:fullscreen .mdl-video-mb,
#modalMediaWrapper:-webkit-full-screen .mdl-video-dk,
#modalMediaWrapper:-webkit-full-screen .mdl-video-mb {
    max-height: 100vh;
    object-fit: contain;
}

/* ==============================================
   🔥🔥🔥 V4.5 - NAVEGAÇÃO SETAS + SWIPE + TÍTULO OVERLAY 🔥🔥🔥
   Adicionado em cima do original sem mudar NADA
   ============================================== */

/* 🔥 TÍTULO OVERLAY EM CIMA DO VÍDEO */
.modal-video-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 16px 20px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .modal-video-title-overlay { font-size: 15px; padding: 12px 16px; }
}
@media (min-width: 769px) {
    .modal-video-title-overlay { font-size: 22px; padding: 20px 30px; }
}

/* Esconde no fullscreen */
.modal-media-wrapper:fullscreen .modal-video-title-overlay,
.modal-media-wrapper:-webkit-full-screen .modal-video-title-overlay,
.modal-media-wrapper:-moz-full-screen .modal-video-title-overlay {
    display: none !important;
}
.netflix-modal.video-fullscreen-mode .modal-video-title-overlay {
    display: none !important;
}

/* 🔥 SETAS DE NAVEGAÇÃO */
.modal-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 50px;
    height: 80px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    opacity: 0.6;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-container:hover .modal-nav-arrow { opacity: 1; }
.modal-nav-arrow:hover { background: rgba(255, 0, 0, 0.6); color: rgba(255, 255, 255, 1); }
.modal-nav-arrow:active { transform: translateY(-50%) scale(0.9); }
.modal-nav-prev { left: 0; border-radius: 0 8px 8px 0; }
.modal-nav-next { right: 0; border-radius: 8px 0 0 8px; }
.modal-nav-arrow.nav-hidden { opacity: 0 !important; pointer-events: none !important; }

@media (max-width: 768px) {
    .modal-nav-arrow { opacity: 0.7; width: 44px; height: 70px; font-size: 22px; }
}

/* Esconde setas no fullscreen */
.netflix-modal.video-fullscreen-mode .modal-nav-arrow,
.netflix-modal.video-fullscreen-mode .modal-nav-dots {
    display: none !important;
}

/* 🔥 BOLINHAS INDICADORAS */
.modal-nav-dots {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.modal-container:hover .modal-nav-dots { opacity: 1; }
@media (max-width: 768px) { .modal-nav-dots { opacity: 0.6; bottom: 65px; } }

.modal-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}
.modal-nav-dot.active {
    background: rgba(255, 255, 255, 0.9);
    width: 18px;
    border-radius: 3px;
}

/* 🔥 TRANSIÇÃO DE CONTEÚDO */
.modal-content.modal-transitioning {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.modal-content.modal-transition-left { transform: translateX(-30px); }
.modal-content.modal-transition-enter {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
