:root {
  --color-tornado: #ff0000;
  --color-severe-thunderstorm: #ffc107;
  --color-flash-flood: #28a745;
  --color-hurricane: #6f42c1;
  --color-text-light: white;
  --color-text-dark: black;
  --font-main: sans-serif;
}

body {
  font-family: var(--font-main);
  margin-left: 30px;
  position: relative;
}

#hurridash-link {
  position: absolute;
  top: 10px;
  right: 20px;
  background-color: blue;
  color: #f59e0b;
  padding: 10px 15px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  display: block;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid #0000cc;
}

#hurridash-link:hover {
  background-color: #0000cc;
}
  
  #warnings-container {
    width: 90%;
    margin: 20px 0 20px 0;
  }
  
  .warning {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .warning h3 {
    margin-top: 0;
    color: #333;
  }
  
  .warning p {
    margin-bottom: 5px;
    line-height: 1.6;
  }

  .warning-section {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #eee;
  }

  .warning-section-title {
    font-weight: bold;
    font-size: 1em;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
  }

  .warning-section-instructions .warning-section-title {
    color: #b58900;
  }

  .warning-section-body p {
    margin: 0 0 10px 0;
    line-height: 1.6;
  }

  .warning-section-body p:last-child {
    margin-bottom: 0;
  }

  .new-warning {
    color: red;
  }
  
  .new-watch {
    color: blue;
  }
  
  #warning-counts {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  
  #warning-counts div {
    color: white;
    padding: 10px;
    margin-right: 10px;
    border-radius: 5px;
  }
  
  #tornado-observed-count,
  #tornado-radar-count {
    background-color: var(--color-tornado);
    color: var(--color-text-light);
  }
  
  #severe-thunderstorm-count {
    background-color: var(--color-severe-thunderstorm);
    color: var(--color-text-dark);
  }
  
  #hurricane-count {
    background-color: var(--color-hurricane);
    color: var(--color-text-light);
  }

  /* Emergency banners */
  .emergency-banner {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    border-radius: 5px;
    animation: flash 1s infinite;
  }

  .tornado-emergency-banner {
    background-color: #8B0000;
  }

  .pds-warning-banner {
    background-color: #FF4500;
  }

  .flash-flood-emergency-banner {
    background-color: #006400;
  }

  @keyframes flash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
  }

  /* Respect users who ask for reduced motion — disable the flashing animation
     (photosensitivity) while keeping the banner fully visible. */
  @media (prefers-reduced-motion: reduce) {
    .emergency-banner {
      animation: none;
    }
  }

/* State filter styling */
#state-filter-container {
  margin-bottom: 15px;
}

#state-filter-container details {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  background-color: #f9f9f9;
}

#state-filter-container summary {
  font-weight: bold;
  cursor: pointer;
  outline: none;
  user-select: none;
}

#state-filter-container summary:hover {
  color: #0066cc;
}

#state-checkboxes {
  background-color: white;
}

#state-checkboxes label {
  cursor: pointer;
}

#state-checkboxes label:hover {
  background-color: #f0f0f0;
  padding: 2px;
  border-radius: 3px;
}

/* Full alert link (bottom of each warning) */
.full-alert-link-container {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #ccc;
  font-size: 0.9em;
}

.full-alert-link {
  background: none;
  border: 1px solid #0066cc;
  color: #0066cc;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: none;
  display: inline-block;
}

.full-alert-link:hover {
  background-color: #0066cc;
  color: white;
}

/* Links on NHC/CPHC advisory-summary (synthetic tropical) cards reuse the boxed
   .full-alert-link button style; this only adds spacing between the two buttons. */
.nhc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

/* Full alert modal */
.full-alert-modal[hidden] {
  display: none;
}

.full-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.full-alert-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.full-alert-modal-content {
  position: relative;
  background-color: white;
  max-width: 860px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 24px 28px 28px 28px;
  margin: auto;
}

.full-alert-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 4px 10px;
  border-radius: 4px;
}

.full-alert-modal-close:hover {
  background-color: #eee;
  color: #000;
}

/* Formatted alert layout (matches nws_alert.py structure) */
.alert-header {
  border-top: 3px solid;
  border-bottom: 3px solid;
  padding: 14px 0;
  margin-bottom: 14px;
}

.alert-event {
  font-size: 1.6em;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.alert-headline {
  margin-top: 6px;
  font-size: 1em;
  color: #222;
}

/* "As of <issuance time>" line — the very first line of the Key Messages popup. */
.alert-as-of {
  margin-bottom: 10px;
  font-size: 0.95em;
  font-weight: 600;
  color: #444;
}

.alert-key-messages {
  margin: 0;
  padding-left: 1.4em;
}

.alert-key-messages li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.alert-key-messages li:last-child {
  margin-bottom: 0;
}

.alert-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 12px;
}

.alert-section {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #ddd;
}

.alert-section-title {
  font-weight: bold;
  font-size: 1em;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.alert-instructions .alert-section-title {
  color: #b58900;
}

.alert-row {
  margin-bottom: 4px;
  line-height: 1.5;
}

.alert-label {
  color: #006699;
  font-weight: 600;
}

.alert-rel {
  color: #777;
  font-size: 0.9em;
}

.alert-threat-value {
  color: #c62828;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert-body p {
  margin: 0 0 10px 0;
  line-height: 1.55;
}

.alert-body p:last-child {
  margin-bottom: 0;
}

/* Verbatim advisory preamble (headline + summary-of-info) in the View Advisory modal. */
.alert-advisory-preamble {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.85em;
  line-height: 1.45;
}

.alert-footer {
  font-size: 0.85em;
  color: #666;
  word-break: break-all;
}

.alert-footer code {
  font-size: 0.95em;
}

.alert-footer a {
  color: #0066cc;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    margin-left: 15px;
    margin-right: 15px;
  }
  
  #warning-counts {
    justify-content: center;
  }
  
  #warning-counts div {
    margin-bottom: 10px;
    flex: 1 1 45%;
    text-align: center;
  }
  
  #warnings-container {
    width: 100%;
  }
}