/* -------------------------------------------------------
   Winter Storm Preparedness Tool - Styles
   ------------------------------------------------------- */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242836;
  --border: #2e3345;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #6c63ff;
  --accent-hover: #7b73ff;
  --green: #34d399;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* -------------------------------------------------------
   Layout
   ------------------------------------------------------- */

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

nav .container {
  display: flex;
  gap: 1.25rem;
  white-space: nowrap;
  justify-content: center;
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
}
nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

main {
  padding: 1.25rem 0 2rem;
}

/* -------------------------------------------------------
   Cards
   ------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  margin-top: -0.5rem;
}

/* -------------------------------------------------------
   Form Elements
   ------------------------------------------------------- */

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 140px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.25);
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* -------------------------------------------------------
   Buttons
   ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  min-height: 34px;
}

.btn-danger {
  color: var(--red);
  border-color: var(--red);
  background: transparent;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: var(--red);
}

.btn-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------
   Severity Cards
   ------------------------------------------------------- */

.severity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.severity-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.severity-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.severity-meaning {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.severity-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.badge-yellow {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-orange {
  background: rgba(251, 146, 60, 0.15);
  color: var(--orange);
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-red {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.severity-watch {
  border-left: 3px solid var(--yellow);
}

.severity-warning {
  border-left: 3px solid var(--orange);
}

.severity-emergency {
  border-left: 3px solid var(--red);
}

.severity-actions {
  list-style: none;
  padding: 0;
}

.severity-actions li {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.25rem 0 0.25rem 1rem;
  position: relative;
}

.severity-actions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.severity-watch .severity-actions li::before {
  background: var(--yellow);
}

.severity-warning .severity-actions li::before {
  background: var(--orange);
}

.severity-emergency .severity-actions li::before {
  background: var(--red);
}

/* -------------------------------------------------------
   Supply Table
   ------------------------------------------------------- */

.supply-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.supply-table th {
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.supply-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.supply-table tr:last-child td {
  border-bottom: none;
}

.supply-table .supply-amount {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.supply-table .supply-notes {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* -------------------------------------------------------
   Checklist
   ------------------------------------------------------- */

.checklist-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.checklist-category {
  margin-bottom: 0.75rem;
}

.checklist-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}

.checklist-category-header:hover {
  border-color: var(--accent);
}

.category-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.category-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.checklist-category.open .category-arrow {
  transform: rotate(90deg);
}

.checklist-items {
  display: none;
  padding: 0.25rem 0;
}

.checklist-category.open .checklist-items {
  display: block;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.1s;
}

.checklist-item:hover {
  background: var(--surface-2);
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-item.checked .checklist-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.checklist-label {
  color: var(--text);
}

/* -------------------------------------------------------
   Progress Bar
   ------------------------------------------------------- */

.progress-bar-wrap {
  margin-top: 1rem;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: center;
}

/* -------------------------------------------------------
   Ad Slots
   ------------------------------------------------------- */

.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------------------------------------
   Guide / SEO Content
   ------------------------------------------------------- */

.guide-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.guide-content h3:first-child {
  margin-top: 0;
}

.guide-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.guide-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0.75rem;
}

.guide-content li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0 0.3rem 1rem;
  position: relative;
}

.guide-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* -------------------------------------------------------
   Footer
   ------------------------------------------------------- */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* -------------------------------------------------------
   Print Styles
   ------------------------------------------------------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  header, nav, footer, .ad-slot, .btn-row,
  .checklist-controls, .progress-bar-wrap, .progress-text {
    display: none !important;
  }

  .card {
    background: #fff;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .card h2 {
    color: #000;
  }

  .section-desc,
  .supply-table td,
  .supply-table th,
  .checklist-label,
  .category-title {
    color: #333 !important;
  }

  .supply-table .supply-amount {
    color: #000;
  }

  .checklist-items {
    display: block !important;
  }

  .checklist-item.checked .checklist-label {
    text-decoration: line-through;
    color: #999 !important;
  }

  .severity-card {
    background: #fff;
    border: 1px solid #ccc;
  }

  .severity-actions li {
    color: #333;
  }
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */

@media (max-width: 600px) {
  header h1 {
    font-size: 1.3rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-group {
    min-width: 100%;
  }

  nav .container {
    justify-content: flex-start;
    padding: 0 1rem;
  }

  .supply-table {
    font-size: 0.85rem;
  }

  .supply-table th,
  .supply-table td {
    padding: 0.5rem;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .form-group {
    min-width: 45%;
  }
}
