/* =========================================================
   Zypps – Chat Module Styles
   ========================================================= */

/* Chat Modal & Container */
.chat-modal-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 375px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Admin Chat Modal (uses a <dialog>) */
#chat-modal {
    width: 500px;
    max-width: 90vw;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

#chat-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.chat-header {
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chat-header-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

/* Message History Area */
.chat-history-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    display: flex;
    width: 100%;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    word-wrap: break-word;
}

.chat-bubble p {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-sender {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.chat-timestamp {
    font-weight: 400;
}

/* Rider's messages (sent by the current user) */
.chat-message-rider {
    justify-content: flex-end;
}
.chat-message-rider .chat-bubble {
    background-color: var(--primary);
    color: white;
}
.chat-message-rider .chat-sender {
    color: rgba(255, 255, 255, 0.8);
}

/* Driver's messages (received by the current user) */
.chat-message-driver {
    justify-content: flex-start;
}
.chat-message-driver .chat-bubble {
    background-color: var(--bg);
    border: 1px solid var(--border);
}

/* Message Input Area */
.chat-input-area {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex-grow: 1;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.6rem;
}

.chat-input-area button {
    border-radius: var(--radius-sm);
}