/* shorts-watch.css - Modernized Layout
   Refatorado para Tokyo Neon Nights Design System
*/

/* Inherit variables from style.css */

body.shorts-page {
    overflow: hidden;
    background: var(--bg-void);
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-mono);
}

body.shorts-page .page-shell {
    padding: 0;
}

body.shorts-page .page-frame {
    background: transparent;
}

body.shorts-page .layout-stack {
    gap: 0;
}

.shorts-watch-shell {
    padding: 0;
    margin: 0;
    min-height: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none !important;
    transform: none !important;
    perspective: none !important;
    contain: none !important;
}

/* Main Container */
.shorts-player-container {
    position: fixed;
    top: var(--header-height, 60px);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height, 60px));
    background: transparent;
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 0;
}

/* Sidebars for Desktop Ads */
.desktop-ad-sidebar {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-05);
    z-index: 910;
}

.desktop-ad-sidebar.left {
    align-items: flex-end;
    padding-right: var(--space-07);
}

.desktop-ad-sidebar.right {
    align-items: flex-start;
    padding-left: var(--space-07);
}

/* Central Video Wrapper (9:16 Aspect Ratio) */
.video-wrapper {
    position: relative;
    height: calc(100vh - var(--header-height, 60px));
    width: min(100%, calc((100vh - var(--header-height, 60px)) * 9 / 16));
    max-height: none;
    aspect-ratio: 9 / 16;
    background: #000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
    border-left: 1px solid var(--border-default);
    border-right: 1px solid var(--border-default);
}

/* Ensure video fills wrapper */
#youtube-player {
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: cover;
}

/* Overlay for controls */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.4) 0%,
            transparent 20%,
            transparent 80%,
            rgba(0, 0, 0, 0.8) 100%);
}

/* Actions (Favorite, etc) */
.video-actions {
    position: absolute;
    right: var(--space-03);
    bottom: 180px;
    display: flex;
    flex-direction: column;
    gap: var(--space-04);
    align-items: center;
    pointer-events: auto;
    z-index: 1100;
}

.action-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: var(--space-02);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    justify-content: center;
    transition: all var(--transition-base);
    backdrop-filter: blur(4px);
}

.action-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px var(--neon-pink-glow);
    animation: neon-pulse 2s infinite;
}

.action-btn .count {
    font-size: 0.7rem;
    position: absolute;
    bottom: -20px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: var(--font-weight-bold);
}

.btn-favorite.active svg {
    fill: var(--neon-pink);
    stroke: var(--neon-pink);
    filter: drop-shadow(0 0 8px var(--neon-pink));
    animation: neon-pulse 2s infinite;
}

/* Mobile Ad Container (Inside Video) */
#ad-container-mobile {
    position: absolute;
    left: 12px;
    right: 60px;
    /* Aproximado do botão Action (Favoritos) */
    bottom: 90px;
    pointer-events: auto;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Container Flex Vertical: Ad em cima, Avaliar em baixo */
.ad-action-container {
    display: flex;
    flex-direction: column;
    /* Stack vertical */
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

/* Botão avaliar abaixo */
.ad-action-container .ad-btn {
    order: 2;
    /* Fica depois do bubble */
}

.ad-bubble {
    background: var(--bg-surface-opacity, rgba(20, 20, 20, 0.9));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    flex: 1;
    width: 100%;
    max-width: 100%;
    /* Permitir crescer até o container */
}

.mobile-ad-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--neon-purple, #b026ff);
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.ad-bubble-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ad-bubble-info .ad-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary, #fff);
    line-height: 1.2;
}

.ad-bubble-info .ad-price {
    font-size: 0.8rem;
    color: var(--neon-green, #00ff7f);
    font-weight: bold;
}


.mobile-ad-image-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    overflow: visible;
    /* Garante que badges negativos apareçam */
}

.ad-thumb {
    width: 100%;
    /* Fixado para preencher o wrapper */
    height: 100%;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.ad-badges-container {
    position: absolute;
    top: -16px;
    /* Subir mais para não sobrepor texto/titulo */
    left: -6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
    pointer-events: none;
    /* Deixar clique passar para a imagem */
}

.ad-badge-overlay {
    font-size: 0.55rem;
    /* Micro texto para caber */
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    line-height: 1.2;
}

.ad-badge-overlay.promo {
    background: var(--neon-red);
    color: white;
}

.ad-badge-overlay.coupon {
    background: var(--neon-cyan);
    color: black;
    pointer-events: auto;
    /* Reabilita cliques (pai tem pointer-events: none) */
    cursor: copy;
    /* Indica que é copiável */
}

.ad-bubble-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Desktop Ad Card Styles */
.desktop-ad-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-05);
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: var(--space-04);
    align-items: center;
    margin-bottom: var(--space-05);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base);
}

.desktop-ad-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-pink);
    box-shadow: var(--shadow-glow-pink);
}

.desktop .ad-badge-overlay {
    font-size: 0.55rem;
    font-weight: 800;
    /* Extra bold */
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    line-height: 1.2;
    animation: badge-pulse 2s ease-in-out infinite;
    pointer-events: auto;
    /* Garante cliques no desktop também */
}

/* Promoção: Gold/Orange Gradient */
.ad-badge-overlay.promo {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border: 1px solid #FFD700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Cupom: Green Gradient */
/* Cupom: Green Gradient */
.ad-badge-overlay.coupon {
    background: linear-gradient(135deg, #00FF7F 0%, #32CD32 100%);
    color: #000;
    border: 1px solid #00FF7F;
    box-shadow: 0 0 5px rgba(0, 255, 127, 0.6), 0 0 10px rgba(0, 255, 127, 0.4);
    pointer-events: auto;
    cursor: copy;
}

/* Animação de pulsação oficial */
@keyframes badge-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.desktop-ad-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}

.desktop-ad-image-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: visible;
    /* Badges pop-out */
}

/* Ajustes para badges desktop - um pouco maiores */
.ad-badges-container.desktop {
    top: 10px;
    left: 10px;
    /* Alinhado internamente ao padding */
    gap: 6px;
}

.ad-badges-container.desktop .ad-badge-overlay {
    font-size: 0.75rem;
    padding: 4px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.desktop-ad-info {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-02);
}

.ad-rating-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.ad-rating-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.no-reviews {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Badges de Promoção/Cupom */
.ad-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 4px;
    margin-bottom: 4px;
}

.ad-badge.promo {
    background: var(--neon-red);
    color: white;
    box-shadow: 0 0 5px rgba(255, 77, 90, 0.4);
}

.ad-badge.coupon {
    background: var(--neon-cyan);
    color: black;
    cursor: copy;
    border: 1px dashed rgba(0, 0, 0, 0.3);
}

.coupon-container {
    display: inline-block;
}

.desktop-ad-price {
    display: block;
    font-size: 1.2rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.desktop-ad-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-02);
    width: 100%;
}

.desktop-ad-card .btn-shop {
    width: 100%;
    padding: var(--space-03);
    font-size: 1rem;
    background: var(--gradient-primary);
    border: none;
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-glow-pink);
    /* Fix para <a> tag */
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    pointer-events: auto;
}

.desktop-ad-card .btn-reviews {
    width: 100%;
    padding: var(--space-02);
    font-size: 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.desktop-ad-card .btn-reviews:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.ad-price {
    font-weight: var(--font-weight-bold);
    color: #333;
    font-size: 0.9rem;
}

.btn-shop {
    background: var(--neon-pink);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s;
}

.btn-shop:hover {
    filter: brightness(1.1);
}

/* Click Layer */
.click-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

/* Hide footer on Shorts page */
.site-footer {
    display: none;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    z-index: 1001;
    animation: bounce 2s infinite;
    transition: color 0.3s;
}

.scroll-indicator:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .desktop-ad-sidebar {
        display: none;
    }

    .video-wrapper {
        width: 100%;
        max-width: 100%;
        height: calc(100vh - var(--header-height, 60px));
        max-height: none;
        border-radius: 0;
        border: none;
    }

    .shorts-player-container {
        height: calc(100vh - var(--header-height, 60px));
    }
}

/* REVIEWS SIDE PANEL */
.reviews-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.reviews-backdrop.active {
    display: block;
}

.reviews-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 90vw;
    height: 100%;
    background: var(--bg-surface);
    z-index: 10000;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.8);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-default);
}

.reviews-panel.active {
    right: 0;
}

.reviews-panel-header {
    padding: var(--space-05);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-primary);
    /* Updated to Pink/Purple */
}

.reviews-panel-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.reviews-panel-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.reviews-panel-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.reviews-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-05);
}

.reviews-panel-body::-webkit-scrollbar {
    width: 8px;
}

.reviews-panel-body::-webkit-scrollbar-track {
    background: var(--bg-void);
}

.reviews-panel-body::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}

.reviews-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Override reviews.css for dark panel */
.reviews-panel .reviews-header {
    background: var(--bg-elevated) !important;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    box-shadow: none;
}

.reviews-panel .rating-number {
    color: var(--text-primary) !important;
}

.reviews-panel .total-count {
    color: var(--text-muted) !important;
}

.reviews-panel .progress-bar {
    background: var(--bg-void) !important;
}

.reviews-panel .progress-fill {
    background: var(--neon-yellow) !important;
    box-shadow: 0 0 8px rgba(255, 190, 11, 0.3);
}

.reviews-panel .btn-primary {
    background: var(--gradient-primary);
    border: none;
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-glow-pink);
}

.reviews-panel .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.reviews-panel .btn-secondary {
    background: var(--bg-void);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.reviews-panel .btn-secondary:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.reviews-panel .write-review-form {
    background: var(--bg-elevated) !important;
    border-color: var(--border-default) !important;
    color: var(--text-primary) !important;
}

.reviews-panel .write-review-form textarea {
    background: var(--bg-void) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-default) !important;
}

.reviews-panel .write-review-form textarea:focus {
    outline: none;
    border-color: var(--neon-pink) !important;
    box-shadow: 0 0 0 3px var(--neon-pink-glow);
}

.reviews-panel .review-card {
    border-bottom-color: var(--border-default) !important;
}

.reviews-panel .review-content {
    color: var(--text-secondary) !important;
}

.reviews-panel .review-helpful-btn,
.reviews-panel .review-report-btn {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    transition: all var(--transition-fast);
}

.reviews-panel .review-helpful-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0, 217, 255, 0.1);
}

.reviews-panel .review-report-btn:hover {
    color: var(--neon-red);
    border-color: var(--neon-red);
    background: rgba(255, 77, 90, 0.1);
}

/* Botão de voltar (padrão desktop: oculto) */
.mobile-back-btn {
    display: none;
}

@media (max-width: 768px) {

    /* 1. Immersive View: Remove barras do site */
    body.shorts-page header,
    body.shorts-page nav,
    body.shorts-page .bottom-nav,
    body.shorts-page .site-header {
        display: none !important;
    }

    body.shorts-page .shorts-player-container {
        top: 0 !important;
        height: 100vh !important;
        max-height: -webkit-fill-available;
    }

    .video-wrapper {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: -webkit-fill-available;
        border: none;
        border-radius: 0;
    }

    .desktop-ad-sidebar {
        display: none;
    }

    /* 2. Botão de Voltar Mobile */
    .mobile-back-btn {
        display: flex;
        position: absolute;
        top: 20px;
        left: 16px;
        z-index: 10000;
        /* Aumentado para garantir */
        pointer-events: auto;
        /* ESSENCIAL */
        width: 44px;
        /* Aumentado */
        height: 44px;
        /* Aumentado */
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);

        backdrop-filter: blur(4px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        color: white;
        transition: all 0.2s;
    }

    .mobile-back-btn:active {
        background: rgba(0, 0, 0, 0.6);
        transform: scale(0.95);
    }

    .mobile-back-btn svg {
        width: 24px;
        height: 24px;
    }

    /* 3. Modal Mobile Full Screen (Exatamente o tamanho da tela) */
    .reviews-panel {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        top: 0;
        left: 0;
        right: auto;
        /* Reset left/right logic */
        transform: translateY(100%);
        /* Slide from bottom default */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: none;
        border-radius: 0;
        z-index: 20000;
        /* Acima de tudo */
    }

    /* Quando ativo, desliza para cima (cover entire screen) */
    .reviews-panel.active {
        right: auto;
        /* Reset desktop logic */
        transform: translateY(0);
    }

    /* Header e Botão Fechar Mobile */
    .reviews-panel-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-surface);
        /* Garante opacidade */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .reviews-panel-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-primary);
        /* Garante cor visível */
    }

    .reviews-panel-close svg {
        width: 24px;
        height: 24px;
        stroke-width: 2.5;
    }
}