/* ═══════════════════════════════════════════════════════════════
   AI TUTOR — Premium Chat Interface (Mobile-First)
   Enterprise-Grade Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Core Palette */
    --bg-primary: #0f0f14;
    --bg-secondary: rgba(22, 22, 29, 0.85); /* Glassmorphism base */
    --bg-tertiary: rgba(28, 28, 38, 0.9);
    --bg-elevated: rgba(34, 34, 48, 0.95);
    
    /* Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-violet: #a78bfa;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    --accent-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    
    /* Text */
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Borders & Effects */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.4);
    --glass-blur: blur(24px);
    
    /* Spacing */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════════════════════════════════
   WIDGET CONTAINER (MOBILE FIRST)
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-widget {
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: 16px;
    z-index: 9999;
    font-family: var(--font-sans);
}

.ai-chat-widget.embedded-mode {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
}

@media (min-width: 768px) {
    .ai-chat-widget:not(.embedded-mode) {
        bottom: 24px;
        right: 24px;
        left: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT WINDOW — Glassmorphism & Adaptive
   ═══════════════════════════════════════════════════════════════ */

.chat-window {
    width: 100%;
    height: calc(100vh - 100px);
    max-height: 600px;
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.1),
        var(--accent-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

@media (min-width: 768px) {
    .chat-window {
        width: 420px;
        height: 720px;
        max-height: calc(100vh - 40px);
    }
}

.embedded-mode .chat-window {
    width: 100% !important;
    height: 100% !important;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER — Premium Branded
   ═══════════════════════════════════════════════════════════════ */

.chat-header {
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .chat-header {
        padding: 20px 24px;
    }
}

/* SVG Avatar Animations */
.ai-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(139, 92, 246, 0.2), 0 0 15px rgba(139, 92, 246, 0.4);
    animation: floatAvatar 4s ease-in-out infinite;
    padding: 6px;
}

@keyframes floatAvatar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.3), 0 0 25px rgba(139, 92, 246, 0.6); }
}

.neon-brain {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.brain-path {
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
    animation: dashPath 6s linear infinite;
}

@keyframes dashPath {
    to { stroke-dashoffset: 0; }
}

.header-info {
    flex: 1;
}

.header-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.model-tag {
    font-size: 0.7rem;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   MESSAGES AREA
   ═══════════════════════════════════════════════════════════════ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

@media (min-width: 768px) {
    .chat-messages {
        padding: 24px;
        gap: 20px;
    }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ═══════════════════════════════════════════════════════════════
   MESSAGE BUBBLES — Premium Design
   ═══════════════════════════════════════════════════════════════ */

.message {
    max-width: 90%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.6;
    animation: message-appear 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .message {
        max-width: 85%;
        padding: 16px 20px;
    }
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* AI Messages */
.message.ai {
    align-self: flex-start;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    margin-left: 8px; /* Room for accent bar */
}

.message.ai::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-gradient);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* User Messages */
.message.user {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.message-image {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADER (TYPING INDICATOR)
   ═══════════════════════════════════════════════════════════════ */

.typing-indicator {
    display: none; /* Handled in JS via Flex when needed */
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: transparent;
}

@media (min-width: 768px) {
    .typing-indicator {
        padding: 16px 24px;
    }
}

.ai-avatar-small {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton-aiMessage {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.skeleton-aiMessage::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-line {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
}

.skeleton-line.full {
    width: 100%;
}

.skeleton-line.partial {
    width: 60%;
}

.loading-text {
    font-size: 0.85rem;
    color: var(--accent-violet);
    font-weight: 500;
    margin-bottom: 4px;
    animation: pulseText 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   IMAGE PREVIEW
   ═══════════════════════════════════════════════════════════════ */

.image-preview-container {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
    .image-preview-container {
        padding: 12px 24px;
    }
}

.preview-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--accent-purple);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    font-size: 0.65rem;
    text-align: center;
    padding: 2px;
    color: var(--accent-violet);
    font-weight: 600;
}

.remove-image {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-image:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   INPUT AREA — Smooth Textarea & Send
   ═══════════════════════════════════════════════════════════════ */

.chat-input-area {
    padding: 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-end; /* Align bottom for auto-resize textarea */
    gap: 12px;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .chat-input-area {
        padding: 20px 24px;
    }
}

.image-upload-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-bottom: 2px; /* align tweaking */
}

.image-upload-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.image-upload-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
}

.image-upload-btn:hover svg {
    color: var(--accent-violet);
}

.chat-input {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 13px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    resize: none;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow-y: hidden; /* hidden until max-height */
}

.chat-input::-webkit-scrollbar {
    width: 4px;
}
.chat-input::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.chat-input:hover {
    overflow-y: auto; /* show scroll on hover if content is tall */
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.chat-send {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    margin-bottom: 2px;
}

.chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

.chat-send:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.chat-send:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   TOGGLE BUTTON (Desktop only unless forced)
   ═══════════════════════════════════════════════════════════════ */

.chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 24px rgba(139, 92, 246, 0.4),
        0 0 0 4px rgba(139, 92, 246, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    bottom: 0;
    right: 0;
}

.chat-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-toggle:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 
        0 12px 32px rgba(139, 92, 246, 0.5),
        0 0 0 6px rgba(139, 92, 246, 0.15);
}

.embedded-mode .chat-toggle {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   AI DISCLAIMER POPUP
   ═══════════════════════════════════════════════════════════════ */

.ai-disclaimer-popup {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInPopup 0.3s ease-out;
}

@keyframes fadeInPopup {
    from { opacity: 0; }
    to { opacity: 1; }
}

.disclaimer-content {
    background: linear-gradient(145deg, #1c1c26 0%, #16161d 100%);
    border: 1px solid rgba(255, 180, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 90%;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 180, 0, 0.15);
    animation: slideUpPopup 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 768px) {
    .disclaimer-content {
        padding: 32px;
        max-width: 400px;
    }
}

@keyframes slideUpPopup {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.disclaimer-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.disclaimer-content h4 {
    color: #fbbf24;
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.disclaimer-content p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.disclaimer-content p strong {
    color: #f87171;
    font-weight: 600;
}

.disclaimer-note {
    color: var(--text-muted) !important;
    font-size: 0.85em !important;
    font-style: italic;
}

.disclaimer-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1c1c26;
    border: none;
    border-radius: var(--radius-full);
    padding: 14px 24px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
    width: 100%;
}

.disclaimer-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.4);
}

.disclaimer-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR & HISTORY
   ═══════════════════════════════════════════════════════════════ */

.chat-window {
    flex-direction: row; /* Change to row to hold sidebar + main */
    position: relative; /* Essential for absolute mobile sidebar mapping */
}

/* Base (Mobile) Sidebar - Absolute positioning to float over UI */
.chat-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: 260px;
    background: rgba(20, 20, 26, 0.98); /* Less transparent to hide content behind */
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateX(-100%); /* Hidden by default */
    box-shadow: 10px 0 30px rgba(0,0,0,0.5); /* Cast shadow on mobile */
}

.chat-window.sidebar-open .chat-sidebar {
    transform: translateX(0); /* Slide in on active */
}

@media (min-width: 768px) {
    /* Tablet & Desktop - Flex positioning to push content aside */
    .chat-sidebar {
         position: relative;
         z-index: 10;
         width: 280px;
         margin-left: -280px;
         transform: none; /* override mobile transform */
         transition: margin-left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
         box-shadow: none;
    }
    
    .chat-window.sidebar-open .chat-sidebar {
        margin-left: 0;
        transform: none;
    }
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Important for flex child truncation */
    position: relative;
    background: transparent;
}

/* Toggle btn in header */
.history-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.history-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.history-toggle-btn svg {
    width: 24px;
    height: 24px;
}

/* Sidebar internals */
.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.new-chat-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--accent-purple);
    color: var(--accent-violet);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.new-chat-btn svg {
    width: 18px;
    height: 18px;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    
    /* Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.session-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.session-item.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.session-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-date {
    color: var(--text-muted);
    font-size: 0.75rem;
}
/* ═══════════════════════════════════════════════════════════════
   REASONING CHAIN — Thought Process Display
   ═══════════════════════════════════════════════════════════════ */

.reasoning-container {
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.05);
    border: 1px dashed rgba(139, 92, 246, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.reasoning-header {
    padding: 8px 12px;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.reasoning-header:hover {
    background: rgba(139, 92, 246, 0.15);
}

.reasoning-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-violet);
    transition: transform 0.3s ease;
}

.reasoning-container.collapsed .reasoning-icon {
    transform: rotate(-90deg);
}

.reasoning-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-violet);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reasoning-content {
    padding: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    font-style: italic;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-line;
}

.reasoning-container.collapsed .reasoning-content {
    display: none;
}

/* Shimmer for reasoning while loading */
.reasoning-content.loading::after {
    content: "";
    width: 20px;
    height: 1.2em;
    background: var(--accent-violet);
    margin-top: 4px;
    border-radius: 2px;
    animation: pulse 1s infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}
