
/* --- Mobile Navigation --- */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
    transition: all 0.3s;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.mobile-menu-btn:hover {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-left {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px; /* Fixed width sidebar */
        height: 100vh;
        background: rgba(12, 12, 14, 0.98);
        border-right: 1px solid rgba(212, 175, 55, 0.3);
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 70px 20px 30px 20px; /* Space for the button */
        box-shadow: 10px 0 50px rgba(0,0,0,0.8);
        display: block !important; /* Override any potential hiding */
    }

    .sidebar-left.active {
        transform: translateX(0);
    }
    
    /* Ensure nav items look good in the drawer */
    .sidebar-left .nav-btn {
        background: transparent;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 12px 0;
    }
    
    .sidebar-left .nav-btn:hover {
        padding-left: 10px;
        background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent);
    }
}

/* --- Mobile Chat System --- */
@media (max-width: 768px) {
    /* Override existing styles */
    .chat-panel {
        height: calc(100vh - 140px); /* Adjust based on header/footer */
        margin-top: 10px;
        margin-bottom: 0;
    }

    /* List View (Default) */
    .chat-panel:not(.mobile-chat-active) .conversations-list {
        width: 100%;
        height: 100%;
        border: none;
        display: flex;
    }

    .chat-panel:not(.mobile-chat-active) .chat-main {
        display: none;
    }

    /* Active Chat View */
    .chat-panel.mobile-chat-active .conversations-list {
        display: none;
    }

    .chat-panel.mobile-chat-active .chat-main {
        display: flex;
        width: 100%;
        height: 100%;
    }

    /* Back Button */
    .mobile-back-btn {
        display: inline-block !important;
    }

    /* Fix Input Area */
    .chat-input-area {
        padding: 10px;
        background: #1a1a1a; /* Dark background for visibility */
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .chat-input-area input {
        font-size: 16px; /* Prevent iOS zoom */
        height: 40px;
    }

    .chat-input-area button {
        height: 40px;
        padding: 0 15px;
    }
    
    /* Hide Right Sidebar on mobile messages page to give more space */
    /* .sidebar-right {
        display: none; 
    } */
}
