/* AI Mode Styles & Response Formatting */

/* ===== TYPING ANIMATION ===== */
.typing-word {
    display: inline;
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: color;
}

/* Loading sparkle animation */
.rainbow-loading {
    display: inline-block;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
}

/* ===== AI RESPONSE CONTENT FORMATTING ===== */

/* Typing container — premium, readable text */
#ai-typing-container {
    font-size: 0.966rem;
    line-height: 1.85;
    word-spacing: 0.04em;
    letter-spacing: 0.005em;
    color: #374151;
}

/* Paragraph spacing */
#ai-typing-container .ai-paragraph {
    margin-bottom: 12px;
}

#ai-typing-container .ai-paragraph:last-child {
    margin-bottom: 0;
}

/* Bullet point formatting */
#ai-typing-container .ai-bullet-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 4px 0;
    margin: 3px 0;
}

#ai-typing-container .ai-bullet-marker {
    color: #764ba2;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 16px;
    line-height: 1.85;
}

#ai-typing-container .ai-bullet-text {
    flex: 1;
    line-height: 1.85;
}

/* Bold text */
#ai-typing-container .ai-bold-word {
    font-weight: 700;
    color: #1a1a1a;
}

/* Spacer between sections */
#ai-typing-container .ai-section-break {
    height: 10px;
}

/* Numbered list items */
#ai-typing-container .ai-numbered-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 4px 0;
    margin: 3px 0;
}

#ai-typing-container .ai-number-marker {
    color: #667eea;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 22px;
    line-height: 1.85;
}

/* Bullet point formatting for AI responses */
#ai-typing-container ul,
#ai-typing-container ol {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

#ai-typing-container li {
    margin-bottom: 0.35rem;
    line-height: 1.85;
}

/* ===== Rainbow Typing Effect ===== */
@keyframes rainbow-shift {
    0% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Fixed response text color after animation */
.ai-chat-ai-bubble span[style*="color"] {
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TIMESTAMP STYLING ===== */
.ai-chat-time {
    text-align: center;
    font-size: 0.72rem;
    color: #c7c7cc;
    margin: 8px 0;
    font-weight: 500;
}