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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.4);
}

.tab.active {
    background: white;
    color: #667eea;
}

.tab-content {
    display: block; /* Always block since they are in separate pages now */
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.chart-container {
    position: relative;
    height: 400px;
}

.timeline-card {
    grid-column: 1 / -1;
}

.workflow-selector {
    margin-bottom: 20px;
}

.workflow-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.workflow-selector select:hover {
    border-color: #764ba2;
}

.flowchart-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.flowchart {
    flex: 1;
    min-width: 400px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.flowchart h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-align: center;
}

.flow-step {
    background: white;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    border-left: 4px solid #667eea;
}

.flow-step::after {
    content: '↓';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #667eea;
    font-weight: bold;
}

.flow-step:last-child::after {
    content: '';
}

.flow-step.highlight {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-left-color: #764ba2;
}

.benefits-challenges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.info-box h4 {
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box p {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.timeline-year {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    min-width: 80px;
    padding-right: 20px;
    border-right: 3px solid #667eea;
}

.timeline-content {
    padding-left: 20px;
    flex: 1;
}

.timeline-type {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.timeline-category {
    color: #666;
    font-size: 0.9em;
}

.timeline-reference {
    color: #888;
    font-size: 0.85em;
    font-style: italic;
    margin-top: 5px;
    line-height: 1.4;
}

.timeline-reference a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.timeline-reference a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    margin-top: 5px;
}

.badge-foundational { background: #667eea; color: white; }
.badge-agentic { background: #764ba2; color: white; }
.badge-modular { background: #f093fb; color: white; }
.badge-structural-modular { background: #4facfe; color: white; }
.badge-structural { background: #00d2ff; color: white; }

.category-definition {
    background: #f8f9fa;
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.9em;
}

.category-definition strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1em;
}

.category-definition p {
    color: #555;
    line-height: 1.5;
    margin: 0;
}

.def-foundational { border-left-color: #667eea; }
.def-agentic { border-left-color: #764ba2; }
.def-modular { border-left-color: #f093fb; }
.def-structural { border-left-color: #00d2ff; }

.chunking-brief {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #667eea;
}

.chunking-brief p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.chunking-brief .reference {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
}

.chunking-brief .reference a {
    color: #667eea;
    text-decoration: none;
}

.chunking-brief .reference a:hover {
    text-decoration: underline;
}

.category-tree {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.category-node {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category-node h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.category-node .brief {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
    margin-bottom: 10px;
    line-height: 1.5;
}

.category-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.method-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rag-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.rag-table th,
.rag-table td {
    border: 1px solid #ddd;
    padding: 12px;
    vertical-align: top;
}

.rag-table th {
    background-color: #5b6ee1;
    color: #fff;
    text-align: left;
}

.rag-table tr:nth-child(even) {
    background-color: #f5f6fa;
}

.rag-table a {
    color: #1a4cff;
    text-decoration: none;
    font-weight: 500;
}

.rag-table a:hover {
    text-decoration: underline;
}

/* Taxonomy Matrix */
.taxonomy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.taxonomy-table th, .taxonomy-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}
.taxonomy-table td:hover {
    background: rgba(102,126,234,0.1);
}
.cell-naive { background: rgba(102,126,234,0.2); }
.cell-advanced { background: rgba(118,75,162,0.2); }
.cell-modular { background: rgba(240,147,251,0.2); }
.cell-agentic { background: rgba(79,172,254,0.2); }
.cell-self { background: rgba(0,210,255,0.2); }
.cell-graph { background: rgba(255,99,132,0.2); }

/* Use When / Avoid When */
.use-when-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}
.use-box { background: rgba(72,187,120,0.1); border-left: 4px solid #48bb78; padding: 1rem; }
.avoid-box { background: rgba(245,101,101,0.1); border-left: 4px solid #f56565; padding: 1rem; }

/* Components */
.component-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.component-tag {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
}

/* Wizard */
.option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}
.option-buttons button {
    padding: 12px 24px;
    border: 2px solid #667eea;
    background: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.option-buttons button:hover {
    background: #667eea;
    color: white;
}
.wizard-result {
    background: rgba(102,126,234,0.1);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Mermaid */
.mermaid {
    background: transparent !important;
}

/* Status badges */
.badge.peer { background: #48bb78; color: white; }
.badge.arxiv { background: #ecc94b; color: black; }
.badge.arch { background: #667eea; color: white; }
.badge.control { background: #764ba2; color: white; }
.badge.year { background: #f093fb; color: black; }

/* Table styling */
.taxonomy-table tr.peer-reviewed { border-left: 4px solid #48bb78; }
.taxonomy-table tr.arxiv { border-left: 4px solid #ecc94b; }
.taxonomy-table tr:hover { background: rgba(102,126,234,0.05); }

/* Mermaid containers */
.mermaid-container {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
}
.mermaid-fallback {
    background: #fed7d7;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

/* Publication info */
.publication-info {
    background: #edf2f7;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}