/* =========================================
   1. CORE SYSTEMS (Variáveis & Reset)
   ========================================= */
:root {
    /* Paleta Dark Premium */
    --bg-body: #0a0a0a;       /* Preto Profundo (Não use #000 puro) */
    --bg-card: #141414;       /* Contraste Sutil */
    --bg-glass: rgba(20, 20, 20, 0.95); /* Efeito Vidro */
    
    /* Cores de Ação (Dopamina) */
    --primary: #ff0055;       /* Rosa/Vermelho Neon (Paixão/Alerta) */
    --primary-glow: rgba(255, 0, 85, 0.4);
    --accent: #7000ff;        /* Roxo Tech */
    
    /* Tipografia */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    
    /* Estrutura */
    --border: #27272a;
    --sidebar-width: 240px;
    --header-height: 70px;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    padding-bottom: 80px; /* Espaço para Mobile Nav */
    overflow-x: hidden;
    user-select: none; -webkit-user-select: none; /* Bloqueia seleção de texto (App Feel) */
    cursor: default;
}

/* =========================================
   2. SIDEBAR (O Centro de Comando)
   ========================================= */
.sidebar { display: none; } /* Mobile First: Escondido por padrão */

@media (min-width: 1024px) {
    body { padding-left: var(--sidebar-width); padding-bottom: 0; }
    
    .sidebar {
        position: fixed; left: 0; top: 0; 
        height: 100vh; width: var(--sidebar-width);
        background: var(--bg-card); 
        border-right: 1px solid var(--border);
        display: flex !important; flex-direction: column; 
        padding: 2rem; 
        z-index: 1000; /* Acima do Header */
    }
}

.brand { 
    font-family: 'Space Grotesk', sans-serif; 
    font-weight: 800; font-size: 1.8rem; 
    color: white; margin-bottom: 2rem; 
    letter-spacing: -1px; cursor: pointer;
    background: linear-gradient(to right, #fff, #ccc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.nav-btn {
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: none; border: none; color: var(--text-muted);
    padding: 12px; border-radius: 8px; 
    font-size: 1rem; font-weight: 600; 
    cursor: pointer; transition: all 0.2s ease;
    text-align: left; text-decoration: none;
}

.nav-btn:hover { background: #222; color: white; transform: translateX(5px); }
.nav-btn.active { background: #222; color: white; border-left: 3px solid var(--primary); }
.nav-btn i { font-size: 1.4rem; }

/* Botões Especiais (Gatilhos) */
.btn-leaks {
    color: var(--primary) !important;
    background: rgba(255, 0, 85, 0.05) !important;
    border: 1px solid rgba(255, 0, 85, 0.2) !important;
}
.btn-leaks:hover {
    background: var(--primary) !important; color: white !important;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-live { color: white !important; }
.live-dot {
    width: 8px; height: 8px; background: red; border-radius: 50%;
    margin-left: auto; box-shadow: 0 0 10px red;
    animation: pulse-red 1s infinite;
}

.nav-footer {
    border-top: 1px solid var(--border); padding-top: 1rem;
}

/* =========================================
   3. HEADER (Navegação Superior)
   ========================================= */
.top-bar {
    position: sticky; top: 0; z-index: 90;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 1.25rem; height: var(--header-height);
    background: var(--bg-glass); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) { 
    .top-bar { padding: 0 2.5rem; } 
    .brand-mobile { display: none; }
}

.brand-mobile { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 1.5rem; }

.search-container {
    flex: 1; max-width: 500px; margin: 0 1rem; position: relative;
    display: flex; align-items: center;
}
.search-icon { position: absolute; left: 14px; color: #666; font-size: 1.2rem; }
.search-input {
    width: 100%; background: #1a1a1a; border: 1px solid var(--border);
    padding: 0.7rem 1rem 0.7rem 2.8rem; border-radius: 99px;
    color: white; outline: none; transition: 0.3s;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(255, 0, 85, 0.1); }

/* Auth Group & Botões */
.auth-group { display: flex; gap: 10px; align-items: center; }

.btn-login {
    background: none; border: 1px solid var(--border); color: white;
    padding: 0.6rem 1.2rem; border-radius: 8px; cursor: pointer; font-weight: 700;
    font-size: 0.9rem; transition: 0.2s;
}
.btn-login:hover { border-color: white; }

.btn-signup {
    background: var(--primary); color: white; border: none;
    padding: 0.6rem 1.2rem; border-radius: 8px; cursor: pointer; font-weight: 700;
    display: flex; align-items: center; gap: 6px; font-size: 0.9rem;
    box-shadow: 0 0 15px var(--primary-glow); transition: transform 0.2s;
}
.btn-signup:hover { transform: scale(1.05); }

.header-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border); cursor: pointer; transition: 0.2s;
}
.header-avatar:hover { border-color: var(--primary); }

.btn-icon {
    background: none; border: none; color: white; font-size: 1.5rem;
    cursor: pointer; padding: 8px; border-radius: 50%; transition: 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--primary); }

/* =========================================
   4. STORIES RAIL (Gatilho de Urgência)
   ========================================= */
.stories-rail {
    display: flex; gap: 18px; overflow-x: auto; 
    padding: 15px 1.25rem;
    scrollbar-width: none; border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.stories-rail::-webkit-scrollbar { display: none; }

.story-item {
    display: flex; flex-direction: column; align-items: center; 
    gap: 6px; cursor: pointer; min-width: 72px;
}
.story-ring {
    width: 68px; height: 68px; border-radius: 50%; padding: 2px;
    /* Instagram Gradient Clone */
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    position: relative; transition: transform 0.2s;
}
.story-ring:active { transform: scale(0.95); }

/* Animação de Live (Pulsante) */
.story-ring.live {
    background: linear-gradient(45deg, #ff0055, #ff0000);
    animation: pulse-ring 2s infinite;
}
.story-img {
    width: 100%; height: 100%; border-radius: 50%; 
    border: 3px solid var(--bg-body); object-fit: cover; background: #000;
}
.story-name {
    font-size: 0.75rem; color: #ccc; white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; max-width: 70px;
}
.live-badge {
    position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    background: #ff0055; color: white; font-size: 0.6rem; padding: 2px 6px;
    border-radius: 4px; font-weight: 800; border: 2px solid var(--bg-body);
}

/* =========================================
   5. HERO SECTION (Carrossel Imersivo)
   ========================================= */
.hero-section { padding: 0 1.25rem; margin-bottom: 25px; }

.hero-carousel {
    display: flex; gap: 15px; overflow-x: auto; 
    scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px;
}
.hero-carousel::-webkit-scrollbar { display: none; }

.hero-card {
    min-width: 100%; height: 220px; position: relative;
    background: #222; border-radius: 16px; overflow: hidden;
    scroll-snap-align: center; cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}
@media(min-width: 768px) { .hero-card { height: 380px; } }

.hero-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: transform 0.5s; }
.hero-card:hover .hero-img { transform: scale(1.05); }

.hero-content {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 30px 20px;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 100%);
}
.hero-tag {
    background: var(--primary); color: white; padding: 4px 10px;
    font-size: 0.7rem; font-weight: 800; border-radius: 4px; text-transform: uppercase;
}
.hero-title {
    color: white; font-size: 1.6rem; margin: 10px 0 0;
    font-family: 'Space Grotesk', sans-serif; line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* CONTINUE WATCHING (BEZOS) */
.continue-watching { padding: 0 1.25rem 15px; }
.continue-watching.hidden { display: none; }
.section-title { font-size: 1rem; color: #eee; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.continue-scroll { display: flex; gap: 15px; overflow-x: auto; scrollbar-width: none; }
.continue-scroll::-webkit-scrollbar { display: none; }
.continue-card { min-width: 160px; height: 90px; position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; }
.continue-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.continue-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: var(--primary); z-index: 2; }
.continue-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.play-icon-small { color: white; font-size: 1.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); }

/* =========================================
   6. CATEGORIES & FEED (O Motor de Busca)
   ========================================= */
.category-wrapper { padding: 0 1.25rem 0.5rem; display: flex; align-items: center; }
.category-scroll {
    display: flex; gap: 10px; overflow-x: auto; scroll-behavior: smooth;
    scrollbar-width: none; width: 100%; padding-bottom: 5px;
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
    padding: 8px 18px; border-radius: 99px; white-space: nowrap; font-weight: 500;
    cursor: pointer; transition: 0.2s; font-size: 0.9rem;
}
.cat-pill:hover { border-color: white; color: white; }
.cat-pill.active { background: white; color: black; border-color: white; font-weight: 800; }

/* FEED GRID RESPONSIVO */
.feed-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px; padding: 1rem 1.25rem;
}
@media(min-width: 768px) {
    .feed-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
}

/* CARDS DE VÍDEO */
.card {
    position: relative; background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 9/14; cursor: pointer;
    transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }

.card-media-wrapper { width: 100%; height: 100%; position: relative; }
.card-thumb { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s; }

/* Vídeo Preview (Loop no Hover) */
.card-preview {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; pointer-events: none; background: #000;
    transition: opacity 0.3s;
}
.card-media-wrapper.playing .card-thumb { opacity: 0; }
.card-media-wrapper.playing .card-preview { opacity: 1; }

.card-overlay {
    position: absolute; bottom: 0; width: 100%; padding: 1.5rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 100%);
    z-index: 2;
}
.card h4 { font-size: 0.95rem; line-height: 1.2; margin-bottom: 4px; color: white; }
.card span { font-size: 0.8rem; color: #ccc; }

.badge {
    position: absolute; top: 10px; left: 10px; 
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    padding: 4px 8px; border-radius: 4px; 
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase; z-index: 2;
}

/* LIVE VIEWER BADGE (ZUCK) */
.live-viewer-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6); color: white; padding: 4px 8px;
    border-radius: 4px; font-size: 0.7rem; font-weight: 600;
    display: flex; align-items: center; gap: 4px; z-index: 2; backdrop-filter: blur(4px);
}
.live-viewer-badge i { color: #ff0055; animation: pulse-opacity 1.5s infinite; }

/* Botão de Like no Hover */
.btn-feed-action {
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; backdrop-filter: blur(4px); transition: 0.2s;
}
.btn-feed-action:hover { background: var(--primary); transform: scale(1.1); }

/* Estilo Native Ads */
.ad-card { border: 2px solid #ffd700; transform: scale(1); }
.ad-card:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }

/* =========================================
   7. MOBILE NAV & MODALS
   ========================================= */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(10,10,10,0.95); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 1rem; 
    z-index: 2000;
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }

.b-nav-item {
    background: none; border: none; color: #666; font-size: 1.6rem;
    cursor: pointer; text-decoration: none; position: relative;
}
.b-nav-item.active { color: white; }
.b-nav-item.highlight { color: var(--primary); transform: scale(1.2); }

/* Modal Login (Gatekeeper) */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s;
}
.modal.open { opacity: 1; pointer-events: all; }

.modal-box {
    background: #1a1a1a; padding: 2rem; border-radius: 20px;
    width: 90%; max-width: 400px; text-align: center;
    border: 1px solid #333; transform: scale(0.9); transition: 0.3s;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal.open .modal-box { transform: scale(1); }

.modal-input {
    width: 100%; background: #0a0a0a; border: 1px solid #333;
    padding: 12px; color: white; border-radius: 8px; outline: none;
    transition: 0.2s;
}
.modal-input:focus { border-color: var(--primary); }

.btn-primary-glow {
    background: var(--primary); color: white; border: none;
    padding: 12px; border-radius: 8px; font-weight: 700;
    cursor: pointer; box-shadow: 0 0 15px var(--primary-glow);
    font-size: 1rem;
}

/* =========================================
   8. ANIMAÇÕES
   ========================================= */
@keyframes pulse { 
    0% { background-color: #1a1a1a; } 
    50% { background-color: #2a2a2a; } 
    100% { background-color: #1a1a1a; } 
}
@keyframes pulse-ring { 
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7); } 
    70% { box-shadow: 0 0 0 6px rgba(255, 0, 85, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); } 
}
@keyframes pulse-red { 
    0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } 
}
@keyframes pulse-opacity {
    0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; }
}