/* AI CHAT WIDGET STYLES */

/* Floating Chat Button */
.chat-widget-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    box-shadow: 0 4px 15px rgba(247, 144, 7, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 9998;
    border: none;
}

.chat-widget-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(247, 144, 7, 0.5);
}

.chat-widget-btn svg {
    width: 30px;
    height: 30px;
    fill: white;
    transition: transform 0.3s ease;
}

.chat-widget-btn:hover svg {
    transform: scale(1.1);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

/* Chat Header */
.chat-window-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-window-header h3 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

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

.chat-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--bg-gray);
    min-height: 300px;
    max-height: 400px;
}

.chat-message {
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

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

.chat-message.user {
    text-align: right;
}

.chat-message.assistant {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-line;
}

.chat-message.user .message-bubble {
    background: var(--primary-color);
    color: white;
    border-radius: 12px 12px 0 12px;
}

.chat-message.assistant .message-bubble {
    background: white;
    color: var(--text-color);
    border: 1px solid #e0e0e0;
    border-radius: 0 12px 12px 12px;
}

.message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.chat-message.assistant .message-avatar {
    background: var(--primary-color);
    color: white;
}

.chat-message.user .message-avatar {
    background: var(--accent-color);
    color: white;
    float: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Chat Input Area */
.chat-input-area {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-secondary);
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Quick Actions */
.chat-quick-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-gray);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 1.5rem;
}

.chat-welcome-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.chat-welcome h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.chat-welcome p {
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Powered by */
.chat-powered-by {
    text-align: center;
    padding: 0.5rem 1rem;
    background: var(--bg-gray);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: 0.8rem;
    color: var(--text-color);
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-gray);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100% - 60px);
        right: 30px;
        bottom: 100px;
        max-height: 70vh;
    }

    .chat-widget-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .message-bubble {
        max-width: 90%;
    }
}

@media (max-width: 576px) {
    .chat-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        border-radius: var(--radius-md);
    }

    .chat-widget-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .chat-widget-btn,
    .chat-window,
    .chat-message,
    .quick-action-btn {
        animation: none;
        transition: none;
    }
}

.chat-widget-btn:focus,
.chat-close-btn:focus,
.chat-input:focus,
.quick-action-btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}
