/* ===== ESTILOS PARA VÍDEOS DA COMUNIDADE NO FRONTEND ===== */

/* Container principal dos vídeos */
.cafe-videos-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Grid de cards de vídeos */
.cafe-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Card individual do vídeo */
.cafe-video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.cafe-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Container da foto de capa */
.cafe-video-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.cafe-video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cafe-video-card:hover .cafe-video-cover img {
    transform: scale(1.05);
}

/* Ícone de play sobre a capa */
.cafe-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 115, 170, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cafe-play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid #fff;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

.cafe-video-card:hover .cafe-play-icon {
    background: rgba(0, 115, 170, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Conteúdo do card */
.cafe-video-content {
    padding: 20px;
}

.cafe-video-title {
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cafe-video-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cafe-video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.cafe-video-category {
    background: var(--wp--preset--color--primary, #0073aa);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.cafe-video-duration {
    font-weight: 500;
}

/* Botão de download se disponível */
.cafe-video-download-btn {
    margin-top: 15px;
    padding: 8px 16px;
    background: var(--wp--preset--color--secondary, #28a745);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.cafe-video-download-btn:hover {
    background: var(--wp--preset--color--secondary-hover, #218838);
    color: #fff;
}

.cafe-video-download-btn::before {
    content: '⬇';
    font-size: 16px;
}

/* Modal do vídeo - ESTILOS ATUALIZADOS */
.cafe-video-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
}

.cafe-video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cafe-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px; /* Mais compacto */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from { 
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.cafe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cafe-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cafe-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
}

.cafe-modal-close:hover {
    background: #e1e1e1;
    color: #23282d;
}

.cafe-modal-video {
    padding: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.cafe-video-embed {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

.cafe-video-embed iframe {
    display: block;
    width: 100%;
    height: 450px; /* Altura fixa mais compacta */
    border: none;
}

.cafe-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e1e1e1;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cafe-modal-description {
    color: #666;
    line-height: 1.5;
    margin: 0 0 12px 0;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cafe-modal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Botões de ação no modal */
.cafe-video-download-btn {
    padding: 8px 16px;
    background: var(--wp--preset--color--secondary, #28a745);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cafe-video-download-btn:hover {
    background: var(--wp--preset--color--secondary-hover, #218838);
    color: #fff;
}

.cafe-share-btn {
    padding: 8px 16px;
    background: var(--wp--preset--color--primary, #0073aa);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cafe-share-btn:hover {
    background: var(--wp--preset--color--primary-hover, #005a87);
    color: #fff;
}

/* Player protegido no modal - ATUALIZADO */
.ypm-playlist-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.ypm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(0,0,0,0.9);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
}

.ypm-header-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.ypm-header h2 {
    color: #fff;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.proteger-video {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    background: #000;
}

.proteger-video iframe {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Camadas de proteção ATUALIZADAS - menos intrusivas */
.proteger-video .protege-topo-direita {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px; /* Reduzido */
    height: 45px; /* Reduzido */
    z-index: 10;
    cursor: not-allowed;
    background: transparent;
    pointer-events: auto;
}

.proteger-video .protege-botao-youtube {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 180px; /* Reduzido */
    height: 40px; /* Reduzido */
    z-index: 10;
    cursor: not-allowed;
    background: transparent;
    pointer-events: auto;
}

/* Badge de conteúdo exclusivo */
.proteger-video::after {
    content: 'Conteúdo Exclusivo';
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(229,9,20,0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 15;
    pointer-events: none;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .cafe-modal-content {
        width: 95vw;
        max-width: 700px;
    }
    
    .cafe-video-embed iframe,
    .proteger-video {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .cafe-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .cafe-modal-content {
        width: 95vw;
        max-width: none;
        margin: 10px;
    }
    
    .cafe-modal-header,
    .cafe-modal-footer {
        padding: 12px 15px;
    }
    
    .cafe-modal-title {
        font-size: 16px;
    }
    
    .cafe-video-embed iframe,
    .proteger-video {
        height: 350px;
    }
    
    .cafe-video-cover {
        height: 180px;
    }
    
    .cafe-play-icon {
        width: 50px;
        height: 50px;
    }
    
    .cafe-play-icon::before {
        border-left: 16px solid #fff;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
    }
    
    .proteger-video .protege-topo-direita {
        width: 120px;
        height: 40px;
    }
    
    .proteger-video .protege-botao-youtube {
        width: 150px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .cafe-videos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cafe-video-cover {
        height: 160px;
    }
    
    .cafe-video-content {
        padding: 15px;
    }
    
    .cafe-video-title {
        font-size: 16px;
    }
    
    .cafe-video-modal {
        padding: 10px;
    }
    
    .cafe-modal-content {
        margin: 5px;
    }
    
    .cafe-video-embed iframe,
    .proteger-video {
        height: 250px;
    }
    
    .cafe-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cafe-video-download-btn,
    .cafe-share-btn {
        text-align: center;
        justify-content: center;
    }
    
    .proteger-video .protege-topo-direita {
        width: 100px;
        height: 35px;
    }
    
    .proteger-video .protege-botao-youtube {
        width: 130px;
        height: 30px;
    }
}

/* Estado quando modal está aberto */
body.modal-open {
    overflow: hidden;
}

/* ===== ESTILOS PARA COMENTÁRIOS NO MODAL ===== */
