/* =====================================================
   THEME SYSTEM - Dark Mode (Default) & Light Mode
   ===================================================== */
:root {
    /* Dark Theme (Default) */
    --bg-dark: #000000;
    --bg-card: #1a1a1a;
    --bg-secondary: #222222;
    --bg-tertiary: #333333;
    --accent: #00ffff;
    --accent-hover: #00cccc;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --overlay-gradient: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
}

/* Light Theme - Applied when html or body has .light-mode class */
html.light-mode,
body.light-mode {
    --bg-dark: #f5f5f7;
    --bg-card: #ffffff;
    --bg-secondary: #f0f0f2;
    --bg-tertiary: #e5e5e7;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --text-main: #1d1d1f;
    --text-muted: #6e6e73;
    --border-color: #d2d2d7;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --overlay-gradient: linear-gradient(to bottom, rgba(245, 245, 247, 0.95), transparent);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding-bottom: 70px;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Smooth theme transition */
}

.app-container {
    width: 100%;
    max-width: 100%;
    /* Fully responsive */
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--overlay-gradient);
    transition: background 0.3s ease;
}

.top-bar h1 {
    margin: 0;
    font-size: 1.2rem;
}

.accent {
    color: var(--accent);
}

.header-icons span {
    margin-left: 15px;
    font-size: 28px;
}

/* Search */
.search-container {
    padding: 0 20px;
}

.search-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    margin-left: 10px;
    width: 100%;
    outline: none;
    font-size: 1rem;
}

/* Categories */
.categories-scroll {
    display: flex;
    overflow-x: auto;
    padding: 20px;
    gap: 10px;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chip.active,
.chip:hover {
    background: var(--accent);
    color: var(--bg-dark);
    font-weight: bold;
}

/* Quick Access Icons */
.icons-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 20px 15px 20px;
    gap: 20px;
    scrollbar-width: none;
}

.icons-scroll::-webkit-scrollbar {
    display: none;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 60px;
    transition: transform 0.2s;
}

.icon-item:hover {
    transform: scale(1.1);
}

.icon-item img {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.3s ease;
}

.icon-item:hover img {
    border-color: var(--accent);
}

.icon-item span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content */
.content-area {
    padding: 0 20px;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-bar h3 {
    margin: 0;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.section-title {
    margin: 20px 0 10px 0;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Grid */
.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.video-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 9/16;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    box-sizing: border-box;
}

.card-title {
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    gap: 4px;
    cursor: pointer;
}

.nav-item.active {
    color: var(--text-main);
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.bottom-sheet.open {
    display: flex;
}

.sheet-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    animation: slideUp 0.3s;
    transition: background 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.chips-row {
    display: flex;
    gap: 10px;
}

.chip-outline {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chip-outline.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 200, 200, 0.1);
}

.btn-apply {
    width: 100%;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}