/* =======================
   Modern Thinking Indicator
   Clean, minimal design with smooth animations
   Cross-platform compatible (light/dark mode, responsive)
   ======================= */

/* Thinking Indicator Container */
.thinking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg,
            rgba(var(--assistant-accent-rgb), 0.04),
            rgba(var(--assistant-accent-rgb), 0.02),
            transparent);
    border-radius: 12px;
    margin: 16px 0;
    animation: thinking-shimmer 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

/* Shimmer Background Effect */
@keyframes thinking-shimmer {
    0% {
        background: linear-gradient(135deg,
                rgba(var(--assistant-accent-rgb), 0.04),
                rgba(var(--assistant-accent-rgb), 0.02),
                transparent);
    }

    50% {
        background: linear-gradient(135deg,
                rgba(var(--assistant-accent-rgb), 0.08),
                rgba(var(--assistant-accent-rgb), 0.04),
                transparent);
    }

    100% {
        background: linear-gradient(135deg,
                rgba(var(--assistant-accent-rgb), 0.04),
                rgba(var(--assistant-accent-rgb), 0.02),
                transparent);
    }
}

/* Thinking Text */
.thinking-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--assistant-text-secondary);
    letter-spacing: 0.3px;
    animation: thinking-text-fade 1.5s ease-in-out infinite;
}

/* Text Fade Animation (70% to 90% opacity) */
@keyframes thinking-text-fade {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.9;
    }
}

/* Dot Container */
.thinking-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Individual Dots */
.thinking-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--assistant-accent), var(--assistant-accent-2));
    animation: thinking-dot-pulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 1px 3px rgba(var(--assistant-accent-rgb), 0.3);
}

/* Staggered Dot Animation */
.thinking-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

/* Dot Pulse Animation (1 to 1.1 scale, 40% to 100% opacity) */
@keyframes thinking-dot-pulse {

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

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Alternative Smooth Pulse (more subtle) */
@keyframes thinking-dot-pulse-smooth {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

/* Container for Text + Dots */
.thinking-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Compact Thinking Indicator (for sidebars/tight spaces) */
.thinking-indicator-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(var(--assistant-accent-rgb), 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--assistant-accent);
}

.thinking-indicator-compact .thinking-dot {
    width: 4px;
    height: 4px;
}

/* Loading Status Text (optional detail) */
.thinking-status {
    font-size: 0.8rem;
    color: var(--assistant-muted);
    margin-left: 4px;
    font-style: italic;
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .thinking-indicator {
        background: linear-gradient(135deg,
                rgba(56, 189, 248, 0.06),
                rgba(56, 189, 248, 0.03),
                transparent);
    }

    .thinking-text {
        color: #cbd5e1;
    }

    .thinking-dot {
        box-shadow: 0 1px 3px rgba(56, 189, 248, 0.4);
    }
}

.brox-ai-dark-mode .thinking-indicator {
    background: linear-gradient(135deg,
            rgba(56, 189, 248, 0.06),
            rgba(56, 189, 248, 0.03),
            transparent);
}

.brox-ai-dark-mode .thinking-text {
    color: #cbd5e1;
}

.brox-ai-dark-mode .thinking-dot {
    box-shadow: 0 1px 3px rgba(56, 189, 248, 0.4);
}

/* Responsive Design */
@media (max-width: 576px) {
    .thinking-indicator {
        padding: 12px 16px;
        gap: 10px;
        margin: 12px 0;
    }

    .thinking-text {
        font-size: 0.9rem;
    }

    .thinking-content {
        gap: 8px;
    }
}

/* Accessibility - Reduce Motion */
@media (prefers-reduced-motion: reduce) {

    .thinking-indicator,
    .thinking-text,
    .thinking-dot {
        animation: none;
        opacity: 1;
    }

    .thinking-dot {
        transform: scale(1);
    }
}