/* WePlay India - Royal Blue (#0066FF) Theme + YouTube/Instagram/Mobile UX */
:root {
    --brand-blue: #0066FF;
    --brand-navy: #0F172A;
    --brand-dark: #020617;
    --brand-yt: #FF0000;
}

body {
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: rgba(156, 163, 175, 0.5); border-radius: 10px; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.modal-scroll::-webkit-scrollbar { width: 4px; }
.modal-scroll::-webkit-scrollbar-thumb { background: rgba(156, 163, 175, 0.4); border-radius: 10px; }

/* Glassmorphism */
.glass-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 50;
}
.dark .glass-header {
    background: rgba(2, 6, 23, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.dark .glass-panel {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bento-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
}
.dark .bento-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-gradient {
    background: linear-gradient(135deg, #0066FF 0%, #3B82F6 100%);
    color: white;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-gradient:active { transform: scale(0.95); }

.video-card img { transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1); }

/* Desktop Sidebar Collapsed Mini-Rail State */
@media (min-width: 1024px) {
    aside#sidebar {
        width: 16rem;
        transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
    }
    main#main-container {
        margin-left: 16rem;
        transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.sidebar-collapsed aside#sidebar {
        width: 4.75rem;
    }
    body.sidebar-collapsed main#main-container {
        margin-left: 4.75rem;
    }
    body.sidebar-collapsed aside#sidebar .nav-label,
    body.sidebar-collapsed aside#sidebar .sidebar-section-title,
    body.sidebar-collapsed aside#sidebar .sidebar-footer-links,
    body.sidebar-collapsed aside#sidebar .follow-name,
    body.sidebar-collapsed aside#sidebar .follow-remove {
        display: none !important;
    }
    body.sidebar-collapsed aside#sidebar .nav-link-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Mobile Bottom Nav Auto-Hide on Scroll Down, Show on Scroll Up */
#mobile-bottom-nav {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
#mobile-bottom-nav.nav-hidden {
    transform: translateY(115%);
}

/* YouTube-style Pull-to-Refresh Spinner */
#ptr-indicator {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translate(-50%, -80px) scale(0.8);
    z-index: 9998;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
    opacity: 0;
    pointer-events: none;
}
#ptr-indicator.visible {
    opacity: 1;
}

/* Instagram-Style Explore Tile Grid */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
}
@media (min-width: 768px) {
    .explore-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }
}
.explore-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #0f172a;
}
.explore-tile.tile-tall {
    grid-row: span 2;
    aspect-ratio: auto;
}
@media (min-width: 768px) {
    .explore-tile {
        border-radius: 1rem;
    }
}

/* Reels Snap Viewport */
.reels-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
}
.reel-item {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100%;
    width: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
}
.reel-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }
.pt-safe { padding-top: env(safe-area-inset-top, 0px); }

body.reels-page { overflow: hidden; }
@media (max-width: 1023px) {
    body.reels-page #app-topnav { display: none !important; }
    body.reels-page #content-wrapper { padding-top: 0 !important; }
    body.reels-page #main-container { padding: 0 !important; }
    body.reels-page #reels-view {
        position: fixed;
        inset: 0;
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        height: auto;
        width: 100vw;
        margin: 0 !important;
    }
    body.reels-page #reels-grid { height: 100%; border-radius: 0; }
}

@media (max-width: 639px) {
    #notification-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-height: 75dvh !important;
        border-radius: 1.75rem 1.75rem 0 0 !important;
        z-index: 99999 !important;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }
}
