/* AI Live Chat Widget Styles - Minimal & Premium Redesign */

.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 2147483647;
    font-family: var(--thm-body-font);
}

/* Floating Action Button */
.ai-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--thm-primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    z-index: 100;
}

.ai-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Main Chat Window */
.ai-chat-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--thm-black-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom left;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(128, 128, 128, 0.3);
    z-index: 2147483647;
}

.ai-chat-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Minimalist Header */
.ai-chat-header {
    padding: 20px;
    background: var(--thm-primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.ai-chat-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 16px;
}

/* Avatar / Icon */
.ai-chat-header-title i {
    font-size: 20px;
    color: var(--thm-primary-color);
    background: #ffffff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ai-chat-close {
    cursor: pointer;
    font-size: 20px;
    color: #ffffff;
    opacity: 0.7;
    transition: opacity 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.ai-chat-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(128, 128, 128, 0.02);
    z-index: 1;
}

/* Scrollbar styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
    border-radius: 10px;
}

/* Chat Bubbles */
.ai-message, .user-message {
    max-width: 80%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message {
    align-self: flex-start;
    background: var(--thm-black-bg);
    color: var(--thm-body-font-color);
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 0 16px 16px 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.user-message {
    align-self: flex-end;
    background: var(--thm-primary-color);
    color: #fff;
    border-radius: 16px 16px 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Quick Replies */
.ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -8px;
    margin-bottom: 8px;
}

.ai-quick-reply-btn {
    background: transparent;
    border: 1px solid var(--thm-primary-color);
    color: var(--thm-primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-quick-reply-btn:hover {
    background: var(--thm-primary-color);
    color: #fff;
}

/* Input Area */
.ai-chat-input-area {
    padding: 15px 20px;
    background: var(--thm-black-bg);
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
}

.ai-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    color: var(--thm-body-font-color);
    outline: none;
}

.ai-chat-input::placeholder {
    color: rgba(128, 128, 128, 0.5);
}

.ai-chat-send {
    background: var(--thm-primary-color);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform 0.2s, filter 0.2s;
}

.ai-chat-send:hover {
    transform: scale(1.05);
    filter: brightness(0.9);
}

.ai-chat-send:disabled {
    background: rgba(128, 128, 128, 0.2);
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: var(--thm-black-bg);
    border: 1px solid rgba(128, 128, 128, 0.1);
    border-radius: 0 16px 16px 16px;
    padding: 12px 16px;
    gap: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(128,128,128,0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .ai-chat-window {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}
