:root{
  --bg: #0b1220;
  --surface: #ffffff;
  --text: #0b1220;
  --muted: #637083;
  --border: #e7edf5;

  --primary: #0d47a1;   /* institutional blue */
  --primary2: #0b66ff;  /* accent blue */
  --danger: #c1121f;
  --warning: #f59f00;
  --success: #0f766e;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow2: 0 18px 50px rgba(15, 23, 42, .10);

  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing: border-box; }
html { scroll-behavior: smooth; }
body{
  font-family: var(--font);
  color: var(--text);
  background: #f5f7fb;
}

.skip-link{
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 9999;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus{ left: 12px; }

.utility-bar{
  background: linear-gradient(90deg, #0b1220 0%, #0b1b3b 60%, #0b1220 100%);
  color: #fff;
  padding: 10px 0;
}
.utility-pill{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}
.utility-112{
  font-weight: 800;
  letter-spacing: .3px;
  color: #ffd166;
}

.site-header .navbar{
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(13,71,161,.12), rgba(11,102,255,.10));
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(13,71,161,.10);
  font-size: 22px;
}
.brand-title{
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 18px;
  line-height: 1.1;
}
.brand-subtitle{
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: 2px;
}

.navbar .nav-link{
  font-weight: 600;
  color: #1f2a44;
}
.navbar .nav-link:hover{ color: var(--primary2); }
.navbar .nav-link.active{ color: var(--primary); }

.alert-ticker{
  background: linear-gradient(90deg, #8b0f1a 0%, #c1121f 35%, #8b0f1a 100%);
  color: #fff;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.ticker-dot{
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 6px rgba(255,209,102,.18);
}

.hero{
  padding: 28px 0 10px;
  background:
    radial-gradient(1200px 500px at 20% 0%, rgba(11,102,255,.14) 0%, rgba(11,102,255,0) 55%),
    radial-gradient(900px 400px at 90% 20%, rgba(193,18,31,.12) 0%, rgba(193,18,31,0) 55%),
    linear-gradient(#f5f7fb, #f5f7fb);
}
.hero-card{
  background: rgba(255,255,255,.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow2);
  backdrop-filter: blur(8px);
}
.badge-soft{
  border-radius: 999px;
  font-weight: 700;
}

.hero-title{
  font-weight: 850;
  font-size: clamp(26px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  margin: 10px 0 12px;
}
.hero-lead{
  color: #3b4a63;
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
}

.hero-metrics{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.metric{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
}
.metric-k{
  font-weight: 800;
  font-size: 18px;
}
.metric-v{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.quick-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  height: 100%;
}
.quick-tile{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-tile:hover{
  transform: translateY(-2px);
  border-color: rgba(11,102,255,.35);
  box-shadow: 0 16px 45px rgba(15, 23, 42, .12);
}
.qt-icon{
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid var(--border);
}
.qt-title{ font-weight: 800; }
.qt-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.mini-card{
  background: linear-gradient(135deg, rgba(13,71,161,.08), rgba(193,18,31,.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.mini-112{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 94px;
  text-align: center;
}
.mini-112-k{ font-weight: 900; font-size: 22px; color: var(--danger); }
.mini-112-v{ font-size: 12px; color: var(--muted); }

.section{ padding: 48px 0; }
.section-alt{ background: #ffffff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-title{
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-sub{ margin: 6px 0 0; color: var(--muted); }

.alerts-list{ display: grid; gap: 10px; }
.alert-row{
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.sev{
  width: 8px;
  border-radius: 999px;
  height: 100%;
  min-height: 48px;
}
.sev.high{ background: var(--danger); }
.sev.medium{ background: var(--warning); }
.sev.low{ background: var(--primary2); }

.alert-title{
  font-weight: 800;
  margin: 0 0 6px;
}
.alert-meta{
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}
.pill.high{ background: rgba(193,18,31,.08); border-color: rgba(193,18,31,.20); color: #8b0f1a; }
.pill.medium{ background: rgba(245,159,0,.10); border-color: rgba(245,159,0,.25); color: #7a4b00; }
.pill.low{ background: rgba(11,102,255,.10); border-color: rgba(11,102,255,.22); color: #0b3ea9; }

.card-modern{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.icon-bubble{
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  font-size: 20px;
}

.accordion-modern .accordion-item{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.accordion-modern .accordion-button{
  font-weight: 800;
}
.accordion-modern .accordion-button:not(.collapsed){
  background: rgba(11,102,255,.08);
  color: #0b3ea9;
}

.doc-card{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.doc-ic{
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid var(--border);
}
.doc-title{ font-weight: 800; }
.doc-meta{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.site-footer{
  background: linear-gradient(90deg, #0b1220 0%, #0b1b3b 60%, #0b1220 100%);
  color: #fff;
  margin-top: 10px;
}

.btn-floating{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .25);
}

@media (max-width: 991px){
  .hero-metrics{ grid-template-columns: 1fr; }
}


/* Crisis Map Styles */
.map-legend-item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.legend-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}

.crisis-legend-list{
  max-height: 432px;
  overflow-y: auto;
}
.crisis-item{
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
}
.crisis-item:last-child{ border-bottom: none; }
.crisis-item:hover{ background: #f8fafc; }
.crisis-item.active{ background: rgba(11,102,255,.08); }

.crisis-icon{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  border: 1px solid var(--border);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper{
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, .18);
}
.leaflet-popup-content{
  margin: 14px;
  font-family: var(--font);
}
.popup-title{
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 15px;
}
.popup-meta{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Fix map tiles in Bootstrap */
.leaflet-pane img, 
.leaflet-tile, 
.leaflet-marker-icon, 
.leaflet-marker-shadow {
    max-width: none !important;
    max-height: none !important;
}

/* Ensure map container has a solid background while loading */
#crisisMap {
    background: #f8fafc;
    z-index: 1; /* Fix for some Bootstrap stacking contexts */
}


/* --- ALERTS PAGE STYLES --- */
.page-header {
  border-bottom: 1px solid var(--border);
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.stat-badge-danger { border-left: 4px solid #dc3545; }
.stat-badge-warning { border-left: 4px solid #ffc107; }
.stat-badge-info { border-left: 4px solid #0dcaf0; }

.stat-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.stat-badge-danger .stat-badge-icon { background: rgba(220,53,69,.1); color: #dc3545; }
.stat-badge-warning .stat-badge-icon { background: rgba(255,193,7,.1); color: #ffc107; }
.stat-badge-info .stat-badge-icon { background: rgba(13,202,240,.1); color: #0dcaf0; }

.stat-badge-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.stat-badge-label {
  font-size: 12px;
  color: var(--muted);
}

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alert-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s ease;
}
.alert-card:hover {
  box-shadow: var(--shadow2);
}

.alert-card-header {
  padding: 20px;
  display: flex;
  align-items: start;
  gap: 16px;
}

.alert-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 2px solid;
  flex-shrink: 0;
}

.alert-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.alert-description {
  color: var(--muted);
  margin: 0;
}

.alert-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}

.alert-card-body {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}
.alert-card-body.show {
  max-height: 600px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.action-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.action-list li {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
  padding-left: 36px;
}
.action-list li:before {
  content: "✓";
  position: absolute;
  left: 12px;
  color: var(--primary);
  font-weight: bold;
}

.time-info {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.time-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.time-row:last-child { border-bottom: none; }
.time-label { color: var(--muted); font-size: 14px; }
.time-value { font-weight: 600; font-size: 14px; }

.alert-card-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}

.toggle-details {
  flex-shrink: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* News Page Specifics */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.card-hover-effect {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.1) !important;
}

.bg-gradient-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
}

.page-link {
    color: var(--text);
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}
.page-link:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}
.page-item.active .page-link {
    background-color: var(--primary);
    color: white;
}


/* Documents Page Specifics */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Custom form select styling for better feel */
.form-select, .form-control {
    border-color: #dee2e6;
    padding: 0.6rem 1rem;
}
.form-select:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 71, 161, 0.1);
}

/* Guides Page Styles */
.guides-hero {
    background: linear-gradient(135deg, #f5f7fb 0%, #e7edf5 100%);
}

.guide-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.guide-list {
    padding-left: 1.2rem;
    margin: 0;
}

.guide-list li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.guide-card {
    transition: transform 0.2s ease;
}

.guide-card:hover {
    transform: translateY(-3px);
}

.guide-card-before {
    border-left: 4px solid var(--primary);
}

.guide-card-during {
    border-left: 4px solid var(--danger);
}

.guide-card-after {
    border-left: 4px solid #ffc107;
}

.step-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.step-item:hover {
    background: #f8f9fa;
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.step-content h6 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.nav-pills .nav-link {
    color: var(--text);
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    background: #f1f5f9;
}

.nav-pills .nav-link.active {
    background: var(--primary);
}


/* Contact Page Specifics */
#contactMap {
    z-index: 1; /* Fix overlay issues with navbars */
}

/* Custom leaflet popup style match */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.leaflet-popup-content {
    font-family: var(--font);
    font-size: 14px;
    margin: 16px;
}
