/* ==========================================================================
   SecretHub.vip - Reels System (TikTok / Shorts vertical viewer & paywall)
   Inspired by reels1.png and reels2.png
   ========================================================================== */

.reels-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.reels-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Reels Container (9:16 aspect ratio on desktop, 100% on mobile) */
.reels-viewport {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 92vh;
    margin: auto;
    background: #0b0c10;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(168, 85, 247, 0.2);
    display: flex;
    flex-direction: column;
}

@media (max-width: 500px) {
    .reels-viewport {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Reels Top Bar */
.reels-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 35px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
    color: #ffffff;
}

.reels-back-btn, .reels-sound-btn, .reels-close-btn {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.reels-icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#reelsSoundIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 0;
}

#reelsSoundIcon svg {
    display: block;
    margin: 0 auto;
}

.reels-counter-badge {
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 9999px;
    color: #ffffff;
    letter-spacing: 1px;
}

/* Reels Slide Track */
.reels-track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.reel-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

/* Full-width seamless bottom vignette covering 100% of viewport and behind sidebar buttons */
.reel-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 360px;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.78) 32%,
        rgba(0, 0, 0, 0.42) 65%,
        rgba(0, 0, 0, 0.12) 85%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 15;
}

.reel-item.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.reel-item.prev {
    opacity: 0;
    transform: translateY(-100%);
}

/* Video element or animated fallback */
.reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reel-preview-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e1b4b 0%, #090a10 100%);
    position: relative;
}

.reel-preview-pulse {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
    border: 2px solid rgba(168, 85, 247, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a855f7;
    animation: reelPulse 2s infinite ease-in-out;
}

@keyframes reelPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 35px rgba(168, 85, 247, 0.5); }
}

/* Reels Sidebar Actions (Right side: Like, Save, Share) */
.reels-sidebar {
    position: absolute;
    right: 14px;
    bottom: 90px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.85));
}

.reels-action-btn {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.reels-action-btn:hover {
    transform: scale(1.15);
    background: rgba(168, 85, 247, 0.6);
}

.reels-action-btn.liked {
    color: #ec4899;
    border-color: #ec4899;
}

.reels-action-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    margin-top: 4px;
}

/* Reels Bottom Info */
.reels-bottom-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 76px;
    z-index: 20;
    padding: 24px 20px;
    background: transparent;
    color: #ffffff;
    pointer-events: auto;
}

.reels-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reel-badge-pill {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 9999px;
}

.reel-live-badge {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: #ef4444;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.reel-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    animation: livePulse 1.4s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Navigation Arrows for Desktop */
.reels-nav-controls {
    position: absolute;
    left: 14px;
    bottom: 90px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reels-nav-arrow {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reels-nav-arrow:hover {
    background: rgba(168, 85, 247, 0.7);
    transform: scale(1.1);
}

/* ==========================================================================
   Reels Paywall Screen (Exact recreation of reels2.png aesthetics)
   ========================================================================== */
.reels-paywall-screen {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: radial-gradient(circle at center, #151828 0%, #08090f 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.reels-paywall-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.paywall-lock-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 24px;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.paywall-title {
    font-size: 1.85rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.paywall-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    max-width: 280px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.btn-paywall-unlock {
    background: #ffffff;
    color: #090a10 !important;
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem;
    padding: 13px 28px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(255, 255, 255, 0.35);
    transition: all 0.25s ease;
}

.btn-paywall-unlock:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 255, 255, 0.5);
    background: #f1f5f9;
}
