/**
 * Estilos do Frontend - YouTube Shorts & Reels
 *
 * @package Shorts_YT_Reels
 */

/* ===== CONTAINER PRINCIPAL ===== */
.shorts-yt-container-wrapper {
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 12px;
}

/* ===== SLIDER ===== */
.shorts-yt-slider {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding-bottom: 15px;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Modo Carrossel (1 linha) */
.shorts-yt-slider.is-carousel {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shorts-yt-slider.is-carousel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Modo Grid (Múltiplas linhas) */
.shorts-yt-slider.is-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shorts-yt-slider.is-grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ===== CARDS ===== */
.shorts-yt-card {
    flex: 0 0 var(--shorts-width);
    width: var(--shorts-width);
    min-width: var(--shorts-width);
    max-width: var(--shorts-width);
    height: var(--shorts-height);
    scroll-snap-align: start;
    cursor: pointer;
    overflow: hidden;
    background: #1a1a1a;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin: 15px 0 0;
    box-sizing: border-box;
    border-radius: var(--shorts-border-radius, 12px);
    border-width: var(--shorts-border-width, 0);
    border-style: solid;
    border-color: var(--shorts-border-color, #158ecb);
}

.shorts-yt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

/* Card em destaque */
.shorts-yt-card.is-featured {
    border-color: #00c6ff;
    box-shadow: 0 0 20px rgba(0, 198, 255, 0.4);
}

.shorts-yt-card.is-featured:hover {
    box-shadow: 0 0 30px rgba(0, 198, 255, 0.6);
}

/* Card widescreen (vídeos horizontais) */
.shorts-yt-card.is-widescreen {
    flex: 0 0 calc(var(--shorts-height) * 1.777);
    width: calc(var(--shorts-height) * 1.777);
    min-width: calc(var(--shorts-height) * 1.777);
    max-width: calc(var(--shorts-height) * 1.777);
}

/* ===== THUMBNAIL ===== */
.shorts-yt-thumbnail {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: var(--shorts-border-radius, 12px);
    transition: transform 0.3s ease;
}

.shorts-yt-card:hover .shorts-yt-thumbnail {
    transform: scale(1.05);
}

/* ===== OVERLAY ===== */
.shorts-yt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--shorts-overlay-color, #000000) !important;
    border-radius: var(--shorts-border-radius, 12px);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.shorts-yt-card:hover .shorts-yt-overlay {
    opacity: var(--shorts-overlay-opacity, 0.4) !important;
}

/* ===== BOTÃO PLAY ===== */
.shorts-yt-play-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff0000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shorts-yt-card:hover .shorts-yt-play-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.shorts-yt-play-icon.is-instagram-icon {
    color: #e1306c;
}

.shorts-yt-play-icon svg {
    width: 24px;
    height: 24px;
}

/* ===== META (TÍTULO) ===== */
.shorts-yt-meta {
    padding: 10px 12px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.shorts-yt-title {
    color: #fff;
    margin: 0;
    font-size: var(--shorts-title-font-size, 14px);
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ===== SETAS DE NAVEGAÇÃO - CORREÇÃO FINAL ===== */
/* ===== SETAS DE NAVEGAÇÃO ===== */
.shorts-yt-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: auto;
    height: 40px;
    padding: 0px 9px;
    border-radius: 50%;
    cursor: pointer;
    
    /* Tira o !important e define o padrão como NONE */
    display: none; 
    align-items: center;
    justify-content: center;    
    z-index: 9999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.shorts-yt-carousel-nav.has-overflow {
    display: flex !important; 
}

.shorts-yt-container-wrapper:hover .shorts-yt-carousel-nav.has-overflow,
.shorts-yt-container-wrapper .shorts-yt-card:hover ~ .shorts-yt-carousel-nav.has-overflow {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.shorts-yt-carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.shorts-yt-carousel-nav.prev-carousel {
    left: 10px;
}

.shorts-yt-carousel-nav.next-carousel {
    right: 10px;
}

.shorts-yt-carousel-nav svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .shorts-yt-card {
        flex: 0 0 var(--shorts-width-mobile);
        width: var(--shorts-width-mobile);
        min-width: var(--shorts-width-mobile);
        max-width: var(--shorts-width-mobile);
        height: var(--shorts-height-mobile);
    }
    
    .shorts-yt-card.is-widescreen {
        flex: 0 0 calc(var(--shorts-height-mobile) * 1.777);
        width: calc(var(--shorts-height-mobile) * 1.777);
        min-width: calc(var(--shorts-height-mobile) * 1.777);
        max-width: calc(var(--shorts-height-mobile) * 1.777);
    }
    
    .shorts-yt-title {
        font-size: var(--shorts-title-font-size-mobile, 11px);
    }
    
    .shorts-yt-play-icon {
        width: 36px;
        height: 36px;
    }
    
    .shorts-yt-play-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .shorts-yt-carousel-nav {
        display: none !important;
    }
    
    .shorts-yt-slider {
        gap: 10px;
        padding-bottom: 10px;
    }
}

/* ===== MOBILE PEQUENO ===== */
@media (max-width: 480px) {
    .shorts-yt-card {
        margin: 10px 0 0;
    }
    
    .shorts-yt-slider {
        gap: 8px;
        padding-bottom: 8px;
    }
}

/* ===== LIGHTBOX ===== */
.shorts-yt-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.shorts-yt-lightbox.is-visible {
    display: flex;
    animation: shortsFadeIn 0.3s ease;
}

.shorts-yt-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--shorts-overlay-color, #000000) !important;
    opacity: var(--shorts-overlay-opacity, 0.95) !important; 
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.EmbedVideo {
    position: relative !important;
}

._aand {
    padding-bottom: 0 !important;
}

.shorts-yt-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 420px;
    height: 85vh;
    max-height: 750px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    z-index: 2;
}

.shorts-yt-lightbox.is-widescreen-lightbox .shorts-yt-lightbox-content {
    max-width: 800px;
    height: auto;
    max-height: 500px;
    aspect-ratio: 16/9;
}

.shorts-yt-iframe-container {
    width: 100%;
    height: calc(100% - 80px);
}

.shorts-yt-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.shorts-yt-lightbox.is-visible .shorts-yt-iframe-container iframe {
    opacity: 1;
}

.shorts-yt-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 10;
    font-weight: 300;
    line-height: 1;
}

.shorts-yt-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

/* Navegação do Lightbox */
.shorts-yt-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 10000000;
    user-select: none;
}

.shorts-yt-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.shorts-yt-nav-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.shorts-yt-nav-btn.prev-btn {
    left: 5%;
}

.shorts-yt-nav-btn.next-btn {
    right: 5%;
}

/* Compartilhamento */
.shorts-yt-share-container {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
}

.shorts-yt-share-pill {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 6px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.shorts-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.shorts-share-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    color: #fff;
}

.shorts-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ===== ANIMAÇÕES ===== */
@keyframes shortsFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
.shorts-yt-slider::-webkit-scrollbar {
    height: 4px;
}

.shorts-yt-slider::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.shorts-yt-slider::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.shorts-yt-slider::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ===== CARDS ===== */
.shorts-yt-card {
    flex: 0 0 var(--shorts-width);
    width: var(--shorts-width);
    min-width: var(--shorts-width);
    max-width: var(--shorts-width);
    height: var(--shorts-height);
    scroll-snap-align: start;
    cursor: pointer;
    overflow: hidden;
    background: #1a1a1a;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin: 15px 0 0;
    box-sizing: border-box;
    border-radius: var(--shorts-border-radius, 12px);
    border-width: var(--shorts-border-width, 0);
    border-style: solid;
    border-color: var(--shorts-border-color, #158ecb);
}

/* Vídeos normais (16:9) - bordas menos arredondadas */
.shorts-yt-card.is-widescreen {
    border-radius: 12px !important; /* Valor fixo para widescreen */
}

.shorts-yt-card.is-widescreen .shorts-yt-thumbnail,
.shorts-yt-card.is-widescreen .shorts-yt-overlay,
.shorts-yt-card.is-widescreen .shorts-yt-meta {
    border-radius: 12px !important;
}

/* Widescreen meta - só arredonda embaixo */
.shorts-yt-card.is-widescreen .shorts-yt-meta {
    border-radius: 0 0 12px 12px !important;
}