/* AI Chat FAB Styling */
.ai-chat-fab {
    position: fixed;
    bottom: 90px;
    /* Above bottom nav */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(13, 138, 188, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.ai-chat-fab .material-symbols-rounded {
    font-size: 28px;
}

.ai-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(13, 138, 188, 0.6);
}

/* AI Chat Modal Styling */
.ai-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.ai-chat-modal.active {
    display: flex;
}

.ai-chat-container {
    width: 100%;
    max-width: var(--container-max-width);
    background: var(--bg-secondary);
    height: 80vh;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-name {
    font-weight: 700;
    font-size: 1rem;
}

.ai-status {
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 500;
}

.ai-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Bubbles */
.ai-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.ai-msg.bot {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.ai-msg.user {
    align-self: flex-end;
    background: var(--primary-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-chat-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid var(--bg-tertiary);
}

.ai-quick-prompts {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ai-chip {
    white-space: nowrap;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.ai-chip:hover {
    background: var(--bg-primary);
    border-color: var(--primary-teal);
    color: var(--primary-teal);
}

.ai-input-wrapper {
    display: flex;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 6px;
    border-radius: 100px;
    align-items: center;
}

.ai-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    outline: none;
    font-size: 0.9375rem;
}

#ai-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Animations */
@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* Markdown styling in messages */
.ai-msg b {
    font-weight: 700;
    color: inherit;
}