/**
 * Chat Modal Styles
 */

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

.chat-modal.open {
    display: flex;
}

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

.chat-modal-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.chat-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-modal-footer {
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #6c757d;
    cursor: pointer;
}

.close-modal-btn:hover {
    color: #343a40;
}

/* Agent info styles */
.agent-info {
    display: flex;
    align-items: center;
}

.agent-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-details h5 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

/* Status badge styles */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.status-available {
    background-color: #28a745;
    color: white;
}

.status-busy {
    background-color: #ffc107;
    color: #212529;
}

.status-offline {
    background-color: #6c757d;
    color: white;
}

/* Chat messages styles */
.chat-messages {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.message {
    max-width: 80%;
    margin-bottom: 15px;
    position: relative;
    clear: both;
}

.message.agent {
    align-self: flex-start;
}

.message.client {
    align-self: flex-end;
}

.message .message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message.agent .message-bubble {
    background-color: #f1f0f0;
    border-bottom-left-radius: 4px;
}

.message.client .message-bubble {
    background-color: #0084ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message .message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 3px;
}

.message.agent .message-time {
    text-align: left;
}

.message.client .message-time {
    text-align: right;
}

/* Input field styles */
.chat-input {
    width: 100%;
}

.chat-input .form-control {
    border-radius: 20px;
    padding-left: 15px;
}

.chat-input .btn {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #bbb;
    display: block;
    border-radius: 50%;
    margin-right: 5px;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .chat-modal-content {
        width: 95%;
        height: 90%;
        max-height: none;
    }
}
