/* chat.css */
.chat-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
}

.chat-modal {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    margin: 0;
    font-size: 1.2rem;
}

#close-chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f9f9f9;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.chat-message.sent {
    align-items: flex-end;
}

.chat-message.received {
    align-items: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    max-width: 75%;
    word-wrap: break-word;
}

.message-bubble.sent {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    background-color: #e9ecef;
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.chat-input-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--surface-border);
}

#chat-message-input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    margin-right: 0.5rem;
    resize: none;
}

#chat-file-input {
    display: none; /* Hide the actual input */
}

#chat-file-label {
    padding: 0.75rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--secondary-color);
    transition: color 0.3s;
}

#chat-file-label:hover {
    color: var(--primary-color);
}

#send-chat-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
}

/* File Attachment Styles */
.file-attachment {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    max-width: 250px;
}
.sent .file-attachment {
    background-color: rgba(255, 255, 255, 0.2);
}
.received .file-attachment {
    background-color: rgba(0, 0, 0, 0.05);
}

.file-attachment a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.file-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
