/* Visual diagram styling */

/* Flowchart SVG styles */
.flowchart-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin: 2rem 0;
    width: min(1600px, calc(100vw - 2rem));
    max-width: none;
    overflow: hidden;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.flowchart-container img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.flowchart-container svg {
    width: 100%;
    height: 100%;
}

.flowchart-node rect {
    fill: var(--bg-color);
    stroke: var(--border-color);
    stroke-width: 2;
}

.flowchart-node.node-success rect,
.node-success {
    fill: #d4edda;
    stroke: #28a745;
}

[data-theme="dark"] .node-success {
    fill: #1e4620;
    stroke: #4ade80;
}

.flowchart-node.node-danger rect,
.node-danger {
    fill: #ffcccc;
    stroke: #dc3545;
}

[data-theme="dark"] .node-danger {
    fill: #4a1f1f;
    stroke: #f87171;
}

.flowchart-node.node-warning rect,
.node-warning {
    fill: #fff3cd;
    stroke: #ffc107;
}

[data-theme="dark"] .node-warning {
    fill: #4a3d0f;
    stroke: #fbbf24;
}

.node-text {
    fill: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.edge {
    stroke: var(--border-color);
    stroke-width: 2;
    fill: none;
}

.edge-label {
    fill: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
}

/* Spectrum diagram */
.spectrum-container {
    position: relative;
    padding: 3rem 2rem;
    margin: 2rem 0;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.spectrum-line {
    position: relative;
    height: 4px;
    background: linear-gradient(to right, #dc3545, #ffc107, #28a745);
    border-radius: 2px;
    margin: 2rem 0;
}

.spectrum-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--bg-color);
    border: 3px solid currentColor;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.spectrum-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    max-width: 150px;
}

.spectrum-label-row {
    margin-top: 1.75rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 0.75rem;
    text-align: center;
}

.spectrum-label-item {
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--text-color);
}

.spectrum-example {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-around;
}

.spectrum-item {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 6px;
    border-left: 4px solid currentColor;
}

/* Comparison matrix */
.comparison-matrix {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.comparison-matrix thead {
    background: var(--bg-secondary);
}

.comparison-matrix th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.comparison-matrix td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comparison-matrix tbody tr:hover {
    background: var(--bg-secondary);
}

.comparison-matrix .col-danger {
    color: #dc3545;
    font-weight: 600;
}

[data-theme="dark"] .comparison-matrix .col-danger {
    color: #f87171;
}

.comparison-matrix .col-success {
    color: #28a745;
    font-weight: 600;
}

[data-theme="dark"] .comparison-matrix .col-success {
    color: #4ade80;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 2rem 0;
    padding-left: calc(50% + 2rem);
    min-height: 80px;
}

.timeline-item:nth-child(even) {
    padding-left: 0;
    padding-right: calc(50% + 2rem);
    text-align: right;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid var(--bg-color);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Checklist visual */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.checklist-category {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.checklist-category h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.checklist-item {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.checklist-item::before {
    content: '☐';
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Scorecard */
.scorecard {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.scorecard-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid currentColor;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: start;
}

.scorecard-item.false {
    border-left-color: #dc3545;
}

.scorecard-item.true {
    border-left-color: #28a745;
}

.scorecard-icon {
    font-size: 2rem;
    line-height: 1;
}

.scorecard-myth {
    font-weight: 600;
    color: #dc3545;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .scorecard-myth {
    color: #f87171;
}

.scorecard-truth {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .scorecard-truth {
    color: #4ade80;
}

.scorecard-evidence {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .spectrum-example {
        flex-direction: column;
    }

    .spectrum-label-row {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .timeline-item,
    .timeline-item:nth-child(even) {
        padding-left: 3rem;
        padding-right: 0;
        text-align: left;
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-marker {
        left: 10px;
    }
    
    .comparison-matrix {
        font-size: 0.85rem;
    }
    
    .comparison-matrix th,
    .comparison-matrix td {
        padding: 0.75rem 0.5rem;
    }
}

/* Print styles */
@media print {
    .flowchart-container {
        break-inside: avoid;
    }
    
    .timeline-item {
        break-inside: avoid;
    }
    
    .scorecard-item {
        break-inside: avoid;
    }
}
