/* AI Research Lab Dashboard — Dark Theme Styles */

/* Base */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #111827;
    color: #f3f4f6;
}

/* Sidebar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #1f2937; }
::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* Memory/utilization bars */
.bar-container {
    background: #374151;
    border-radius: 9999px;
    overflow: hidden;
    height: 1.25rem;
}
.bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}
.bar-fill.low { background: #10b981; }
.bar-fill.medium { background: #f59e0b; }
.bar-fill.high { background: #ef4444; }

/* Status pulse animation */
@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.pulse-green {
    animation: pulse-green 2s ease-in-out infinite;
}

/* Digest box */
.digest-box {
    border-left: 4px solid #3b82f6;
    background: #1e293b;
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1.5rem;
}
.digest-box .digest-label {
    font-size: 0.75rem;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* Stars */
.stars { color: #fbbf24; letter-spacing: 1px; }

/* Badge colors */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-highest { background: #991b1b; color: #fca5a5; }
.badge-high { background: #92400e; color: #fcd34d; }
.badge-medium { background: #1e40af; color: #93c5fd; }
.badge-low { background: #374151; color: #9ca3af; }
.badge-paused { background: #374151; color: #6b7280; }
.badge-running { background: #065f46; color: #6ee7b7; }
.badge-complete { background: #1e3a5f; color: #93c5fd; }
.badge-success { background: #065f46; color: #6ee7b7; }
.badge-negative { background: #991b1b; color: #fca5a5; }
.badge-neutral { background: #374151; color: #9ca3af; }
.badge-inconclusive { background: #78350f; color: #fcd34d; }
.badge-discovery { background: #312e81; color: #a5b4fc; }
.badge-lesson { background: #064e3b; color: #6ee7b7; }

/* Cards */
.card {
    background: #1f2937;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}
.card-header {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #374151;
}

/* Tables */
.data-table {
    width: 100%;
    font-size: 0.875rem;
}
.data-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #374151;
}
.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #1f2937;
}
.data-table tr:hover td {
    background: #374151;
}

/* Log timeline */
.timeline-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.timeline-dot.run_start { background: #10b981; }
.timeline-dot.run_end { background: #3b82f6; }
.timeline-dot.findings_registered { background: #f59e0b; }

/* Chat */
.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}
.chat-user {
    background: #1d4ed8;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}
.chat-agent {
    background: #374151;
    color: #e5e7eb;
    border-bottom-left-radius: 0.25rem;
}

/* SSE output */
.live-output {
    background: #0f172a;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Nav active state */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #9ca3af;
    transition: all 0.15s;
    font-size: 0.875rem;
}
.nav-link:hover {
    background: #374151;
    color: #e5e7eb;
}
.nav-link.active {
    background: #1e3a5f;
    color: #60a5fa;
}
.nav-icon {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    opacity: 0.7;
}

/* Search results dropdown */
#search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Markdown content styling */
.prose-dark h1, .prose-dark h2, .prose-dark h3 { color: #e5e7eb; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose-dark h1 { font-size: 1.5rem; font-weight: 700; }
.prose-dark h2 { font-size: 1.25rem; font-weight: 600; }
.prose-dark h3 { font-size: 1.1rem; font-weight: 600; }
.prose-dark p { margin-bottom: 0.75rem; color: #d1d5db; }
.prose-dark ul, .prose-dark ol { margin-left: 1.5rem; margin-bottom: 0.75rem; }
.prose-dark li { margin-bottom: 0.25rem; color: #d1d5db; }
.prose-dark code { background: #374151; padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.85em; }
.prose-dark pre { background: #0f172a; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-bottom: 1rem; }
.prose-dark pre code { background: transparent; padding: 0; }
.prose-dark table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.prose-dark th, .prose-dark td { padding: 0.5rem; border: 1px solid #374151; }
.prose-dark th { background: #1f2937; }
.prose-dark strong { color: #f3f4f6; }
.prose-dark a { color: #60a5fa; }
.prose-dark a:hover { color: #93c5fd; }
