/* assets/css/ai-premium.css — FIT ME AI Assistant Premium Styles */

#ai-assistant {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Floating Toggle Button */
#ai-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-grad);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 10;
}

#ai-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.6);
}

#ai-toggle .ai-icon {
    font-size: 1.8rem;
    animation: floatingIcon 3s ease-in-out infinite;
}

#ai-toggle .ai-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-3);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--bg-base);
}

@keyframes floatingIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Chat Window */
#ai-window {
    position: absolute;
    bottom: calc(100% + 1.5rem);
    right: 0;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

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

/* Header */
.ai-header {
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    display: inline-block;
    margin-right: 4px;
}

#ai-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

#ai-close:hover { color: var(--danger); }

/* Messages Area */
#ai-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(10, 15, 30, 0.4);
    scroll-behavior: smooth;
}

.ai-msg {
    max-width: 85%;
    padding: 0.85rem 1.1rem;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
    animation: msgIn 0.3s ease-out;
}

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

.ai-msg.bot {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
}

.ai-msg.user {
    align-self: flex-end;
    background: var(--accent-grad);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Thinking/Typing Indicator */
.ai-msg.thinking {
    display: flex;
    gap: 4px;
    padding: 0.8rem 1.2rem;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Footer Input Area */
.ai-footer {
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

#ai-form {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.2s;
}

#ai-form:focus-within {
    border-color: var(--accent);
}

#ai-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

#ai-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-grad);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: transform 0.2s;
}

#ai-send:hover { transform: scale(1.1); }

/* Responsive */
@media (max-width: 480px) {
    #ai-window {
        width: calc(100vw - 2rem);
        height: 70vh;
        right: -1rem;
        bottom: calc(100% + 1rem);
    }
}
