:root {
    --primary: #1877f2;
    /* Facebook Blue */
    --bg: #000;
    --text: #fff;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-heavy: rgba(255, 255, 255, 0.25);
    --font: 'Outfit', sans-serif;
    --verified: #1877f2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reels-container {
    height: 100vh;
    width: 100%;
    max-width: 500px;
    /* Force mobile width on desktop */
    margin: 0 auto;
    background: #000;
    position: relative;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.reels-container::-webkit-scrollbar {
    display: none;
}

.reel-section {
    position: relative;
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.reel-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.9);
    /* FB is usually brighter than TikTok */
}

/* Play State Icon Overlay */
.play-state-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    opacity: 1;
    /* Always visible for static images */
    pointer-events: none;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.reel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 20%, transparent 70%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    padding-bottom: 24px;
}

/* FB Style Sidebar (Bottom Right) */
.sidebar {
    position: absolute;
    right: 12px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 20;
    pointer-events: auto;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.action-item.profile {
    display: none;
    /* FB profile is at the bottom left, not sidebar */
}

.icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    /* Reduced from 26px */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.1s ease;
}

.heart.liked {
    color: #e0333c;
    /* FB Heart Color */
    transform: scale(1.1);
}

.count {
    font-size: 0.75rem;
    font-weight: 400;
    /* Reduced from 500 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    /* Softened from 0.8 */
}

/* Facebook Style Bottom Content */
.content-info {
    max-width: 75%;
    z-index: 20;
    pointer-events: auto;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.avatar-container {
    position: relative;
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    object-fit: cover;
}

.username {
    font-size: 0.95rem;
    font-weight: 500;
    /* Reduced from 600 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.follow-label {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    /* Reduced from 600 */
    cursor: pointer;
    margin-left: 2px;
}

.description {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 12px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.music-info {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.music-ticker-wrapper {
    overflow: hidden;
    width: 120px;
}

.music-ticker {
    font-size: 0.75rem;
    white-space: nowrap;
    animation: ticker 10s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Floating Heart (Double Tap) */
.floating-heart {
    position: absolute;
    color: #e0333c;
    font-size: 5rem;
    pointer-events: none;
    animation: fbHeartPop 0.8s ease-out forwards;
    z-index: 110;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

@keyframes fbHeartPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    30% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
    }

    80% {
        transform: translate(-50%, -70%) scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -100%) scale(1.3);
        opacity: 0;
    }
}

@keyframes iconPopStatic {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Comment Drawer Styles */
.comment-drawer {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    /* Match reels container */
    height: 70vh;
    background: #242526;
    /* FB Dark Gray */
    border-radius: 12px 12px 0 0;
    transition: bottom 0.3s cubic-bezier(0.1, 0.7, 1.0, 0.1);
    z-index: 1000;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.comment-drawer.active {
    bottom: 0;
}

.drawer-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.close-drawer {
    cursor: pointer;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-body {
    background: #3A3B3C;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 85%;
}

.comment-user {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #E4E6EB;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.drawer-overlay.active {
    display: block;
}