/* =========================================
   1. GLOBAL STYLES & RESET (PC Default)
   ========================================= */
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    background: #0f1015;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}


/* --- Top 10 Creators Horizontal Scrollable Row --- */
.top-creators-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox ke liye scrollbar hide */
}
.top-creators-row::-webkit-scrollbar {
    display: none; /* Chrome, Safari aur Opera ke liye scrollbar hide */
}

.top-creator-card {
    flex: 0 0 160px; /* Fixed width taaki cards horizontally scroll hon */
    height: 240px;
    background: #191b24;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #222531;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.top-creator-img-box {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.top-creator-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark Gradient Overlay for Text & Stats */
.top-creator-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 10px;
    background: linear-gradient(to top, rgba(15, 16, 21, 0.95) 10%, rgba(15, 16, 21, 0.6) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
}

.top-creator-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge {
    background: #e50914;
    color: #fff;
    font-size: 9px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-creator-stats {
    font-size: 11px;
    color: #b2b5c4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Mobile View Adjustments --- */
@media(max-width: 768px) {
    .top-creator-card {
        flex: 0 0 135px;
        height: 200px;
    }
    .top-creator-name {
        font-size: 11px;
    }
    .top-creator-stats {
        font-size: 10px;
    }
}
/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Desktop Sidebar */
.sidebar {
    width: 240px;
    background: #13151c;
    border-right: 1px solid #222531;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-menu {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-item {
    padding: 10px 12px;
    border-radius: 6px;
    color: #bbb;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-item:hover, .sidebar-item.active {
    background: #1f222e;
    color: #e50914;
    font-weight: bold;
}
.sidebar-divider {
    height: 1px;
    background: #222531;
    margin: 10px 0;
}
.sidebar-title {
    font-size: 11px;
    color: #6c7086;
    padding: 5px 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Main Content Area (Desktop) */
.main-content {
    flex-grow: 1;
    padding: 20px;
    overflow-x: hidden;
}

/* Desktop Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #13151c;
    border-bottom: 1px solid #222531;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
}
.site-logo {
    font-size: 20px;
    font-weight: 900;
    color: #e50914;
    letter-spacing: 1px;
    text-decoration: none;
}
.search-bar input {
    width: 350px;
    padding: 8px 16px;
    background: #1f222e;
    border: 1px solid #2e3245;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

/* Sections & Grids (Desktop) */
.section-container {
    margin-bottom: 25px;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    border-bottom: 1px solid #222531;
    padding-bottom: 8px;
}
.section-title a {
    font-size: 13px;
    color: #e50914;
    text-decoration: none;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.creators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.creator-card-box {
    background: #191b24;
    border-radius: 8px;
    border: 1px solid #222531;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 140px;
}
.creator-card-box .story-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 2px solid #e50914;
    overflow: hidden;
    margin: 0 auto 8px auto;
}
.creator-card-box .story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.creator-name-txt {
    font-weight: bold;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.creator-sub-txt {
    font-size: 11px;
    color: #8c90a2;
    margin-top: 4px;
}

/* Stories Row */
.creators-stories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.creators-stories::-webkit-scrollbar {
    display: none;
}
.story-item {
    flex: 0 0 auto;
    text-align: center;
    width: 70px;
}
.story-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 2px solid #e50914;
    overflow: hidden;
    margin: 0 auto 5px auto;
}
.story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #bbb;
}

/* Video Card */
.video-card {
    background: #191b24;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #222531;
    display: flex;
    flex-direction: column;
}
.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
}
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(229, 9, 20, 0.85);
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}
.video-duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
}
.video-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}
.video-title {
    font-size: 13px;
    font-weight: bold;
    margin: 0;
    line-height: 1.3;
}
.video-title a {
    color: #fff;
    text-decoration: none;
}
.video-title a:hover {
    color: #e50914;
}
.video-meta {
    font-size: 11px;
    color: #8c90a2;
    display: flex;
    justify-content: space-between;
}

/* Hidden by default on PC */
.mobile-bottom-nav {
    display: none;
}


/* =========================================
   2. MOBILE EXACT MATCH VIEW (Screenshot View)
   ========================================= */
@media(max-width: 768px) {
    body {
        padding-bottom: 65px; /* Bottom nav space ke liye */
    }

    /* Sidebar hide on mobile */
    .sidebar {
        display: none !important;
    }
    
    /* Main content full width */
    .main-content {
        padding: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Exact Mobile Header */
    .site-header {
        height: 48px !important;
        padding: 6px 12px !important;
    }
    .site-logo {
        font-size: 16px !important;
    }
    .search-bar input {
        width: 120px !important;
        font-size: 11px !important;
        padding: 5px 10px !important;
    }

    /* Video Grid on Mobile (2 columns exactly like screenshot) */
    .video-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Top 10 Creators Grid on Mobile */
    .creators-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .creator-card-box {
        height: 120px !important;
        padding: 8px !important;
    }
    .creator-card-box .story-avatar {
        width: 50px !important;
        height: 50px !important;
    }
    .creator-name-txt {
        font-size: 11px !important;
    }
    .creator-sub-txt {
        font-size: 9px !important;
    }

    /* Video Card text adjustments */
    .video-title {
        font-size: 11px !important;
    }
    .video-meta {
        font-size: 9px !important;
    }

    /* EXACT MOBILE BOTTOM NAVIGATION BAR (Screenshot wala) */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #13151c;
        border-top: 1px solid #222531;
        justify-content: space-around;
        align-items: center;
        padding: 6px 0;
        z-index: 9999;
    }
    
    /* =========================================
   Mobile Slide-out Drawer & Overlay Styling
   ========================================= */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: none;
}
.drawer-overlay.active {
    display: block;
}

#mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    background: #13151c;
    border-right: 1px solid #222531;
    z-index: 100000;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#mobile-drawer.open {
    left: 0;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #222531;
    background: #13151c;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Drawer & Sidebar Menu Items Common Styling */
.sidebar-menu {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
/* --- Live Search Dropdown Styling --- */
#live-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #191b24;
    border: 1px solid #2e3245;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    z-index: 99999;
    max-height: 350px;
    overflow-y: auto;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid #222531;
    transition: background 0.2s;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover {
    background: #1f222e;
}

.live-search-item img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.live-search-item span {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #e4e6eb;
}

.sidebar-item {
    padding: 10px 12px;
    border-radius: 6px;
    color: #bbb;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-item:hover, .sidebar-item.active {
    background: #1f222e;
    color: #e50914;
    font-weight: bold;
}
.sidebar-divider {
    height: 1px;
    background: #222531;
    margin: 10px 0;
}
.sidebar-title {
    font-size: 11px;
    color: #6c7086;
    padding: 5px 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #8c90a2;
        text-decoration: none;
        font-size: 10px;
        gap: 2px;
    }
    .mobile-nav-item.active {
        color: #e50914;
    }
    .mobile-nav-fab {
        background: #e50914;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 20px;
        margin-top: -14px;
        box-shadow: 0 4px 10px rgba(229, 9, 20, 0.4);
        text-decoration: none;
    }
}