/* Chat Panel styles */
#chatPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 384px;
    height: 100%;
    background-color: white;
    transform: translateX(100%);
    visibility: hidden;
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.2s ease, visibility 0.2s ease;
    z-index: 30;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent overflow */
}

#chatPanel.open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
}

/* ===== Updated Header (Navbar) ===== */
.chat-panel-header {
    background-color: white;
    padding: 8px 14px; /* Reduced padding to match input */
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-panel-back {
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-panel-back svg {
    width: 100%;
    height: 100%;
}

.chat-panel-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-panel-userinfo {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.2;
}

.chat-panel-username {
    font-size: 16px;
    font-weight: 600;
    color: black;
}

.chat-panel-lastseen {
    font-size: 13px;
    color: #6b7280;
}

.chat-panel-menu {
    width: 24px;
    height: 24px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-panel-menu svg {
    width: 100%;
    height: 100%;
}

/* ===== Chat Body ===== */
.chat-panel-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f3f4f6;
    margin-bottom: 0; /* Ensure no gap before input */
}

.chat-panel-message {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
}

/* ===== Mobile Background ===== */
@media (max-width: 768px) {
    .chat-panel-content {
        background-image: url("https://i.ibb.co/HfvQJj50/Screenshot-20250730-222749.jpg");
        background-repeat: no-repeat;
        background-position: center top;
        background-size: cover;
        background-color: transparent;
    }
}
