/* =====================================================
   SHORTS PLAYER - GRID + FULLSCREEN SCROLL
   ===================================================== */

:root {
    /* Colors - Matching Site Theme */
    --shorts-bg: var(--bg, #0b0710);
    --shorts-card-bg: var(--card, rgba(255, 255, 255, 0.03));
    --shorts-border: var(--border, rgba(255, 255, 255, 0.06));
    --shorts-text-primary: var(--text, #f7efff);
    --shorts-text-secondary: var(--muted, #9a8fb3);
    --shorts-accent: var(--accent, #ff66cc);
    --shorts-accent-hover: var(--accent-hover, #ff89d9);
}

/* =====================================================
   GRID CONTAINER (BROWSE MODE)
   ===================================================== */

.shorts-grid-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 120px);
}

.shorts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shorts-header h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--shorts-text-primary);
}

.shorts-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--shorts-card-bg);
    border: 1px solid var(--shorts-border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--shorts-text-secondary);
}

.shorts-counter span {
    font-weight: 600;
}

.shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* =====================================================
   SHORT CARD
   ===================================================== */

/* =====================================================
   SHORT CARD (NEW STRUCTURE)
   ===================================================== */

.short-card {
    background: var(--shorts-card-bg);
    border: 1px solid var(--shorts-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
}

.short-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 102, 204, 0.2);
    border-color: var(--shorts-accent);
}

.short-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.short-card:hover .thumbnail-container img {
    transform: scale(1.05);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.short-card:hover .play-icon {
    opacity: 1;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.short-meta {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.short-title {
    color: var(--shorts-text-primary);
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.short-stats {
    color: var(--shorts-text-secondary);
    font-size: 12px;
    margin-top: auto;
}

/* =====================================================
   FULLSCREEN PLAYER (WATCH MODE)
   ===================================================== */

.shorts-fullscreen-player {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.2);
    /* 20% black overlay - shows grid behind at 80% opacity */
}

/* Hide header and footer when player is active */
body:has(.shorts-fullscreen-player[style*="display: block"]) .global-header,
body:has(.shorts-fullscreen-player[style*="display: block"]) .site-footer {
    display: none !important;
}

.player-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(8px);
}

.player-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.player-scroll-container {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;

    /* Hide Scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.player-scroll-container::-webkit-scrollbar {
    display: none;
}

/* =====================================================
   PLAYER SHORT ITEM (VERTICAL)
   ===================================================== */

.player-short-item {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Let grid show through */
}

.player-short-item iframe {
    max-width: 500px;
    /* Constrain video width */
    width: 100%;
    height: 100%;
    border: none;
}

/* Info Overlay (Bottom) */
.player-short-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 40%, transparent 100%);
    padding: 20px;
    color: white;
    z-index: 10;
    pointer-events: none;
}

.player-short-overlay-content {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.player-channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-channel-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.player-channel-name {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.player-short-title {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================
   LOADING & EMPTY STATES
   ===================================================== */

.shorts-loading {
    text-align: center;
    padding: 40px;
    color: var(--shorts-text-secondary);
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--shorts-border);
    border-top-color: var(--shorts-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.shorts-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--shorts-text-secondary);
    grid-column: 1 / -1;
}

.shorts-empty h3 {
    color: var(--shorts-text-primary);
    margin-bottom: 12px;
}

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

@media (max-width: 768px) {
    .shorts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .player-close {
        top: 15px;
        right: 15px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .player-short-overlay {
        padding: 16px;
    }

    .player-channel-info img {
        width: 36px;
        height: 36px;
    }
}

/* =====================================================
   ADS SYSTEM
   ===================================================== */

.short-ad-container {
    position: fixed;
    z-index: 10000;
    /* Above player (9999) */
    pointer-events: auto;
}

/* Position: Side (Desktop) */
.short-ad-side {
    bottom: 120px;
    right: 20px;
    width: 300px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInRight 0.5s ease;
}

/* Position: Overlay (Mobile/Bottom) */
.short-ad-overlay {
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInUp 0.5s ease;
}

.ad-badge {
    position: absolute;
    top: -8px;
    left: 10px;
    background: #ffcc00;
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ad-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

.short-ad-side .ad-image {
    width: 100%;
    height: 150px;
    margin-bottom: 10px;
}

.ad-content {
    flex: 1;
}

.ad-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
}

.ad-price {
    font-size: 16px;
    font-weight: 700;
    color: #4caf50;
    margin-bottom: 8px;
    display: block;
}

.ad-cta {
    background: var(--shorts-accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.ad-cta:hover {
    background: var(--shorts-accent-hover);
}

/* =====================================================
   PAGINATION
   ===================================================== */
.shorts-pagination {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
    grid-column: 1 / -1;
    /* Ocupa toda a largura do grid */
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: var(--shorts-accent);
    color: white;
    border: none;
    cursor: pointer;
}

.pagination-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 204, 0.3);
    background: var(--shorts-accent-hover);
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .short-ad-side {
        display: none;
        /* Hide side ads on mobile */
    }
}

/* =====================================================
   FIXES & IMPROVEMENTS
   ===================================================== */

/* Hide ad overlay in Grid View */
.shorts-grid .short-ad-overlay {
    display: none !important;
}

/* Show ad overlay in Player View */
.shorts-fullscreen-player .short-ad-overlay {
    display: flex !important;
}

/* Pink Review Button Style */
.btn-review-pink {
    background: var(--shorts-accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(255, 102, 204, 0.4);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-review-pink:hover {
    background: var(--shorts-accent-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 102, 204, 0.6);
}

.btn-review-pink svg {
    width: 14px;
    height: 14px;
}