:root {
    --charcoal-primary: #1a1a1a;
    --charcoal-secondary: #2d2d2d;
    --charcoal-tertiary: #3d3d3d;
    --gold-primary: #f59e0b;
    --gold-secondary: #fbbf24;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--charcoal-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.notebook-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--charcoal-tertiary);
}

.tab-btn {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.tab-btn:hover { color: #e5e7eb; }
.tab-btn.active { color: var(--gold-primary); border-bottom-color: var(--gold-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-card {
    background: var(--charcoal-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    color: #d1d5db;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--charcoal-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.form-group input::placeholder { color: #6b7280; }

.optional-label { color: #6b7280; font-weight: 400; font-size: 0.8rem; }

.submit-btn {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    color: #1a1a2e;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.2s;
}

.submit-btn:hover { opacity: 0.9; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.results-area {
    margin-top: 2rem;
}

.result-card {
    background: var(--charcoal-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-title {
    color: var(--gold-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.result-meta {
    color: #6b7280;
    font-size: 0.8rem;
}

.result-content {
    color: #d1d5db;
    line-height: 1.7;
    font-size: 0.95rem;
}

.result-content h1, .result-content h2, .result-content h3,
.result-content h4, .result-content h5 {
    color: #e5e7eb;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}

.result-content h2 { font-size: 1.15rem; color: var(--gold-primary); }
.result-content h3 { font-size: 1.05rem; }
.result-content strong { color: #e5e7eb; }
.result-content ul, .result-content ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.result-content li { margin-bottom: 0.3rem; }
.result-content a { color: var(--gold-primary); text-decoration: none; }
.result-content a:hover { text-decoration: underline; }

.sources-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #374151;
}

.sources-title {
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.source-tag {
    background: var(--charcoal-primary);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-decoration: none;
    border: 1px solid #374151;
    transition: border-color 0.2s;
}

.source-tag:hover { border-color: var(--gold-primary); color: var(--gold-primary); }

.source-icon { margin-right: 0.3rem; }

.loading-indicator {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.loading-indicator i {
    font-size: 2rem;
    color: var(--gold-primary);
    margin-bottom: 1rem;
    display: block;
}

.notebook-list { list-style: none; padding: 0; }

.notebook-item {
    background: var(--charcoal-tertiary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
    border: 1px solid transparent;
}

.notebook-item:hover { border-color: var(--gold-primary); }

.notebook-item-title { color: #e5e7eb; font-weight: 500; }

.notebook-item-meta {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: #4b5563;
}

.source-counts {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.source-count-badge {
    background: var(--charcoal-primary);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.source-count-badge i { margin-right: 0.3rem; }

@media (max-width: 768px) {
    .tab-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
    .form-card { padding: 1rem; }
    .result-card { padding: 1rem; }
    .notebook-container { padding: 1rem 0.75rem; }
}

@media (max-width: 480px) {
    .tab-nav { flex-wrap: wrap; }
    .tab-btn { flex: 1; text-align: center; min-width: 0; }
}
