:root { 
    /* Original Theme Variables */
    --yt-bg: #0f172a; 
    --text: #f8fafc; 
    --accent: #38bdf8; 
    --text-soft: #9ca3af;
    
    /* Global Clean Theme Variables */
    --bg-color: #f1f3f4;
    --card-bg: #ffffff;
    --text-main: #202124;
    --text-muted: #5f6368;
    --border-color: #dadce0;
    --accent-blue: #1a73e8;
    --hover-bg: #e8eaed;
}

/* ==========================================================================
   1. BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f1f5f9;
    color: #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   2. HEADER & BRANDING
   ========================================================================== */
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1;
}

.logo-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0%, #38bdf8, transparent 55%),
        radial-gradient(circle at 70% 100%, #0ea5e9, transparent 55%),
        linear-gradient(145deg, #020617, #0b1120);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.6), 0 18px 45px rgba(15, 23, 42, 0.95);
    flex-shrink: 0;
}

.logo-circle span {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #e5f2ff;
}

.brand-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-soft);
}

/* ==========================================================================
   3. MAIN FEED & DISCOVER CARDS
   ========================================================================== */
.main-content-wrapper {
    padding: 10px;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.section-heading {
    font-size: 24px;
    font-weight: 800;
    padding: 20px 16px 0;
    max-width: 1600px; 
    margin: 0 auto; 
    color: #1e293b;
    width: 100%;
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    padding: 16px;
    max-width: 1200px; 
    margin: 0 auto; 
    padding-bottom: 80px;
    width: 100%;
}

.discover-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
    animation: fadeIn 0.5s ease;
}

.discover-card:hover {
    transform: translateY(-2px);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.discover-card img {
    width: 100%;
    height: 250px; 
    object-fit: cover;
    background: #e2e8f0;
}

.discover-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.discover-label {
    color: #3498db;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.discover-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.discover-summary {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: auto;
    gap: 0.4rem;
}

.card-actions button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    font-size: 14px;
    transition: color 0.2s;
    color: #000;
    font-weight: 600;
}

.card-actions button:hover {
    background-color: #f1f5f9;
    border-radius: 4px;
}

.card-actions button.liked,
.card-actions button.liked .count {
    color: #ef4444 !important;
}

/* ==========================================================================
   4. MODAL & COMMENTS
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: pop 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.comment-input-area {
    margin-bottom: 20px;
}

.comment-input {
    width: 100%;
    height: 80px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    font-family: inherit;
    resize: none;
    color: #000;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

#commentsList {
    flex-grow: 1;
    overflow-y: auto;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 10px;
}

.comment-item {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.comment-user {
    font-weight: 700;
    color: #ffffff;
}

.comment-body {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
    white-space: pre-wrap;
}

.no-comments {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-style: italic;
}

/* ==========================================================================
   5. LOADER & ANIMATIONS
   ========================================================================== */
.loading-indicator {
    width: 100%;
    text-align: center;
    padding: 40px;
    display: none;
    grid-column: 1 / -1;
}

.loading-indicator.active {
    display: block;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #cbd5e1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 14px;
    white-space: nowrap;
}

/* ==========================================================================
   6. MOBILE MENU MODAL
   ========================================================================== */
.mobile-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    overflow-y: auto;
    display: none; 
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu-modal.active {
    display: block;
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #f8fafc;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    padding: 10px;
}

.mobile-menu-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
}

.mobile-menu-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    padding-top: 10px;
}

.mobile-menu-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f8fafc;
}

.mobile-menu-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    letter-spacing: 2px;
}

.mobile-search-container {
    margin-bottom: 20px;
}

.mobile-search-form {
    display: flex;
}

.mobile-search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 8px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.mobile-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f8fafc;
    padding: 10px;
    font-size: 16px;
    outline: none;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: #f8fafc;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 1.1rem;
}

.mobile-menu-link:hover, .mobile-menu-link.active {
    background: rgba(56, 189, 248, 0.1);
}

.mobile-menu-link i {
    width: 25px;
    text-align: center;
    color: #38bdf8;
}

.mobile-sub-menu {
    display: flex;
    flex-direction: column;
    padding-left: 55px;
    margin-bottom: 10px;
    gap: 2px;
}

.mobile-sub-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 8px 0;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.mobile-sub-link:hover, .mobile-sub-link.active {
    color: #38bdf8;
}

.mobile-menu-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.mobile-menu-footer-title {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-action {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    text-decoration: none;
    padding: 8px 0;
    font-size: 1rem;
}

.mobile-menu-action i {
    width: 20px;
    text-align: center;
    color: #94a3b8;
}

/* Logo wrapper button for toggle functionality */
.mobile-menu-toggle {
    display: none; /* hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
    outline: none;
}

/* ==========================================================================
   7. SIDEBAR & MORE MENU (DESKTOP) - COLLAPSIBLE
   ========================================================================== */
.yt-sidebar {
    width: 76px !important; 
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden !important; 
    overflow-y: auto !important;
    z-index: 1000;
    border-right: 1px solid #eff3f4;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded behavior covers both :hover and .expanded class toggled by JS */
.yt-sidebar:hover,
.yt-sidebar.expanded {
    width: 240px !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}

/* Sidebar Brand Layout */
.yt-sidebar .brand {
    padding: 20px 21px; 
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 74px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    background: inherit;
    z-index: 2;
    margin: 0;
}

.yt-sidebar:hover .brand,
.yt-sidebar.expanded .brand {
    padding: 20px 15px;
}

.yt-sidebar .brand-text {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    margin-left: 10px;
}

.yt-sidebar:hover .brand-text,
.yt-sidebar.expanded .brand-text {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Search Layout */
.yt-sidebar .sidebar-search {
    padding: 0 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid #2f3336;
    padding-bottom: 20px;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.yt-sidebar:hover .sidebar-search,
.yt-sidebar.expanded .sidebar-search {
    padding: 0 15px;
}

.yt-sidebar .search-icon-collapsed {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    color: #94a3b8;
    position: absolute;
    left: 16px;
    top: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
    cursor: pointer;
}

.yt-sidebar:hover .search-icon-collapsed,
.yt-sidebar.expanded .search-icon-collapsed {
    opacity: 0;
    pointer-events: none;
}

.yt-sidebar .yt-search {
    opacity: 0;
    pointer-events: none;
    width: 210px;
    transition: opacity 0.2s ease;
    margin: 0;
}

.yt-sidebar:hover .yt-search,
.yt-sidebar.expanded .yt-search {
    opacity: 1;
    pointer-events: auto;
}

.yt-sidebar .yt-search-input {
    width: 100%;
    border-radius: 9999px;
    padding: 10px 15px;
    background: #202327;
    color: white;
    border: none;
    outline: none;
}

/* Sidebar Navigation Styling */
.sidebar-main-nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    margin-bottom: 0;
    padding-bottom: 10px;
    flex-grow: 1; 
    overflow-y: auto; 
    overflow-x: hidden;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.sidebar-main-nav::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}
.sidebar-main-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
}
.sidebar-main-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5); 
}
.sidebar-main-nav:hover {
    scrollbar-width: thin; 
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent; 
}

.sidebar-divider {
    height: 1px;
    background: #2f3336;
    margin: 10px 15px;
}

.sidebar-main-nav a.nav-item-link {
    padding: 12px 14px;
    margin: 0 14px;
    text-decoration: none;
    color: #e7e9ea;
    display: flex;
    align-items: center;
    border-radius: 9999px;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    width: 48px;
    box-sizing: border-box;
    overflow: hidden;
}

.yt-sidebar:hover .sidebar-main-nav a.nav-item-link,
.yt-sidebar.expanded .sidebar-main-nav a.nav-item-link {
    width: calc(100% - 30px);
    margin: 0 15px;
    padding: 12px 15px;
}

.sidebar-main-nav a.nav-item-link i {
    min-width: 20px;
    text-align: center;
    margin-right: 0;
    transition: margin 0.2s ease;
}

.yt-sidebar:hover .sidebar-main-nav a.nav-item-link i,
.yt-sidebar.expanded .sidebar-main-nav a.nav-item-link i {
    margin-right: 15px;
}

.nav-label {
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.yt-sidebar:hover .nav-label,
.yt-sidebar.expanded .nav-label {
    opacity: 1;
}

.sidebar-main-nav a.nav-item-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-main-nav a.active {
    font-weight: 700;
}

/* Sidebar Sub Menu */
.desktop-sub-menu {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-bottom: 5px;
    margin-top: -5px;
}

.sidebar-main-nav .desktop-sub-menu a.nav-item-link {
    font-size: 0.95rem;
    border-left: 2px solid transparent; 
    border-radius: 9999px;
}

.yt-sidebar:hover .sidebar-main-nav .desktop-sub-menu a.nav-item-link,
.yt-sidebar.expanded .sidebar-main-nav .desktop-sub-menu a.nav-item-link {
    padding: 8px 15px 8px 30px;
    border-radius: 0 9999px 9999px 0;
    margin: 0 15px 0 0;
    width: calc(100% - 15px);
}

.sidebar-main-nav .desktop-sub-menu a.nav-item-link:hover,
.sidebar-main-nav .desktop-sub-menu a.nav-item-link.active {
    color: #38bdf8;
    background-color: transparent;
    border-left: 2px solid #38bdf8; 
}

/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1100px) {
    .brand-title { font-size: 0.85rem; }
}

@media (max-width: 768px) {
    .card-actions {
        justify-content: space-between;
    }
    .mobile-menu-toggle { display: block; } /* Show the logo toggle on mobile */
    .top-actions { margin-left: auto; gap: 12px; }
    .brand-subtitle { display: block; font-size: 0.7rem; }
    .yt-sidebar {
        display: none !important;
    }
    body {
        margin-right: 0;
    }
    .main-content-wrapper {
        padding: 10px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-modal {
        display: none !important;
    }
    body {
        padding-left: 76px; 
    }
    .main-content-wrapper {
        margin: 0 auto !important; 
        padding: 20px !important; 
    }
}

@media (prefers-color-scheme: dark) {
    .yt-sidebar {
        background-color: #000000;
        border-color: #2f3336;
    }
    .sidebar-main-nav a.nav-item-link {
        color: #e7e9ea;
    }
    .sidebar-main-nav a.nav-item-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-main-nav:hover::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
    }
    .sidebar-main-nav:hover {
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }
    
    .sidebar-main-nav .desktop-sub-menu a.nav-item-link {
        color: #94a3b8 !important; 
    }
    .sidebar-main-nav .desktop-sub-menu a.nav-item-link:hover,
    .sidebar-main-nav .desktop-sub-menu a.nav-item-link.active {
        color: #38bdf8 !important;
    }
}

/* ==========================================================================
   9. MOBILE HEADER STYLES
   ========================================================================== */
.mobile-header {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: transparent; 
    border-bottom: none; 
    z-index: 9000;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    body {
        padding-top: 65px;
    }
}

/* ==========================================================================
   10. INDEX.PHP HOME & CLEAN THEME OVERRIDES
   ========================================================================== */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.main-content-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-container {
    width: 100%;
    max-width: 700px;
    position: relative;
    margin: 10px auto 25px auto;
}
.search-input {
    width: 100%;
    padding: 16px 50px 16px 45px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}
.search-input:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.search-icon-left {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.search-icon-left:hover {
    color: var(--text-main);
}
.search-icon-right {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.search-icon-right:hover {
    color: var(--text-main);
}

.menu-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto 25px auto;
    max-width: 100%;
}
.menu-heading {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
}

.scroll-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    background: #ffffff; 
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25); 
    color: #202124; 
    transition: opacity 0.2s, background 0.2s, transform 0.1s;
    opacity: 0; 
    pointer-events: none; 
}
.scroll-arrow.visible {
    opacity: 1;
    pointer-events: auto;
}
.scroll-arrow:hover {
    background: var(--hover-bg);
}
.scroll-arrow:active {
    transform: translateY(-50%) scale(0.9);
}
.left-arrow { left: 5px; }
.right-arrow { right: 5px; }

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 5px 10px 15px 10px;
    width: 100%;
    justify-content: safe center;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.horizontal-scroll::-webkit-scrollbar {
    display: none;
}
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 85px; 
    min-width: 85px;
    max-width: 85px;
    padding: 15px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    box-sizing: border-box;
}
.menu-item:active {
    transform: scale(0.95);
}
.menu-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    display: block;
}
.menu-item i {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.menu-item:hover {
    background-color: var(--hover-bg);
}

.favorites-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 10px 0;
    max-height: 50vh;
    overflow-y: auto;
}
.favorite-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
    color: #202124; 
}
.favorite-option:hover {
    background-color: var(--hover-bg);
}
.favorite-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
}

.section-heading {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 15px;
    align-self: flex-start;
    width: 100%;
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.discover-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.discover-card img {
    width: 100%;
    height: 250px; 
    object-fit: cover;
}
.discover-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.discover-card-title {
    font-size: 18px; 
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.4;
}
.discover-card-title a:hover {
    text-decoration: underline !important;
}
.card-actions {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto; 
}
.card-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}
.card-actions button:hover { color: var(--text-main); }
.card-actions .liked { color: #d93025; }

.spinner { border: 3px solid #f3f3f3; border-top: 3px solid var(--accent-blue); border-radius: 50%; width: 24px; height: 24px; margin: 0 auto; }
.loading-indicator { display: none; padding: 20px; width: 100%; }
.loading-indicator.active { display: block; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: flex-end; }
.modal.active { display: flex; }
.modal-content { background: var(--card-bg); width: 100%; max-width: 600px; height: 80vh; border-radius: 20px 20px 0 0; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; position: relative; }
.close-modal { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.comment-input-area { display: flex; gap: 10px; margin-bottom: 20px; }
.comment-input { flex-grow: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; resize: none; font-family: inherit; }
.btn-primary { background: var(--accent-blue); color: white; border: none; border-radius: 8px; padding: 0 20px; cursor: pointer; font-weight: 500; }
#commentsList { overflow-y: auto; flex-grow: 1; }
.comment-item { padding: 12px 0; border-bottom: 1px solid #eee; }
.comment-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.comment-user { font-weight: bold; color: #ffffff; }
.comment-body { font-size: 14px; line-height: 1.4; color: #ffffff; }

.article-modal-content { max-width: 800px; height: auto; max-height: 90vh; padding: 25px; overflow-y: auto; box-sizing: border-box; text-align: left;}
.article-modal-content .close-modal { top: 15px; right: 15px; z-index: 10; background: var(--hover-bg); border-radius: 50%; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.article-modal-content .close-modal:hover { background: #dadce0; }

@media (max-width: 768px) {
    .main-content-wrapper { padding: 15px 10px; }
    .search-container { margin-bottom: 15px; }
    .menu-section { margin-bottom: 15px; }
    .article-modal-content { height: 85vh; border-radius: 12px 12px 0 0; }
    .scroll-arrow { display: none !important; }
    .horizontal-scroll {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   11. TABLET SIDEBAR TOGGLE (TOUCH DEVICES)
   ========================================================================== */
.sidebar-touch-toggle {
    display: none;
    position: fixed !important;
    left: 76px;
    top: 50vh !important;
    margin-top: -35px !important; /* Half of height to center perfectly without transform */
    width: 28px !important;
    height: 70px !important;
    background: #ffffff !important;
    border: 1px solid #dadce0 !important;
    border-left: none !important;
    border-radius: 0 16px 16px 0 !important;
    z-index: 10000 !important;
    cursor: pointer;
    padding: 0 !important;
    box-shadow: 4px 0 12px rgba(0,0,0,0.1) !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
}

/* Force specific coloring and layout on the icon to avoid browser override */
.sidebar-touch-toggle i {
    color: #38bdf8 !important;
    font-size: 16px !important;
    display: block !important;
}

/* Enable only for coarse pointers (touch screens) where sidebar exists (width >= 769px) */
@media (pointer: coarse) and (min-width: 769px) {
    .sidebar-touch-toggle {
        display: flex !important; /* using flex to center the icon */
    }
}

/* Move handle seamlessly when sidebar expands */
.yt-sidebar.expanded ~ .sidebar-touch-toggle,
.yt-sidebar.expanded + .sidebar-touch-toggle {
    left: 240px !important;
}

/* Dark mode overrides for the tab handle */
@media (prefers-color-scheme: dark) {
    .sidebar-touch-toggle {
        background: #0f172a !important;
        border-color: #2f3336 !important;
    }
}