/* ==========================================================================
   ResearchAgent - Modern UI Styles
   Light/Dark Mode Support with CSS Custom Properties
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties - Theme System
   -------------------------------------------------------------------------- */

/* Dark Theme (Default) */
:root,
[data-theme="dark"] {
    /* Background Colors */
    --bg-base: #09090b;
    --bg-surface: #18181b;
    --bg-elevated: #27272a;
    --bg-hover: #3f3f46;
    --bg-active: #52525b;

    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-inverse: #09090b;

    /* Border Colors */
    --border-default: #27272a;
    --border-hover: #3f3f46;
    --border-focus: #6366f1;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-secondary: #8b5cf6;
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;

    /* Agent Colors */
    --agent-perplexity: #22c55e;
    --agent-perplexity-bg: rgba(34, 197, 94, 0.15);
    --agent-claude: #f59e0b;
    --agent-claude-bg: rgba(245, 158, 11, 0.15);
    --agent-openai: #3b82f6;
    --agent-openai-bg: rgba(59, 130, 246, 0.15);
    --agent-orchestrator: #8b5cf6;

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-glow: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.3), transparent);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    /* Effects */
    --glass-bg: rgba(24, 24, 27, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Spacing & Sizing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* Light Theme */
[data-theme="light"] {
    /* Background Colors */
    --bg-base: #ffffff;
    --bg-surface: #f4f4f5;
    --bg-elevated: #ffffff;
    --bg-hover: #e4e4e7;
    --bg-active: #d4d4d8;

    /* Text Colors */
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-inverse: #fafafa;

    /* Border Colors */
    --border-default: #e4e4e7;
    --border-hover: #d4d4d8;
    --border-focus: #6366f1;

    /* Accent Colors - slightly adjusted for light mode */
    --accent-primary: #4f46e5;
    --accent-primary-hover: #4338ca;
    --accent-secondary: #7c3aed;
    --accent-success: #16a34a;
    --accent-warning: #d97706;
    --accent-error: #dc2626;

    /* Agent Colors - adjusted for light bg */
    --agent-perplexity: #16a34a;
    --agent-perplexity-bg: rgba(22, 163, 74, 0.1);
    --agent-claude: #d97706;
    --agent-claude-bg: rgba(217, 119, 6, 0.1);
    --agent-openai: #2563eb;
    --agent-openai-bg: rgba(37, 99, 235, 0.1);
    --agent-orchestrator: #7c3aed;

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    --gradient-glow: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 70, 229, 0.15), transparent);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);

    /* Effects */
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   Base Styles & Reset
   -------------------------------------------------------------------------- */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Animated Background
   -------------------------------------------------------------------------- */

.bg-gradient {
    position: fixed;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border-default) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black 30%, transparent 70%);
}

/* --------------------------------------------------------------------------
   App Container
   -------------------------------------------------------------------------- */

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Navigation Bar
   -------------------------------------------------------------------------- */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-default);
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 0 -1.5rem;
    padding: 1rem 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Icon visibility based on theme */
[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */

.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Query Card
   -------------------------------------------------------------------------- */

.query-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.query-card:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.query-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

#query-input {
    flex: 1;
    padding: 0.875rem 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    min-height: 60px;
}

#query-input:focus {
    outline: none;
}

#query-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    height: 48px;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.search-btn:active:not(:disabled) {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading {
    display: none;
}

.search-btn:disabled .btn-text {
    display: none;
}

.search-btn:disabled .btn-loading {
    display: flex;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Query Options */
.query-options {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--border-default);
}

.option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.option-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: all 0.2s ease;
}

.option-group select:hover {
    border-color: var(--border-hover);
}

.option-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.checkbox-option {
    margin-left: auto;
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.checkbox-option label {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Agent Showcase
   -------------------------------------------------------------------------- */

.agents-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.agent-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
    position: relative;
}

.agent-pill.active {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.agent-pill.working {
    animation: agentPulse 2s ease-in-out infinite;
}

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

.agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.agent-avatar.perplexity {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.agent-avatar.claude {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.agent-avatar.openai {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.agent-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.agent-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.agent-task {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.agent-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.agent-pill.active .agent-pulse,
.agent-pill.working .agent-pulse {
    background: var(--accent-success);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.agent-connector {
    width: 32px;
    height: 2px;
    background: var(--border-default);
    position: relative;
}

.agent-connector::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--border-default);
    border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Progress Section
   -------------------------------------------------------------------------- */

.progress-section {
    display: none;
    padding: 2rem 0;
}

.progress-section.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.progress-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-header h3 svg {
    color: var(--accent-primary);
    animation: spin 2s linear infinite;
}

.progress-percent {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

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

.progress-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Log Section
   -------------------------------------------------------------------------- */

.log-section {
    padding: 1rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header h3 svg {
    color: var(--text-muted);
}

.log-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    max-height: 280px;
    overflow-y: auto;
}

.log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
}

.log-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.log-empty p {
    font-size: 0.875rem;
}

.log-entry {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-default);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.log-sender {
    font-weight: 600;
    margin-right: 0.5rem;
}

.log-sender.perplexity { color: var(--agent-perplexity); }
.log-sender.claude { color: var(--agent-claude); }
.log-sender.openai { color: var(--agent-openai); }
.log-sender.orchestrator { color: var(--agent-orchestrator); }

.log-message {
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Results Section
   -------------------------------------------------------------------------- */

.results-section {
    display: none;
    padding: 2rem 0;
    flex: 1;
}

.results-section.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

.results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-title h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.results-title h2 svg {
    color: var(--accent-success);
}

.results-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-tag {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-tag strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Download Dropdown */
.download-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.download-dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.dropdown-menu button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-menu button:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-menu button:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--border-default);
    margin: 0.5rem 0;
}

/* Results Content */
.results-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Markdown Styles in Results */
.results-content h1,
.results-content h2,
.results-content h3,
.results-content h4 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}

.results-content h1:first-child,
.results-content h2:first-child,
.results-content h3:first-child {
    margin-top: 0;
}

.results-content h1 { font-size: 1.75rem; }
.results-content h2 { font-size: 1.375rem; }
.results-content h3 { font-size: 1.125rem; }
.results-content h4 { font-size: 1rem; }

.results-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.results-content ul,
.results-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.results-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.results-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.results-content a:hover {
    text-decoration: underline;
}

.results-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.results-content code {
    background: var(--bg-elevated);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    color: var(--accent-secondary);
}

.results-content pre {
    background: var(--bg-base);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-default);
}

.results-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.results-content blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.results-content hr {
    border: none;
    border-top: 1px solid var(--border-default);
    margin: 2rem 0;
}

.results-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.results-content th,
.results-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-default);
    text-align: left;
}

.results-content th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-primary);
}

.results-content td {
    color: var(--text-secondary);
}

/* Error State */
.results-error {
    text-align: center;
    padding: 2rem;
}

.results-error svg {
    color: var(--accent-error);
    margin-bottom: 1rem;
}

.results-error h3 {
    color: var(--accent-error);
    margin-bottom: 0.5rem;
}

.results-error p {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-default);
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-version {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-powered {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    color: var(--accent-success);
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Scrollbar Styling
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .app-container {
        padding: 0 1rem;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .query-input-wrapper {
        flex-direction: column;
    }

    .input-icon {
        display: none;
    }

    #query-input {
        padding: 1rem;
        background: var(--bg-elevated);
        border-radius: var(--radius-md);
    }

    .search-btn {
        width: 100%;
    }

    .query-options {
        flex-direction: column;
        gap: 1rem;
    }

    .checkbox-option {
        margin-left: 0;
    }

    .agents-showcase {
        flex-direction: column;
        gap: 0.75rem;
    }

    .agent-connector {
        width: 2px;
        height: 24px;
    }

    .agent-pill {
        width: 100%;
        max-width: 280px;
    }

    .results-header {
        flex-direction: column;
    }

    .results-actions {
        width: 100%;
    }

    .results-actions button {
        flex: 1;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-link {
        display: none;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .query-card {
        padding: 1rem;
    }

    .results-content {
        padding: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    .bg-gradient,
    .bg-grid,
    .navbar,
    .query-card,
    .agents-showcase,
    .progress-section,
    .log-section,
    .results-actions,
    .footer,
    .toast {
        display: none !important;
    }

    .app-container {
        max-width: none;
        padding: 0;
    }

    .results-section {
        display: block !important;
        padding: 0;
    }

    .results-header {
        margin-bottom: 1rem;
    }

    .results-content {
        max-height: none;
        overflow: visible;
        border: none;
        padding: 0;
        background: none;
    }

    body {
        background: white;
        color: black;
    }
}
