/* ================= THINKING UI (ChatGPT Style) ================= */

/* Container structure */
.ai-thinking {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    align-items: flex-start;
    width: auto;
    max-width: 100%;
}

/* Thinking Line - Single step row */
.thinking-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    width: auto;
    max-width: 100%;
    transition: opacity 0.3s ease;
}

/* Icon container */
.thinking-line .thinking-dots,
.thinking-line .thinking-check {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Checkmark for completed items */
.thinking-check {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: bold;
}

/* Text styling */
.thinking-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* ================= STATES ================= */

/* Active State (Currently thinking) */
.thinking-line.active .thinking-text {
    color: var(--text-primary);
    font-weight: 500;
    -webkit-text-fill-color: currentColor;
    animation: thinkingOpacityPulse 1.6s ease-in-out infinite;
}

/* Completed State (Past steps) */
.thinking-line.completed .thinking-text {
    color: var(--text-muted);
}

/* Collapsed State (When done) */
.message.assistant.thinking.thinking-complete .thinking-line.completed {
    display: none; /* Hide past steps when complete */
}

.message.assistant.thinking.thinking-complete .thinking-line:last-child {
    display: flex; /* Show only final status */
}

/* ================= ANIMATIONS ================= */

/* Dots Animation */
.thinking-dot {
    width: 4px;
    height: 4px;
    background-color: var(--text-primary);
    border-radius: 50%;
    margin: 0 1px;
    animation: pulseDot 1.4s infinite ease-in-out both;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }
.thinking-dot:nth-child(3) { animation-delay: 0s; }

@keyframes pulseDot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes thinkingOpacityPulse {
    0%, 100% { opacity: 0.66; }
    50% { opacity: 1; }
}

/* ================= MESSAGE OVERRIDES ================= */

/* Remove default message styling for thinking bubbles to keep them clean */
.message.assistant.thinking .message-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
