/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Layout Helpers */
html, body { height: 100%; margin: 0; overflow: hidden; }

/* CodeMirror Customization */
.CodeMirror {
    height: 100% !important;
    border-radius: 0.375rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    border: 1px solid #334155;
}
.cm-atom { color: #fcd34d !important; font-weight: bold; } 
.cm-string { color: #a5f3fc !important; } 
.cm-number { color: #f472b6 !important; } 

/* Cards */
.card {
    background-color: #1e293b; 
    border: 1px solid #334155; 
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.card-title {
    font-size: 1.125rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.form-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
    color: #94a3b8; 
}

/* Inputs */
.input {
    background-color: #0f172a; 
    border: 1px solid #334155; 
    border-radius: 0.375rem; 
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #f1f5f9; 
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    border-color: #38bdf8; 
    box-shadow: 0 0 0 1px #38bdf8;
}

select { color: #f1f5f9; }

.checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid #475569;
    background-color: #0f172a;
    border-radius: 0.25rem;
    cursor: pointer;
}

.checkbox:checked {
    background-color: #38bdf8;
    border-color: #38bdf8;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- CONVERSATION TAB STYLES --- */
.chat-container {
    height: calc(100vh - 200px);
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-track { background: #0f172a; }
.chat-container::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.message-bubble {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    line-height: 1.6;
}
.message-user {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}
.message-assistant {
    background-color: #1e293b;
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid #334155;
}

.feedback-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.feedback-widget:hover { opacity: 1; }
.feedback-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}

.feedback-btn {
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback-btn:hover { background-color: #334155; color: #38bdf8; }
.feedback-btn.active-positive { color: #4ade80; pointer-events: none; }
.feedback-btn.active-negative { color: #f87171; pointer-events: none; }

.thinking-indicator {
    display: inline-flex;
    gap: 4px;
}
.thinking-dot {
    width: 8px;
    height: 8px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: bounce 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; }

/* --- INSIGHTS CHART STYLES --- */
.chart-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.chart-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, transparent);
    opacity: 0.3;
}
.chart-container-inner {
    position: relative;
    height: 220px;
    width: 100%;
}

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