/* Mobile Header & Hamburger Menu */

/* Hamburger Button - Hidden on desktop */
.hamburger-btn {
    display: none;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.hamburger-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

/* Mobile Menu Header */
.mobile-menu-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-title {
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Mobile Menu Items */
.mobile-menu-items {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu-item {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-5px);
}

.mobile-menu-item.active {
    background: white;
    color: #667eea;
}

.mobile-menu-item.danger {
    background: rgba(220, 53, 69, 0.8);
}

.mobile-menu-item.danger:hover {
    background: rgba(220, 53, 69, 1);
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.mobile-menu-footer small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Desktop: Show nav buttons, hide hamburger */
@media (min-width: 769px) {
    .hamburger-btn {
        display: none !important;
    }
    
    .header-nav {
        display: flex !important;
    }
    
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile: Hide nav buttons, show hamburger */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }
    
    .header-nav {
        display: none !important;
    }
    
    .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .header-title {
        font-size: 18px !important;
    }
    
    .header {
        padding: 15px !important;
    }
}

/* Extra-small screens: prevent header overflow */
@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap !important;
        row-gap: 8px !important;
    }

    .header-title {
        min-width: 0;
        flex: 1 1 auto;
        gap: 8px;
    }

    .header-title span {
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #userEmailDisplay {
        width: 100%;
        order: 3;
        text-align: right;
        margin-top: 4px;
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    .hamburger-btn {
        order: 2;
    }

    .logo-container img {
        height: 56px;
        width: 56px;
    }
}
