/* =========================================
   1. CORE & VARIABLES
   ========================================= */
:root {
    --bg-deep: #050505;
    --bg-surface: #121212;
    --primary: #ff0040; /* Neon Red */
    --accent: #00f2ea;  /* Cyan */
    --text: #ffffff;
    --text-dim: #888888;
    --nav-h: 70px;
    --max-w: 500px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text);
    overflow: hidden;
}

/* =========================================
   2. APP CONTAINER
   ========================================= */
.app-container {
    width: 100%; height: 100dvh;
    background: var(--bg-deep);
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
@media (min-width: 768px) {
    .app-container {
        max-width: var(--max-w); margin: 0 auto;
        border-left: 1px solid #222; border-right: 1px solid #222;
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
    }
}

/* Splash Screen */
#splash-screen {
    position: fixed; inset: 0; background: #000; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s;
}
.splash-logo {
    font-size: 2rem; font-weight: 900; letter-spacing: -1px;
    animation: pulse 1.5s infinite;
}
.splash-logo i { color: var(--primary); margin-right: 10px; }
@keyframes pulse { 0% {transform: scale(1);} 50% {transform: scale(1.1); opacity: 0.7;} 100% {transform: scale(1);} }

/* =========================================
   3. HEADER & SEARCH (MODIFIED FOR USER COUNT)
   ========================================= */
.app-header {
    position: absolute; top: 0; left: 0; right: 0;
    height: 60px; z-index: 50;
    background: linear-gradient(to bottom, rgba(0,0,0,0.95), transparent);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.brand-link { font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 6px; text-decoration: none; color: white; }
.text-neon { color: var(--primary); text-shadow: 0 0 10px rgba(255, 0, 64, 0.5); }

/* User Count Badge (New Feature) */
.user-count-badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 10px; border-radius: 12px;
    font-size: 0.7rem; font-weight: 600; color: #ccc;
    display: flex; align-items: center; gap: 6px;
    backdrop-filter: blur(5px);
}
.dot { width: 6px; height: 6px; background: #00ff00; border-radius: 50%; box-shadow: 0 0 5px #00ff00; }

.icon-btn { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; }

/* Search Overlay */
.search-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.95);
    z-index: 200; display: none; align-items: flex-start; justify-content: center;
    padding-top: 80px; opacity: 0; transition: opacity 0.3s;
}
.search-box { width: 90%; max-width: 400px; position: relative; }
.search-box form { display: flex; border-bottom: 2px solid var(--primary); }
.search-box input { flex: 1; background: none; border: none; color: white; font-size: 1.5rem; padding: 10px; outline: none; }
.search-box button { background: none; border: none; color: var(--primary); font-size: 1.5rem; }
.close-search { position: absolute; top: -50px; right: 0; font-size: 2rem; color: #666; cursor: pointer; }

/* Category Pills */
.category-scroll {
    padding: 70px 15px 10px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.pill {
    padding: 8px 18px; border-radius: 20px;
    background: rgba(255,255,255,0.1); color: #ccc; font-size: 0.85rem;
    white-space: nowrap; border: 1px solid transparent; transition: 0.3s; text-decoration: none;
}
.pill.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 0 15px rgba(255,0,64,0.4); }

/* =========================================
   4. HOME FEED (FIXED VIDEO SIZE)
   ========================================= */
.main-view { flex: 1; overflow-y: auto; padding-bottom: var(--nav-h); }
.mode-feed .main-view { padding-top: 0; }
.mode-shorts .main-view { padding-top: 0; }

.video-grid { padding: 10px 15px; display: grid; gap: 20px; }
.card { cursor: pointer; }

/* PENTING: FIX UKURAN VIDEO EXPLORE */
.card-thumb {
    position: relative; aspect-ratio: 16/9; border-radius: 12px;
    overflow: hidden; background: #222; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb iframe { width: 100%; height: 100%; object-fit: cover; } /* Backup CSS */

.card-play-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s;
}
.card-thumb:hover .card-play-overlay { opacity: 1; }
.card-play-overlay i { font-size: 2.5rem; color: white; filter: drop-shadow(0 0 5px black); }

.duration-badge {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.8); padding: 2px 6px; border-radius: 4px;
    font-size: 0.7rem; font-weight: bold; pointer-events: none;
}

.card-details { display: flex; gap: 12px; margin-top: 10px; }
.card-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: #333;
    display: grid; place-items: center; font-weight: bold; font-size: 0.8rem;
    color: var(--primary); border: 1px solid rgba(255,255,255,0.1);
}
.card-text h3 { font-size: 0.95rem; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;}
.card-meta { font-size: 0.8rem; color: var(--text-dim); }

/* Skeleton */
.loader-box { padding: 15px; }
.sk-card { margin-bottom: 20px; }
.sk-img { width: 100%; aspect-ratio: 16/9; background: #222; border-radius: 12px; margin-bottom: 10px; animation: shine 1.5s infinite linear; background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%); background-size: 200% 100%; }
.sk-line { height: 14px; background: #222; margin-bottom: 6px; border-radius: 4px; animation: shine 1.5s infinite linear; background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%); background-size: 200% 100%; }
.w-50 { width: 50%; }
@keyframes shine { 0% {background-position: 200% 0;} 100% {background-position: -200% 0;} }

/* =========================================
   5. SHORTS UI (CLEAN - NO BUTTONS)
   ========================================= */
.shorts-feed {
    height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory;
    background: #000;
}
.shorts-feed::-webkit-scrollbar { display: none; }

.short-snap {
    width: 100%; height: 100%; position: relative;
    scroll-snap-align: start; scroll-stop: always;
    background: #000; overflow: hidden;
}

.s-poster, .s-video-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.s-video-layer iframe { width: 100%; height: 100%; border: none; }
.s-poster { 
    background-size: cover; background-position: center; z-index: 2; 
    display: flex; justify-content: center; align-items: center; transition: opacity 0.4s;
}

.play-hint { position: relative; display: flex; justify-content: center; align-items: center; }
.play-hint i { font-size: 3rem; color: rgba(255,255,255,0.9); z-index: 2; }
.pulse-ring {
    position: absolute; width: 70px; height: 70px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5); animation: ping 2s infinite;
}
@keyframes ping { 0% {transform: scale(1); opacity: 1;} 100% {transform: scale(2); opacity: 0;} }

/* UI Bottom Only */
.s-ui-bottom {
    position: absolute; bottom: 0; left: 0; right: 0; /* Full width */
    padding: 20px 15px 90px 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    z-index: 5; pointer-events: none;
}
.s-user { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.avatar { width: 34px; height: 34px; background: white; color: black; border-radius: 50%; display: grid; place-items: center; font-weight: bold; }
.username { font-weight: 700; color: white; font-size: 1rem; }
.s-desc { font-size: 0.95rem; line-height: 1.3; margin-bottom: 5px; text-shadow: 0 1px 2px black; }

/* Heart Animation */
.heart-pop {
    position: absolute; font-size: 5rem; color: var(--primary);
    opacity: 0; transform: translate(-50%, -50%) scale(0);
    z-index: 20; pointer-events: none;
}
.heart-pop.animate { animation: popLike 0.8s ease-out; }
@keyframes popLike { 0% {opacity:1; transform:translate(-50%,-50%) scale(0.5) rotate(-15deg);} 50% {transform:translate(-50%,-50%) scale(1.2) rotate(15deg);} 100% {opacity:0; transform:translate(-50%,-50%) scale(1.5) rotate(0deg) translateY(-100px);} }

/* =========================================
   6. PROFILE & NAV
   ========================================= */
.profile-hero {
    text-align: center; padding: 40px 20px;
    background: linear-gradient(to bottom, #1a1a1a, transparent);
}
.profile-avatar {
    width: 90px; height: 90px; border-radius: 50%; background: #000;
    margin: 0 auto 15px; display: grid; place-items: center; font-size: 2.5rem; color: var(--accent);
    border: 2px solid var(--accent); box-shadow: 0 0 20px rgba(0, 242, 234, 0.2);
}
.stats-row { display: flex; justify-content: center; gap: 30px; margin-top: 20px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.2rem; } .stat span { font-size: 0.8rem; color: #888; }

.bottom-nav {
    position: absolute; bottom: 20px; left: 20px; right: 20px;
    height: 65px; border-radius: 20px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    color: #666; font-size: 0.7rem; gap: 4px; text-decoration: none; transition: 0.3s;
}
.nav-icon { font-size: 1.4rem; transition: 0.3s; }
.bottom-nav a.active { color: white; }
.bottom-nav a.active .nav-icon { color: var(--primary); transform: translateY(-3px); filter: drop-shadow(0 0 8px var(--primary)); }

@media (min-width: 768px) { .bottom-nav { width: 90%; margin: 0 auto; } }
