/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 10px;
        border-radius: 8px;
    }
    
    .search-section,
    .live-section,
    .directory-section,
    .stats,
    .controls {
        padding: 0 10px !important;
    }
    
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-right {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .theme-toggle-btn,
    .admin-btn {
        width: 100%;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
        padding: 7px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .filters-section {
        padding: 15px;
    }
    
    .column-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    table {
        font-size: 12px;
        min-width: 1000px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table td:first-child,
    table th:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 2;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
    
    body.dark-mode table td:first-child,
    body.dark-mode table th:first-child {
        background: #1e1e1e;
    }
    
    table .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .stream-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        background: white;
        color: var(--text-primary);
        border-radius: 16px;
        padding: 35px;
        max-width: 800px;
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    #loadMoreSection {
        padding: 20px 10px;
        font-size: 14px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    table {
        font-size: 13px;
    }
    
    .stream-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   MOBILE HAMBURGER MENU
   ============================================ */

/* Hide mobile-only elements on desktop */
.mobile-menu-toggle {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}

.mobile-menu-close {
    display: none !important;
}

@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
    }
    
    .header-text h1 {
        font-size: 1.2em;
    }
    
    .header-text p {
        display: none; /* Hide tagline on mobile */
    }
    
    /* Hamburger button */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: white;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 1.5em;
        cursor: pointer;
        margin-left: auto;
        transition: all 0.3s;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Overlay (darkens background when menu open) */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-menu-overlay.open {
        display: block;
        opacity: 1;
    }
    
    /* Slide-in menu */
    .header-right {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 80vw;
        height: 100vh;
        background: var(--card-bg);
        border-left: 2px solid var(--border-color);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        padding: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .header-right.open {
        transform: translateX(0);
    }
    
    /* Close button inside menu */
    .mobile-menu-close {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 15px;
        border-bottom: 2px solid var(--border-color);
        margin-bottom: 10px;
    }
    
    .mobile-menu-close h3 {
        margin: 0;
        color: var(--text-primary);
        font-size: 1.2em;
    }
    
    .mobile-menu-close button {
        background: none;
		display: none;
        border: none;
        font-size: 2em;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }
    
    /* Menu buttons */
    .header-right .header-btn {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        margin: 0;
        justify-content: flex-start;
        white-space: normal;
    }
    
    /* Admin controls in menu */
    .admin-controls {
        margin: 0 !important;
    }
    
    .admin-controls > div {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 15px !important;
    }
    
    .admin-controls .header-btn {
        width: 100%;
        margin: 0 0 8px 0 !important;
    }
}

/* Dark mode menu */
body.dark-mode .header-right {
    background: #1e1e1e;
    border-left-color: #3a3a3a;
}

body.dark-mode .mobile-menu-close h3 {
    color: #e0e0e0;
			display: none;
}

body.dark-mode .mobile-menu-close button {
    color: #adb5bd;
			display: none;
}

@media (max-width: 768px) {
    #twitchEmbedContainer > div {
        max-width: 100% !important;
    }
}