/* UniversalRAG Project Dashboard - Dark Theme with Gradients */

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

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #6b7280;
    --accent: #667eea;
    --accent-hover: #764ba2;
    --border-color: rgba(255,255,255,0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

code, .mono {
    font-family: 'JetBrains Mono', monospace;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumb-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--accent-hover);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-secondary);
}

/* Header */
.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: var(--gradient-1);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 2rem;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 1.2rem 1.8rem;
    border-radius: 15px;
    text-align: center;
    min-width: 140px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Query Section */
.query-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#user-query {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#user-query:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

#ask-button {
    padding: 1rem 2rem;
    background: var(--gradient-3);
    border: none;
    border-radius: 15px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}

#ask-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.4);
}

.response-container {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 10px;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

.response-container.hidden {
    display: none;
}

/* Summary Section */
.summary-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 15px;
    line-height: 1.8;
}

.summary-content h3 {
    color: var(--accent);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.summary-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.summary-content strong {
    color: var(--text-primary);
}

/* Explorer Section */
.tab-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-button {
    padding: 0.8rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-count {
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.tab-content {
    min-height: 300px;
}

/* Symbol Grid */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.symbol-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.symbol-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.symbol-header {
    display: flex;
    align-items: start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.symbol-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.symbol-info {
    flex: 1;
}

.symbol-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-family: 'JetBrains Mono', monospace;
}

.symbol-type {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.symbol-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.symbol-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.symbol-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Health Section */
.health-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.health-stat {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.health-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-value {
    display: block;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.ready {
    background: rgba(56, 239, 125, 0.2);
    color: #38ef7d;
}

.status-badge.indexing {
    background: rgba(255, 200, 55, 0.2);
    color: #ffc837;
}

.status-badge.error {
    background: rgba(235, 51, 73, 0.2);
    color: #f45c43;
}

.health-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.9rem 1.8rem;
    background: var(--gradient-success);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 239, 125, 0.3);
}

.action-button.secondary {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
}

.action-button.secondary:hover {
    border-color: var(--accent);
    box-shadow: none;
}

.update-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-weight: 500;
}

.update-status.success {
    background: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
}

.update-status.error {
    background: rgba(235, 51, 73, 0.1);
    color: #f45c43;
}

.update-status.info {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.update-status.hidden {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
    padding: 1.5rem 2rem;
    background: var(--gradient-1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-button:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-secondary);
}

.modal-body h1, .modal-body h2, .modal-body h3 {
    color: var(--accent);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.modal-body h1 { font-size: 2rem; }
.modal-body h2 { font-size: 1.5rem; }
.modal-body h3 { font-size: 1.2rem; }

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

.modal-body code {
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #4facfe;
}

.modal-body pre {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
}

.modal-body pre code {
    padding: 0;
    background: none;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .dashboard-header {
        padding: 2rem 1rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .stats-container {
        gap: 1rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 1rem 1.2rem;
    }

    .symbol-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}
