/* Living Democratic Risk Dashboard - Simplified Styles */
/* Focus on readability, clear hierarchy, and consistent structure */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f8fafc;
}

/* Header */
header {
  background: #1e293b;
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#last-updated {
  font-size: 1rem;
  color: #cbd5e1;
}

/* Main Content */
main {
  max-width: 80%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Loading States */
.loading-container, .error-container {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.error-container {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.error-container ul {
  text-align: left;
  max-width: 500px;
  margin: 1rem auto;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

/* Summary Section */
.summary-section .card {
  margin-bottom: 3rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.summary-item {
  text-align: center;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.summary-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

.score-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1a1a1a;
}

.score-trend, .action-text, .tripwires-text {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Badges */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.stable-democracy {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge.early-warnings {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge.concrete-erosion {
  background: #fed7aa;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge.safe-exit-window {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.badge.execute-planned-move {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.badge.acceleration-immediate-move {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Metrics Section */
.metrics-section {
  margin-bottom: 3rem;
}

.metrics-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2rem;
  text-align: center;
}

.metrics-horizontal {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.metric-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.metric-header {
  margin-bottom: 1.5rem;
}

.metric-title-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.metric-title-area h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.metric-score-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-details-inline {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.score-stat-inline {
  font-size: 0.875rem;
  color: #6b7280;
  background: #f1f5f9;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.metric-description {
  color: #4b5563;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* News Items */
.news-items {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
}

.news-items h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}

.news-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
}

.news-header {
  margin-bottom: 1rem;
}

.news-title-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.news-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.news-impact-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-impact {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.news-impact.positive {
  background: #fecaca;
  color: #dc2626;
}

.news-impact.negative {
  background: #dcfce7;
  color: #166534;
}

.news-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.news-status.proposed {
  background: #fef3c7;
  color: #92400e;
}

.news-status.enacted {
  background: #fecaca;
  color: #dc2626;
}

.news-summary {
  color: #4b5563;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.news-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #6b7280;
}

.news-sources {
  display: flex;
  gap: 0.5rem;
}

.news-sources a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.news-sources a:hover {
  text-decoration: underline;
}

.no-events {
  color: #6b7280;
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* Evidence Section */
.evidence-section {
  margin-bottom: 3rem;
}

.evidence-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  text-align: center;
}

.section-description {
  text-align: center;
  color: #6b7280;
  margin-bottom: 2rem;
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.evidence-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.evidence-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.evidence-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.evidence-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.evidence-summary {
  color: #4b5563;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.evidence-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Footer */
footer {
  background: #1e293b;
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  main {
    max-width: 95%;
    padding: 1rem 0.5rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-title-area {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .metric-score-area {
    margin-top: 0.5rem;
  }
  
  .news-title-area {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .news-impact-row {
    margin-top: 0.5rem;
  }
  
  .evidence-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .evidence-status {
    margin-top: 0.5rem;
  }
}