/* Chat Plugin Styles */

/* General chat container */
.chat-container {
    width: 100%;
    max-width: 500px;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #e5ddd5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    font-family: 'Arial', sans-serif;
}

/* Chat header */
.chat-header {
    background-color: #075e54;
    color: white;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.consultant-availability {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
}

.availability-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background-color: #dc3545;
}

.consultant-availability.available .availability-dot {
    background-color: #28a745;
}

.consultant-availability.unavailable .availability-dot {
    background-color: #dc3545;
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #fafafa;
}

/* Chat message styles */
.chat-message {
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 10px;
    max-width: 70%;
    word-wrap: break-word;
}

/* User message */
.chat-message.user {
    background-color: #dcf8c6;
    color: #333;
    align-self: flex-end;
    text-align: right;
}

/* Admin message */
.chat-message.admin {
    background-color: #fff;
    color: #333;
    align-self: flex-start;
    text-align: left;
}

/* Chat input container */
.chat-input-container {
    display: flex;
    align-items: center;
    position: relative;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.emoji-picker-toggle {
    background: none;
    border: none;
    font-size: 20px;
    margin-right: 5px;
    cursor: pointer;
}

.emoji-picker {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 10px;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.emoji-picker .emoji {
    font-size: 24px;
    margin: 5px;
    cursor: pointer;
}

.emoji-picker .emoji:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* Chat input field */
.chat-input {
    flex: 1;
    height: 40px;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
    font-size: 14px;
}

/* Send button */
.chat-send-button {
    background-color: #075e54;
    color: white;
    border: none;
    margin-left: 10px;
    padding: 10px 12px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

/* Send button hover effect */
.chat-send-button:hover {
    background-color: #0b7a63;
}

.end-customer-chat-button {
    background-color: transparent;
    color: #b42318;
    border: 1px solid #b42318;
    border-radius: 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    padding: 8px 10px;
    white-space: nowrap;
}

.end-customer-chat-button:hover:not(:disabled) {
    background-color: #fff1f0;
}

.end-customer-chat-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Send icon */
.chat-send-icon {
    font-size: 16px;
    font-weight: bold;
}


/* Responsive Design */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        border-radius: 0;
    }
    
    .chat-messages {
        height: 300px;
    }

    .chat-input-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .end-customer-chat-button {
        margin-left: auto;
    }
}

/* Smooth scrolling for messages */
.chat-messages {
    scroll-behavior: smooth;
}

.chat-message {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-date-separator {
    text-align: center;
    font-weight: bold;
    color: #888;
    margin: 10px 0;
    padding: 5px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    background-color: #f5f5f5;
}

/* System messages */
.system-message {
    text-align: center;
    padding: 10px;
    margin: 10px auto;
    border-radius: 8px;
    max-width: 80%;
    font-size: 14px;
}

/* Welcome message styling */
.system-message.welcome-message {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #0050b3;
    font-weight: bold;
    padding: 15px;
    margin: 15px auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

/* Animation for welcome message */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 80, 179, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 80, 179, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 80, 179, 0); }
}

/* Active chat message */
.system-message.active {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Completed chat message */
.system-message.completed {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* No credits message */
.system-message.no-credits {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}
