/* --- AI Assistant Widget --- */
:root {
    --ai-primary: #0A74DA;
    --ai-accent: #00d2ff;
    --ai-bg: rgba(20, 30, 40, 0.95);
    --ai-text: #ffffff;
}

/* Floating Toggle Button */
.ai-widget-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-accent));
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(10, 116, 218, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: ai-pulse 3s infinite;
}

.ai-widget-toggle:hover {
    transform: scale(1.1) rotate(10deg);
}

.ai-widget-toggle i {
    color: white;
    font-size: 1.5rem;
}

@keyframes ai-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 210, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0);
    }
}

/* Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: var(--ai-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9998;
}

.ai-chat-window.is-open {
    transform: scale(1);
    opacity: 1;
}

/* Header */
.ai-chat-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(10, 116, 218, 0.8), rgba(0, 210, 255, 0.6));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-header-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    font-weight: 700;
}

.ai-header-info span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background-color: #00ff88;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #00ff88;
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ai-close-btn:hover {
    opacity: 1;
}

/* Messages Area */
.ai-messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.ai-messages-area::-webkit-scrollbar {
    width: 5px;
}

.ai-messages-area::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Message Bubbles */
.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.ai-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.ai-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--ai-primary), #0056b3);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 5px 15px rgba(10, 116, 218, 0.3);
}

/* Typing Indicator */
.ai-typing {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    border-radius: 20px;
    display: none;
}

.ai-typing.active {
    display: flex;
    gap: 5px;
}

.ai-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ai-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Input Area */
.ai-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 12px 20px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.ai-input-area input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--ai-accent);
}

.ai-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--ai-primary);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.ai-send-btn:hover {
    background: var(--ai-accent);
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}