/* ==============================================================
   PORTFOLIO V3 — VERTICAL VIDEO VIEWER STYLE (SHORTS/REELS)
   ============================================================== */

:root {
    --vv-bg: #050811;
    --vv-bg-panel: rgba(13, 20, 38, 0.95);
    --vv-border: rgba(255, 255, 255, 0.08);
    --vv-text-muted: #94a3b8;
}

/* Trava scroll do body */
body.vv-active {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Modal wrapper */
.vertical-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.vertical-viewer-modal.is-open {
    display: flex;
    opacity: 1;
}

/* Background overlay */
.vv-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(13, 20, 38, 0.85) 0%, #000 100%);
    pointer-events: none;
}

/* Container */
.vv-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Close button */
.vv-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--vv-border);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    transition: background 0.2s, transform 0.2s;
}

.vv-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Swipe Feed Container */
.vv-feed-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none; /* Firefox */
}

.vv-feed-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Individual Slide */
.vv-slide {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}

.vv-slide-inner {
    width: 100%;
    height: 100%;
    max-height: 860px;
    max-width: 1000px;
    display: flex;
    gap: 32px;
    padding: 0 40px;
    box-sizing: border-box;
}

/* Player section (Left/Center) */
.vv-player-section {
    flex: 0 0 420px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vv-player-wrapper {
    width: 100%;
    height: 100%;
    max-height: 740px;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 20px;
    border: 1px solid var(--vv-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

/* Iframe player */
.vv-player-iframe-container {
    width: 100%;
    height: 100%;
}

.vv-player-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading Placeholder */
.vv-player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: #000;
}

.vv-player-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
    filter: blur(2px);
}

.vv-play-trigger {
    position: absolute;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 10;
}

.vv-play-trigger:hover {
    transform: scale(1.08);
    background: #fff;
    color: #000;
}

.vv-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #090e1a 25%, #161e2e 50%, #090e1a 75%);
    background-size: 200% 100%;
    animation: vv-shimmer 1.5s infinite;
}

@keyframes vv-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Info section (Right Side) */
.vv-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    min-width: 0;
    max-height: 740px;
    overflow-y: auto;
    padding-top: 24px;
    padding-bottom: 24px;
    padding-right: 12px;
}

/* Oculta o botão de fechar drawer por padrão no desktop */
.vv-info-section-close-drawer {
    display: none;
}

/* Custom scrollbar for info section */
.vv-info-section::-webkit-scrollbar {
    width: 4px;
}
.vv-info-section::-webkit-scrollbar-track {
    background: transparent;
}
.vv-info-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

.vv-info-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vv-title {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    color: #fff;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Client bar */
.vv-client-bar {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--vv-border);
    border-radius: 12px;
    align-self: flex-start;
}

.vv-client-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.15);
}

.vv-client-meta {
    display: flex;
    flex-direction: column;
}

.vv-client-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.vv-client-sub {
    font-size: 11px;
    color: var(--vv-text-muted);
}

/* Tags */
.vv-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vv-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--vv-border);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
}

/* Description */
.vv-description-container {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    position: relative;
    max-height: 120px; /* aprox 5-6 lines */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.vv-description-container.expanded {
    max-height: 250px;
    overflow-y: auto;
}

/* Discrete scrollbar for description container when expanded */
.vv-description-container::-webkit-scrollbar {
    width: 3px;
}
.vv-description-container::-webkit-scrollbar-track {
    background: transparent;
}
.vv-description-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
}

/* Fade out overlay when description is collapsed */
.vv-description-container.has-fade:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, #050811); /* matches root background */
    pointer-events: none;
    transition: opacity 0.25s;
}

.vv-description-toggle {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.vv-description-toggle:hover {
    text-decoration: underline;
}

.vv-description {
    margin: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.vv-description-container:not(.expanded) .vv-description {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Extra/Collabs */
.vv-extra-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--vv-border);
}

.vv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    align-self: flex-start;
}

.vv-badge.verified {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Collabs */
.vv-collabs-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--vv-text-muted);
    margin: 0 0 8px;
    letter-spacing: 0.05em;
}

.vv-collab-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vv-collab-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.vv-collab-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.vv-collab-role {
    font-size: 11px;
    color: var(--vv-text-muted);
}

.vv-collab-link {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vv-collab-link:hover {
    text-decoration: underline;
}

/* YouTube link button */
.vv-youtube-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    margin-top: 10px;
}

.vv-youtube-link:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

/* Navigation buttons (Desktop only) */
.vv-nav-btn {
    position: absolute;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--vv-border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 100;
}

.vv-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.vv-prev-btn {
    top: calc(50% - 56px);
}

.vv-next-btn {
    top: calc(50% + 12px);
}

/* Mobile Action Sheet Trigger (hidden on desktop) */
.vv-mobile-details-btn {
    display: none;
}

/* End of Queue Slide */
.vv-end-slide {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.vv-end-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 16px;
}

.vv-end-slide h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.vv-end-slide p {
    font-size: 14px;
    color: var(--vv-text-muted);
    margin: 0 0 24px;
    max-width: 320px;
    line-height: 1.5;
}

.vv-end-action {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--vv-border);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s;
}

.vv-end-action:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* ==============================================================
   RESPONSIVE DESIGN (Tablets and Mobiles)
   ============================================================== */

@media (max-width: 991px) {
    .vv-slide-inner {
        max-width: 900px;
        gap: 20px;
        padding: 0 24px;
    }
    .vv-player-section {
        flex: 0 0 380px;
    }
}

@media (max-width: 768px) {
    /* Full mobile layout */
    .vv-close-btn {
        top: 16px;
        left: 16px; /* Place on top left for reels styling */
        right: auto;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .vv-nav-btn {
        display: none; /* Hide navigation buttons on mobile */
    }

    .vv-slide-inner {
        flex-direction: column;
        padding: 0;
        max-height: none;
        max-width: none;
        gap: 0;
    }

    .vv-player-section {
        flex: 1;
        width: 100%;
        height: 100%;
        position: absolute;
        inset: 0;
        z-index: 1;
    }

    .vv-player-wrapper {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
        aspect-ratio: auto;
    }

    /* Info Section becomes a bottom overlay on mobile */
    .vv-info-section {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 40vh;
        z-index: 10;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
        padding: 32px 20px 24px;
        box-sizing: border-box;
        gap: 12px;
        overflow: visible; /* Prevent scrollbar in compact mode */
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.35s;
    }

    /* Hide detailed description and collabs by default on mobile */
    .vv-description-container,
    .vv-extra-info,
    .vv-youtube-link {
        display: none;
    }

    .vv-info-header {
        gap: 8px;
    }

    .vv-title {
        font-size: 15px;
        font-weight: 600;
        max-width: calc(100% - 100px);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .vv-client-bar {
        padding: 4px 8px;
        border-radius: 8px;
        gap: 8px;
        background: rgba(255, 255, 255, 0.08);
    }

    .vv-client-avatar {
        width: 24px;
        height: 24px;
    }

    .vv-client-name {
        font-size: 12px;
    }

    .vv-client-sub {
        display: none;
    }

    /* Details bottom drawer overlay trigger */
    .vv-mobile-details-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        font-weight: 700;
        color: var(--accent);
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 6px 0;
        align-self: flex-start;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    /* Active Details Sheet (Drawer open state) */
    .vv-info-section.show-details {
        height: 70vh;
        max-height: 70vh;
        transform: translateY(0);
        background: var(--vv-bg-panel);
        border-radius: 24px 24px 0 0;
        border-top: 1px solid var(--vv-border);
        overflow-y: auto;
        padding-top: 24px;
        overscroll-behavior: contain;
    }

    .vv-info-section.show-details::before {
        content: '';
        position: sticky;
        top: -12px;
        align-self: center;
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 4px;
        margin-bottom: 12px;
        flex-shrink: 0;
    }

    .vv-info-section.show-details .vv-title {
        max-width: none;
        display: block;
        font-size: 18px;
    }

    .vv-info-section.show-details .vv-description-container,
    .vv-info-section.show-details .vv-extra-info,
    .vv-info-section.show-details .vv-youtube-link {
        display: flex;
    }
    
    .vv-info-section.show-details .vv-description-container {
        display: block;
        max-height: none !important;
        overflow: visible !important;
    }
    .vv-info-section.show-details .vv-description-container::after {
        display: none !important;
    }
    .vv-info-section.show-details .vv-description-toggle {
        display: none !important;
    }

    .vv-info-section.show-details .vv-mobile-details-btn {
        display: none; /* Hide toggle when open */
    }
    
    /* Close Drawer Indicator inside Drawer */
    .vv-info-section-close-drawer {
        display: none;
        position: absolute;
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--vv-border);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #fff;
    }
    .vv-info-section.show-details .vv-info-section-close-drawer {
        display: flex;
    }
}
