/* Modern CSS Reset & Variables */
:root {
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --accent: #dc2626; /* Crimson Red */
    --accent-glow: rgba(220, 38, 38, 0.6);
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

/* Scroll Snap Container */
.scroll-container {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
    z-index: 10;
}
.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    background: #000;
}


/* Top Left Back Button */
/* Top Left Back Button */
.back-home-btn {
    position: fixed;
    top: 30px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1b1f28;
    box-shadow: 6px 6px 14px #101218, -6px -6px 14px #222834;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 18px;
    border-radius: 30px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    z-index: 1000;
    pointer-events: auto;
    transition: all 0.3s ease;
}
.back-home-btn:hover {
    box-shadow: 8px 8px 18px #101218, -8px -8px 18px #222834, 0 0 15px rgba(220, 38, 38, 0.2);
    transform: translateX(-4px);
    color: #fff;
}

/* Top Right Logo Fixed */
.absolute-logo {
    position: fixed;
    top: 30px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    z-index: 1000;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.absolute-logo:hover {
    opacity: 0.85;
}
.mini-logo {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1);
}
.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.logo-swift { color: #ffffff; font-weight: 900; }
.logo-snip  { color: var(--accent); font-weight: 900; }
.logo-text small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* ======================================
   CINEMATIC LAYOUT  (flex row)
   video-col | actions-col
   ====================================== */
.cinematic-layout {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0 20px;
    gap: 0;
}

/* Left column – video + meta */
.video-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    flex: 0 0 auto;
}

/* Right column – actions perfectly centered */
.actions-col {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 120px;
}

/* --- CLIP SECTION --- */
.clip-section {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    background-color: #161920;
}

/* --- VIDEO LAYER (100% CONTAIN TRICK) --- */
/* Blurred background image */
.bg-blur {
    position: absolute;
    inset: -50px;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.8) saturate(1.5);
    z-index: 0;
}

.video-layer {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Floating Cinematic Player Container */
.yt-container-fix {
    position: relative;
    height: 75vh;
    width: calc(75vh * (16 / 9));
    max-width: 78vw;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 12px 12px 30px #0d0f14, -12px -12px 30px #252c3c;
    background-color: #000;
}

.yt-player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Force the actual YouTube iframe to fill the wrapper */
.yt-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* --- INTERACTION SHIELD --- */
.interaction-shield {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

/* --- GRADIENTS --- */
.gradient-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 15;
}
.gradient-overlay.bottom {
    bottom: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}
.gradient-overlay.right {
    top: 0; right: 0; bottom: 0; width: 300px;
    background: linear-gradient(to left, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

/* --- INDICATORS --- */
.play-indicator {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90px; height: 90px;
    background: #1b1f28;
    box-shadow: 8px 8px 20px #101218, -8px -8px 20px #222834;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 32px; color: #fff;
    backdrop-filter: blur(8px);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none; z-index: 20;
}
.play-indicator.show { transform: translate(-50%, -50%) scale(1); }

.loading-spinner {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinLoader 0.75s linear infinite;
    z-index: 6; display: none;
}
@keyframes spinLoader { to { transform: translate(-50%, -50%) rotate(360deg); } }


/* --- FLOATING UI LAYER --- */
.floating-ui {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none; /* Let clicks pass to shield except on interactive elements */
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Bottom Left Meta */
.meta-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 65%;
    pointer-events: auto;
}

.channel-info-pill {
    display: inline-flex;
    align-items: center;
    background: #1b1f28;
    box-shadow: 6px 6px 14px #101218, -6px -6px 14px #222834;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 16px 6px 6px;
    border-radius: 40px;
    gap: 12px;
    width: fit-content;
}

.channel-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-swift { color: #ffffff; font-weight: 800; }
.logo-snip  { color: var(--accent); font-weight: 800; }

.logo-text small {
    font-size: 0.65rem;
    opacity: 0.6;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.channel-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.live-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 0 10px var(--accent-glow);
}

.clip-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
    margin-top: 5px;
}

.snip-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.snipped-by-name { color: #fff; font-weight: 700; }
.time-ago { opacity: 0.7; }
.time-ago::before { content: "•"; margin-right: 8px; }
.clip-views-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1b1f28;
    box-shadow: inset 2px 2px 6px #101218, inset -2px -2px 6px #222834;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
    margin-left: 6px;
}
.clip-views-tag i { color: var(--accent); }


/* Right Side Actions */
.actions-block {
    /* Pull the panel into the empty right space beside the video */
    position: absolute;
    right: calc((100vw - calc(75vh * (16/9))) / 4);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    pointer-events: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav-btn:hover { color: white; transform: scale(1.2); }

.action-btn-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #1b1f28;
    box-shadow: 8px 8px 20px #101218, -8px -8px 20px #222834;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 15px;
    border-radius: 40px;
}

.glass-btn {
    background: #1b1f28;
    box-shadow: 4px 4px 10px #101218, -4px -4px 10px #222834;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.4rem;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-btn:hover {
    box-shadow: 6px 6px 14px #101218, -6px -6px 14px #222834, 0 0 10px rgba(255,255,255,0.1);
    transform: scale(1.15);
}
.glass-btn:active {
    box-shadow: inset 3px 3px 6px #101218, inset -3px -3px 6px #222834;
    transform: scale(0.95);
}

/* Like Animation State */
.glass-btn.action-like.active {
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

/* Like wrapper — button + count stacked */
.like-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.like-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    line-height: 1;
    letter-spacing: 0.02em;
}
.like-wrapper .action-like.active ~ .like-count,
.like-wrapper .action-like.active + .like-count {
    color: var(--accent);
}


/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 14px 28px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1rem;
    display: flex; align-items: center; gap: 12px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast i { font-size: 1.4rem; }

@media (max-width: 900px) {
    .clip-title { font-size: 2rem; }
    .floating-ui { padding: 20px; }
}

/* ======================================
   MOBILE & TABLET RESPONSIVE DESIGN
   (Applies ONLY to screens <= 768px)
   ====================================== */
@media (max-width: 768px) {
    .back-home-btn {
        top: 16px;
        left: 16px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .absolute-logo {
        top: 18px;
        right: 20px;
        left: auto;
        gap: 8px;
    }
    .mini-logo {
        width: 24px;
        height: 24px;
    }
    .logo-text {
        font-size: 0.95rem;
    }
    .logo-text small {
        font-size: 0.55rem;
    }

    .yt-container-fix {
        width: 94vw;
        height: auto;
        max-width: 94vw;
        max-height: 52vh;
        aspect-ratio: 16 / 9;
        border-radius: 16px;
    }

    .floating-ui {
        padding: 16px;
    }

    .meta-block {
        max-width: 100%;
        gap: 8px;
    }

    .clip-title {
        font-size: 1.4rem;
        line-height: 1.2;
    }

    .channel-title {
        font-size: 0.85rem;
    }

    .snip-meta-row {
        font-size: 0.78rem;
        flex-wrap: wrap;
        gap: 6px;
    }

    .clip-views-tag {
        font-size: 0.75rem;
        padding: 2px 8px;
    }

    /* Shift action panel to the white box area directly above the video on mobile */
    .actions-block {
        position: absolute;
        top: calc(50vh - (94vw * 9 / 32) - 62px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 10px;
        align-items: center;
        justify-content: center;
        z-index: 30;
    }

    .action-btn-group {
        flex-direction: row;
        padding: 6px 16px;
        gap: 16px;
        border-radius: 30px;
        align-items: center;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .glass-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .nav-btn {
        display: none; /* Hide chevrons on mobile since touch scrolling is native */
    }

    .like-wrapper {
        flex-direction: row;
        gap: 4px;
    }

    .volume-slider-wrapper {
        right: auto;
        left: 50%;
        top: 45px;
        transform: translateX(-50%);
        width: 130px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .yt-container-fix {
        width: 96vw;
        max-height: 48vh;
        border-radius: 14px;
    }

    .clip-title {
        font-size: 1.2rem;
    }

    .actions-block {
        top: calc(50vh - (96vw * 9 / 32) - 56px);
    }

    .action-btn-group {
        padding: 5px 12px;
        gap: 12px;
    }

    .glass-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
}



/* Volume Slider */
.volume-container {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

.volume-slider-wrapper {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    height: 48px;
    width: 140px;
    padding-right: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    justify-content: center;
    align-items: center;
    z-index: 50;
    background: transparent;
}

.volume-slider-inner {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.volume-container:hover .volume-slider-wrapper {
    display: flex;
    opacity: 1;
}

.volume-slider {
    -webkit-appearance: none;
    width: 90px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    outline: none;
    transform: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.clip-views-tag,
.like-count {
    display: none !important;
}
