/* ===== VISUALS & DIAGRAMS ===== */

/* --- Bar Charts --- */
.bar-chart { margin: 16px 0; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { min-width: 120px; font-size: 0.85rem; font-weight: 600; color: var(--text); text-align: right; }
.bar-track { flex: 1; height: 28px; background: var(--border); border-radius: 14px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 14px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; font-size: 0.75rem; font-weight: 700; color: #fff; transition: width 0.8s ease; min-width: 40px; }
.bar-fill.green { background: linear-gradient(135deg, #2d6a4f, #40916c); }
.bar-fill.blue { background: linear-gradient(135deg, #1a6fb5, #4da6e8); }
.bar-fill.gold { background: linear-gradient(135deg, #b8860b, #f0d060); }
.bar-fill.red { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.bar-fill.purple { background: linear-gradient(135deg, #6c3483, #9b59b6); }
.bar-fill.teal { background: linear-gradient(135deg, #0e7c7b, #17a2b8); }
.bar-fill.orange { background: linear-gradient(135deg, #d35400, #e67e22); }
.bar-fill.pink { background: linear-gradient(135deg, #c0392b, #e74c3c); }

/* --- Donut / Pie Charts (CSS) --- */
.donut-chart { width: 180px; height: 180px; border-radius: 50%; position: relative; margin: 0 auto; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 100px; height: 100px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 2; }
.donut-center .donut-value { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.donut-center .donut-label { font-size: 0.7rem; color: var(--text-muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-light); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* --- SVG Diagram Containers --- */
.diagram-container { margin: 20px 0; text-align: center; overflow-x: auto; }
.diagram-container svg { max-width: 100%; height: auto; }
.diagram-caption { font-size: 0.82rem; color: var(--text-muted); margin-top: 8px; text-align: center; font-style: italic; }

/* --- Infographic Cards --- */
.infographic { display: grid; gap: 12px; margin: 16px 0; }
.infographic.cols-2 { grid-template-columns: 1fr 1fr; }
.infographic.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.infographic.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 700px) {
  .infographic.cols-3, .infographic.cols-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .infographic.cols-2, .infographic.cols-3, .infographic.cols-4 { grid-template-columns: 1fr; }
}
.info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: var(--transition); }
.info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.info-card .ic-icon { font-size: 2.5rem; margin-bottom: 8px; }
.info-card .ic-value { font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); }
.info-card .ic-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.info-card .ic-sub { font-size: 0.82rem; color: var(--text-light); margin-top: 6px; }

/* --- Comparison Tables (Visual) --- */
.compare-row { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 12px 0; }
.compare-col { flex: 1; padding: 16px; text-align: center; }
.compare-col:not(:last-child) { border-right: 1px solid var(--border); }
.compare-col .cc-icon { font-size: 2rem; margin-bottom: 6px; }
.compare-col .cc-title { font-weight: 700; font-size: 0.9rem; color: var(--primary-dark); margin-bottom: 4px; }
.compare-col .cc-value { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.compare-col .cc-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.compare-col.best { background: var(--primary-bg); }

/* --- Timeline Visual --- */
.timeline-visual { position: relative; padding: 20px 0; }
.tv-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--primary-bg); transform: translateX(-50%); }
.tv-item { display: flex; align-items: flex-start; margin-bottom: 24px; position: relative; }
.tv-item:nth-child(odd) { flex-direction: row; }
.tv-item:nth-child(even) { flex-direction: row-reverse; }
.tv-content { width: 45%; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tv-dot { position: absolute; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--primary); border: 3px solid var(--bg-card); z-index: 2; }
.tv-day { font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.tv-title { font-weight: 700; font-size: 0.9rem; color: var(--primary-dark); margin: 4px 0; }
.tv-desc { font-size: 0.82rem; color: var(--text-light); }
@media (max-width: 700px) {
  .tv-line { left: 20px; }
  .tv-item, .tv-item:nth-child(even) { flex-direction: row; padding-left: 44px; }
  .tv-content { width: 100%; }
  .tv-dot { left: 20px; }
}

/* --- Gauge / Progress --- */
.gauge { width: 120px; height: 60px; position: relative; margin: 0 auto 8px; overflow: hidden; }
.gauge-bg { width: 120px; height: 120px; border-radius: 50%; border: 12px solid var(--border); border-bottom-color: transparent; border-left-color: transparent; transform: rotate(225deg); position: absolute; top: 0; }
.gauge-fill { width: 120px; height: 120px; border-radius: 50%; border: 12px solid transparent; position: absolute; top: 0; transform: rotate(225deg); transition: all 1s ease; }
.gauge-value { position: absolute; bottom: 0; width: 100%; text-align: center; font-size: 1.1rem; font-weight: 800; color: var(--primary-dark); }

/* --- Grid Comparison --- */
.grid-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0; }
.gc-item { background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; position: relative; transition: var(--transition); }
.gc-item:hover { border-color: var(--primary-light); }
.gc-item.recommended { border-color: var(--primary); background: var(--primary-bg); }
.gc-item.recommended::after { content: '★ RECOMMENDED'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 2px 10px; border-radius: 50px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px; }
.gc-icon { font-size: 2.2rem; margin-bottom: 8px; }
.gc-title { font-weight: 700; font-size: 0.95rem; color: var(--primary-dark); margin-bottom: 4px; }
.gc-value { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.gc-desc { font-size: 0.8rem; color: var(--text-light); }

/* --- Highlight Stat --- */
.stat-highlight { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin: 20px 0; }
.sh-item { text-align: center; min-width: 100px; }
.sh-item .sh-icon { font-size: 1.8rem; }
.sh-item .sh-value { font-size: 1.8rem; font-weight: 800; color: var(--primary-dark); line-height: 1.2; }
.sh-item .sh-label { font-size: 0.75rem; color: var(--text-muted); }

/* --- Color-coded Tags --- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: 0.72rem; font-weight: 600; }
.tag.green { background: #d4edda; color: #155724; }
.tag.blue { background: #d1ecf1; color: #0c5460; }
.tag.yellow { background: #fff3cd; color: #856404; }
.tag.red { background: #f8d7da; color: #721c24; }
.tag.purple { background: #e8daef; color: #4a235a; }

/* --- Flow Diagram (CSS) --- */
.flow-diagram { display: flex; align-items: center; gap: 0; flex-wrap: wrap; justify-content: center; margin: 20px 0; }
.flow-step { background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 18px; text-align: center; min-width: 120px; }
.flow-step .fs-icon { font-size: 1.5rem; }
.flow-step .fs-label { font-size: 0.82rem; font-weight: 600; color: var(--primary-dark); margin-top: 4px; }
.flow-step .fs-sub { font-size: 0.72rem; color: var(--text-muted); }
.flow-arrow { font-size: 1.5rem; color: var(--primary); padding: 0 6px; }
@media (max-width: 600px) {
  .flow-diagram { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}

[data-theme="dark"] .bar-track { background: #30363d; }
[data-theme="dark"] .compare-col:not(:last-child) { border-right-color: #30363d; }
[data-theme="dark"] .compare-row { border-color: #30363d; }
[data-theme="dark"] .gc-item { background: #161b22; border-color: #30363d; }
[data-theme="dark"] .gc-item.recommended { background: rgba(27,67,50,0.3); border-color: #52b788; }
[data-theme="dark"] .info-card { background: #161b22; border-color: #30363d; }
[data-theme="dark"] .tv-content { background: #161b22; border-color: #30363d; }
[data-theme="dark"] .flow-step { background: #161b22; border-color: #30363d; }
