/* AI Helper Widget Styles */

.ai-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

.ai-widget-btn {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-color), #00A6CC);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 216, 255, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.ai-widget-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 216, 255, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.ai-widget-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Chat Window */
.ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2), opacity 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.ai-chat-window.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ai-chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 15px;
}

.ai-chat-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 216, 255, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.ai-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.ai-message.bot {
    background: rgba(0, 216, 255, 0.05);
    border: 1px solid rgba(0, 216, 255, 0.1);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-message.bot a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.ai-message.bot a:hover {
    text-decoration: underline;
}

.ai-message.user {
    background: var(--primary-color);
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Quick Actions */
.ai-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ai-quick-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-quick-btn:hover {
    background: rgba(0, 216, 255, 0.1);
    border-color: rgba(0, 216, 255, 0.3);
    color: var(--primary-color);
}

.ai-chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.ai-chat-form {
    display: flex;
    gap: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 4px 4px 16px;
    transition: border-color 0.2s;
}

.ai-chat-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.ai-chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
}

.ai-chat-input::placeholder {
    color: var(--text-muted);
}

.ai-chat-submit {
    background: var(--primary-color);
    color: #000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.ai-chat-submit:hover {
    transform: scale(1.05);
    background: #00E5FF;
}

.ai-chat-submit:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(0, 216, 255, 0.05);
    border: 1px solid rgba(0, 216, 255, 0.1);
    align-self: flex-start;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-items: center;
    height: 45px;
}

.ai-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 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 typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 32px);
        right: -8px;
        bottom: 70px;
    }
    
    .ai-widget-container {
        bottom: 16px;
        right: 16px;
    }
}
