/* ===== MOBILE OPTIMIZATION ADDON ===== */
/* Thêm vào cuối file gaming-theme-optimized.css hoặc gaming-theme-enhanced.css */

/* ===== DISCORD SIDEBAR - MOBILE OPTIMIZATION ===== */

/* Desktop: Hiện Discord sidebar bình thường */
@media (min-width: 1201px) {
    .mobile-discord-toggle {
        display: none !important;
    }
    
    .discord-overlay {
        display: none !important;
    }
    
    #left-sidebar .mobile-close-btn {
        display: none !important;
    }
}

/* Mobile & Tablet: Ẩn Discord, hiện toggle button */
@media (max-width: 1200px) {
    /* ===== DISCORD SIDEBAR ===== */
    
    /* Ẩn hoàn toàn Discord sidebar mặc định */
    #left-sidebar {
        transform: translateX(-100%) !important;
        top: 0 !important;
        width: 85% !important;
        max-width: 320px !important;
        box-shadow: 4px 0 50px rgba(0, 0, 0, 0.9) !important;
        z-index: 1002 !important;
    }
    
    /* Hiện khi có class show-mobile */
    #left-sidebar.show-mobile {
        transform: translateX(0) !important;
    }
    
    /* Content không margin left */
    .tight-space {
        margin-left: 0 !important;
    }
    
    /* Ẩn desktop toggle button */
    #toggle-widget {
        display: none !important;
    }
    
    /* ===== MOBILE TOGGLE BUTTON ===== */
    .mobile-discord-toggle {
        position: fixed;
        left: 16px;
        bottom: 90px;
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, #5865F2, #4752C4);
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 4px 20px rgba(88, 101, 242, 0.7),
                    0 0 0 4px rgba(88, 101, 242, 0.2);
        border: 3px solid rgba(255, 255, 255, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-discord-toggle:hover {
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 6px 30px rgba(88, 101, 242, 0.9),
                    0 0 0 6px rgba(88, 101, 242, 0.3);
    }
    
    .mobile-discord-toggle:active {
        transform: scale(0.95);
    }
    
    .mobile-discord-toggle i {
        font-size: 28px;
        color: white;
    }
    
    /* Badge thông báo (optional) */
    .mobile-discord-toggle::after {
        content: '';
        position: absolute;
        top: 8px;
        right: 8px;
        width: 12px;
        height: 12px;
        background: #ff4444;
        border-radius: 50%;
        border: 2px solid #4752C4;
        animation: pulse 2s ease-in-out infinite;
        display: none; /* Hiện khi có notification */
    }
    
    .mobile-discord-toggle.has-notification::after {
        display: block;
    }
    
    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
            opacity: 1;
        }
        50% {
            transform: scale(1.2);
            opacity: 0.8;
        }
    }
    
    /* ===== OVERLAY ===== */
    .discord-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(6px);
        z-index: 1001;
        display: none;
        animation: fadeIn 0.3s ease;
    }
    
    .discord-overlay.active {
        display: block;
    }
    
    /* ===== CLOSE BUTTON TRONG SIDEBAR ===== */
    #left-sidebar .mobile-close-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        background: rgba(255, 59, 48, 0.2);
        border: 2px solid rgba(255, 59, 48, 0.5);
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s ease;
    }
    
    #left-sidebar .mobile-close-btn:hover {
        background: rgba(255, 59, 48, 0.9);
        border-color: #ff3b30;
        transform: rotate(90deg);
    }
    
    #left-sidebar .mobile-close-btn i {
        font-size: 22px;
        color: white;
    }
    
    /* ===== DISCORD WIDGET ADJUSTMENT ===== */
    .discord-widget {
        padding-top: 60px !important; /* Space for close button */
    }
}

/* ===== MOBILE SMALL (<768px) ===== */
@media (max-width: 768px) {
    #left-sidebar {
        width: 90% !important;
        max-width: 300px !important;
    }
    
    .mobile-discord-toggle {
        width: 56px;
        height: 56px;
        left: 12px;
        bottom: 80px;
    }
    
    .mobile-discord-toggle i {
        font-size: 26px;
    }
}

/* ===== MOBILE EXTRA SMALL (<480px) ===== */
@media (max-width: 480px) {
    #left-sidebar {
        width: 95% !important;
        max-width: 280px !important;
    }
    
    .mobile-discord-toggle {
        width: 52px;
        height: 52px;
        left: 10px;
        bottom: 75px;
    }
    
    .mobile-discord-toggle i {
        font-size: 24px;
    }
}

/* ===== ACCESSIBILITY ===== */
.mobile-discord-toggle:focus-visible {
    outline: 3px solid #00d9ff;
    outline-offset: 4px;
}

#left-sidebar .mobile-close-btn:focus-visible {
    outline: 3px solid #ff3b30;
    outline-offset: 2px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

#left-sidebar.show-mobile {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PREVENT BODY SCROLL WHEN DISCORD OPEN ===== */
body.discord-open {
    overflow: hidden;
}

/* ===== END MOBILE OPTIMIZATION ===== */