/* General Container for the Chat Widget */
#smart-chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Chat Bubble - The button to open the chat */
#smart-chat-bubble {
    width: 60px;
    height: 60px;
    background-color: #0073aa; /* Default color, will be overridden */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#smart-chat-bubble:hover {
    transform: scale(1.1);
}

#smart-chat-bubble svg {
    width: 32px;
    height: 32px;
}

#smart-chat-bubble img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Chat Window */
#smart-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 370px;
    height: 500px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.5);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#smart-chat-window:not(.hidden) {
    opacity: 1;
    transform: scale(1);
}

/* Chat Header */
#smart-chat-header {
    background-color: #0073aa; /* Default color */
    color: white; /* Default color */
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    flex-shrink: 0;
}

#smart-chat-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin-right: 10px !important;
    border: 2px solid rgba(255,255,255,0.5) !important;
}

#smart-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    flex-grow: 1;
}

#smart-chat-close-btn {
    background: none;
    border: none;
    color: white; /* Default color */
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Pre-chat Form Styles */
#smart-chat-pre-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

#smart-chat-pre-form::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1;
}

#smart-chat-pre-form > * {
    position: relative;
    z-index: 2;
}

#smart-chat-pre-form p {
    text-align: center;
    font-size: 15px;
    color: #333;
    margin-bottom: 20px;
}

#smart-chat-pre-form .form-group {
    margin-bottom: 15px;
}

#smart-chat-pre-form label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

#smart-chat-pre-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

#smart-chat-pre-form button {
    width: 100%;
    padding: 12px;
    background-color: #0073aa; /* Default color */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#smart-chat-pre-form button:hover {
    opacity: 0.9;
}

#smart-chat-pre-form button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

#pre-chat-message {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
}

/* Chat Body */
#smart-chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-size: cover;
    background-position: center;
    position: relative;
}

#smart-chat-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.smart-chat-message, #smart-chat-quick-buttons {
    position: relative;
    z-index: 2;
}

.smart-chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.smart-chat-message.user {
    background-color: #0073aa; /* Default color */
    color: white; /* Default color */
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.smart-chat-message.assistant {
    background-color: #e5e5e5;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.smart-chat-message.typing-indicator {
    align-self: flex-start;
    color: #888;
    font-style: italic;
}

/* Quick Reply Buttons */
#smart-chat-quick-buttons {
    padding: 0 0 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.quick-button {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    color: #333;
    text-align: center;
}

.quick-button:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

/* Chat Footer */
#smart-chat-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    flex-shrink: 0;
}

#smart-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    transition: border-color 0.2s;
}

#smart-chat-input:focus {
    outline: none;
    border-color: #0073aa;
}

#smart-chat-send-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    color: #0073aa;
    transition: color 0.2s;
}

#smart-chat-send-btn:hover {
    color: #005a87;
}

#smart-chat-send-btn svg {
    width: 24px;
    height: 24px;
}

/* Branding Footer */
#smart-chat-branding {
    padding: 8px;
    text-align: center; /* Center the text */
    font-size: 12px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    font-family: Georgia, 'Times New Roman', serif; /* Official font */
}

#smart-chat-branding a {
    color: #D4AF37 !important; /* Gold color with high priority */
    text-decoration: none;
    font-weight: bold;
}

#smart-chat-branding a:hover {
    text-decoration: underline;
}

/* Utility class */
.hidden {
    display: none !important;
}

/* Responsive Design for Mobile */
@media (max-width: 480px) {
    #smart-chat-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    #smart-chat-widget-container {
        bottom: 10px;
        right: 10px;
    }
}
