/* Chat Widget Styles */

:root {
    --surface-white: #FFFFFF;
    --text-dark: #2D2D2D;
    --text-muted: #666666;
    --accent: #8C7060;
    --accent-dark: #6B5446;
    --border: #E5E5E5;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', 'Poppins', sans-serif;
}

/* Chat Toggle Button */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(140, 112, 96, 0.3);
    transition: all 0.3s ease;
    color: var(--surface-white);
    font-size: 24px;
}

.chat-toggle-btn:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 6px 16px rgba(140, 112, 96, 0.4);
    transform: scale(1.1);
}

.chat-toggle-btn i {
    transition: transform 0.3s ease;
}

.chat-toggle-btn.active i {
    transform: rotate(90deg);
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background-color: var(--surface-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--border);
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    background-color: var(--accent);
    color: var(--surface-white);
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--surface-white);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.chat-close-btn:hover {
    opacity: 0.8;
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #FAFAFA;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Message Bubble */
.message {
    display: flex;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background-color: var(--accent);
    color: var(--surface-white);
    border-bottom-right-radius: 4px;
}

.message.bot .message-bubble {
    background-color: var(--border);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px;
    background-color: var(--surface-white);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    resize: none;
    max-height: 80px;
}

.chat-input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(140, 112, 96, 0.1);
}

.chat-send-btn {
    padding: 10px 14px;
    background-color: var(--accent);
    color: var(--surface-white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background-color: var(--accent-dark);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Email Button in Chat */
.email-button {
    display: inline-block;
    background-color: var(--accent);
    color: var(--surface-white);
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    margin-top: 8px;
    text-align: center;
}

.email-button:hover {
    background-color: var(--accent-dark);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 500px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .chat-window {
        width: 90vw;
        max-width: 360px;
        height: 450px;
    }

    .chat-toggle-btn {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

@media (max-width: 380px) {
    .chat-window {
        width: 100vw;
        margin: 0 -16px;
        border-radius: 16px 16px 0 0;
        height: 60vh;
        bottom: 0;
    }
}
