/* ============================================
   FEDERAL REPUBLIC OF ORDOTERRA
   Official Government Portal — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;600;700&family=Roboto:wght@300;400;500;700;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --navy: #0a0f1a;
  --navy-light: #111827;
  --navy-medium: #1a2332;
  --navy-border: #243447;
  --gray-dark: #1f2937;
  --gray-medium: #374151;
  --gray-light: #6b7280;
  --gray-muted: #9ca3af;
  --white: #e5e7eb;
  --white-bright: #f3f4f6;
  --crimson: #991b1b;
  --crimson-light: #b91c1c;
  --crimson-bright: #dc2626;
  --gold: #b45309;
  --gold-light: #d97706;
  --gold-bright: #f59e0b;
  --steel: #475569;
  --steel-light: #64748b;
  --steel-bright: #94a3b8;
  --success: #15803d;
  --warning: #a16207;
  --danger: #991b1b;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; }
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.8rem; font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 500; }
p { margin-bottom: 1rem; }
a { color: var(--gold-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-bright); text-decoration: underline; }

/* ---- Layout ---- */
.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ---- Header ---- */
.federal-header {
  background: var(--navy-light);
  border-bottom: 3px solid var(--crimson);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.header-top {
  background: var(--crimson);
  padding: 0.3rem 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-main { padding: 1rem 0; }
.header-main .container { display: flex; justify-content: space-between; align-items: center; }
.emblem-wrap { display: flex; align-items: center; gap: 1rem; }
.emblem {
  width: 64px; height: 64px;
  background: var(--navy-medium);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--gold-bright);
  position: relative; overflow: hidden;
}
.emblem::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(245,158,11,0.15), transparent 70%);
}
.nation-title h1 {
  font-size: 1.6rem; line-height: 1.1;
  background: linear-gradient(135deg, var(--white-bright), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nation-title .motto {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--gray-muted); text-transform: uppercase; letter-spacing: 0.15em;
}
.header-meta {
  text-align: right;
  font-family: var(--font-mono); font-size: 0.8rem;
}
.header-meta .status-indicator {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--navy-medium); padding: 0.3rem 0.8rem;
  border-radius: 4px; border: 1px solid var(--navy-border);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- Navigation ---- */
.federal-nav {
  background: var(--navy-medium);
  border-top: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
}
.nav-list {
  display: flex; list-style: none; gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li { flex-shrink: 0; }
.nav-list a {
  display: block; padding: 0.8rem 1.2rem;
  font-family: var(--font-display); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-muted); border-bottom: 3px solid transparent;
  transition: all 0.2s; white-space: nowrap;
}
.nav-list a:hover, .nav-list a.active {
  color: var(--white-bright); background: var(--navy-border);
  border-bottom-color: var(--crimson);
  text-decoration: none;
}

/* ---- Main Content ---- */
main { min-height: calc(100vh - 300px); padding: 2rem 0; }

/* ---- Cards ---- */
.card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--steel); }
.card-header {
  background: var(--navy-medium);
  border-bottom: 1px solid var(--navy-border);
  padding: 1rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
}
.card-header h3 {
  font-size: 1rem; color: var(--white-bright);
  display: flex; align-items: center; gap: 0.5rem;
}
.card-header .icon { color: var(--gold-light); font-size: 1.1rem; }
.card-body { padding: 1.25rem; }
.card-footer {
  background: var(--navy-medium);
  border-top: 1px solid var(--navy-border);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--gray-light);
}

/* ---- Hero Section ---- */
.hero {
  background: var(--navy-light);
  border-bottom: 2px solid var(--crimson);
  padding: 3rem 0;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(153,27,27,0.03) 50px),
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(153,27,27,0.03) 50px);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: 3rem; margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.hero .subtitle {
  font-family: var(--font-mono); font-size: 1rem;
  color: var(--gray-muted); text-transform: uppercase; letter-spacing: 0.2em;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  margin-top: 2rem;
}
.hero-stat {
  background: var(--navy-medium);
  border: 1px solid var(--navy-border);
  padding: 1.5rem;
  text-align: center;
  border-left: 4px solid var(--crimson);
}
.hero-stat .value {
  font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  color: var(--white-bright);
}
.hero-stat .label {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--gray-muted); text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ---- Section Headers ---- */
.section-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem; padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--navy-border);
}
.section-header h2 {
  font-size: 1.4rem; color: var(--white-bright);
}
.section-header .line {
  flex: 1; height: 1px; background: var(--navy-border);
}
.section-header .badge {
  font-family: var(--font-mono); font-size: 0.7rem;
  background: var(--crimson); color: var(--white-bright);
  padding: 0.2rem 0.6rem; border-radius: 2px;
  text-transform: uppercase;
}

/* ---- Tables ---- */
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--navy-medium);
  font-family: var(--font-display); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-muted); font-weight: 500;
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 2px solid var(--navy-border);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--navy-border);
  color: var(--white);
}
.data-table tr:hover td { background: var(--navy-medium); }
.data-table .num { font-family: var(--font-mono); text-align: right; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-display); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  border: none; border-radius: 3px; cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--crimson); color: var(--white-bright); }
.btn-primary:hover { background: var(--crimson-light); }
.btn-secondary { background: var(--navy-medium); color: var(--white); border: 1px solid var(--navy-border); }
.btn-secondary:hover { background: var(--navy-border); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }

/* ---- Badges ---- */
.badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  font-family: var(--font-mono); font-size: 0.7rem;
  border-radius: 2px; text-transform: uppercase;
}
.badge-red { background: rgba(153,27,27,0.2); color: var(--crimson-light); border: 1px solid var(--crimson); }
.badge-gold { background: rgba(180,83,9,0.2); color: var(--gold-light); border: 1px solid var(--gold); }
.badge-green { background: rgba(21,128,61,0.2); color: #4ade80; border: 1px solid var(--success); }
.badge-gray { background: rgba(107,114,128,0.2); color: var(--gray-muted); border: 1px solid var(--gray-light); }

/* ---- Progress Bars ---- */
.progress-bar {
  height: 8px; background: var(--navy-medium);
  border-radius: 4px; overflow: hidden;
}
.progress-bar .fill {
  height: 100%; border-radius: 4px;
  transition: width 1s ease-out;
}
.fill-crimson { background: var(--crimson); }
.fill-gold { background: var(--gold-light); }
.fill-steel { background: var(--steel-light); }
.fill-green { background: var(--success); }

/* ---- Loading States ---- */
.loading-skeleton {
  background: var(--navy-medium);
  border-radius: 4px;
  animation: skeleton 1.5s infinite;
}
@keyframes skeleton {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--navy-border);
  border-top-color: var(--crimson);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Alerts ---- */
.alert {
  padding: 1rem 1.25rem; border-radius: 4px;
  border-left: 4px solid;
  margin-bottom: 1rem;
}
.alert-danger { background: rgba(153,27,27,0.1); border-color: var(--crimson); color: #fca5a5; }
.alert-warning { background: rgba(161,98,7,0.1); border-color: var(--gold); color: #fcd34d; }
.alert-info { background: rgba(71,85,105,0.1); border-color: var(--steel); color: var(--steel-bright); }

/* ---- Footer ---- */
.federal-footer {
  background: var(--navy-light);
  border-top: 3px solid var(--crimson);
  padding: 2rem 0 1rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  font-size: 0.9rem; color: var(--white-bright);
  margin-bottom: 1rem;
}
.footer-col p, .footer-col a {
  font-size: 0.85rem; color: var(--gray-muted);
  display: block; margin-bottom: 0.5rem;
}
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid var(--navy-border);
  padding-top: 1rem;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--gray-light);
}

/* ---- Propaganda Banner ---- */
.propaganda-banner {
  background: var(--crimson);
  padding: 0.75rem 0;
  overflow: hidden;
  position: relative;
}
.propaganda-track {
  display: flex; gap: 3rem;
  animation: scroll 30s linear infinite;
  white-space: nowrap;
  font-family: var(--font-display); font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.15em;
}
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Parliament Seats ---- */
.parliament-seats {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  padding: 1rem;
}
.seat {
  width: 14px; height: 14px; border-radius: 2px;
  transition: transform 0.2s;
}
.seat:hover { transform: scale(1.3); }
.seat-lao { background: var(--crimson); }
.seat-crb { background: var(--steel-light); }
.seat-ind { background: var(--gold); }

/* ---- Chart Containers ---- */
.chart-container {
  position: relative; height: 300px;
  background: var(--navy-medium);
  border: 1px solid var(--navy-border);
  border-radius: 4px; padding: 1rem;
}

/* ---- Ministry Grid ---- */
.ministry-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem;
}
.ministry-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 4px; padding: 1.5rem;
  transition: all 0.2s; cursor: pointer;
}
.ministry-card:hover {
  border-color: var(--crimson);
  box-shadow: 0 4px 15px rgba(153,27,27,0.15);
}
.ministry-card .icon {
  font-size: 2rem; color: var(--gold-light); margin-bottom: 1rem;
}
.ministry-card h4 {
  font-size: 1rem; color: var(--white-bright); margin-bottom: 0.5rem;
}
.ministry-card p {
  font-size: 0.85rem; color: var(--gray-muted); margin: 0;
}

/* ---- News Feed ---- */
.news-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--navy-border);
}
.news-item:last-child { border-bottom: none; }
.news-meta {
  display: flex; gap: 1rem; margin-bottom: 0.5rem;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--gray-light);
}
.news-item h4 {
  font-size: 1rem; color: var(--white-bright); margin-bottom: 0.3rem;
}
.news-item p {
  font-size: 0.85rem; color: var(--gray-muted); margin: 0;
}

/* ---- Counter Animation ---- */
.counter {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
  color: var(--white-bright);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { grid-template-columns: 1fr; }
  .header-main .container { flex-direction: column; gap: 1rem; text-align: center; }
  .header-meta { text-align: center; }
  .nav-list { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ---- Utilities ---- */
.text-crimson { color: var(--crimson-light); }
.text-gold { color: var(--gold-light); }
.text-muted { color: var(--gray-muted); }
.text-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-2 { padding: 1rem; }
.border-left-crimson { border-left: 4px solid var(--crimson); padding-left: 1rem; }
.border-left-gold { border-left: 4px solid var(--gold); padding-left: 1rem; }
