/* Chat Widget Styles */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Prompt', sans-serif;
}

#chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
}

#chat-toggle-btn:hover {
    transform: scale(1.1);
}

#chat-box {
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
}

#chat-header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.chat-status {
    font-size: 12px;
    background: #eef2ff;
    color: #374151;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
}
.status-waiting { background: #FFF7E6; color: #B45309; }
.status-answered { background: #ECFDF5; color: #065F46; }
.status-closed { background: #F3F4F6; color: #6B7280; }

#chat-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    background-color: white;
    display: none; /* Hidden until live chat mode */
}

#chat-input-area {
    display: flex;
    gap: 5px;
}

#chat-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

#chat-send-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

.message.bot {
    align-self: flex-start;
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message.user {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.admin {
    align-self: flex-start;
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
    border: 1px solid #007bff;
}

/* Options/Buttons */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
}

.chat-option-btn {
    background-color: white;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background-color: #007bff;
    color: white;
}

.chat-actions {
    margin-top: 10px;
    text-align: center;
}

.contact-admin-btn {
    font-size: 12px;
    color: #6c757d;
    text-decoration: underline;
    cursor: pointer;
}

.chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    display: none;
}
