/* =====================
   RESET & BASE
===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green:        #2d6a4f;
  --green-light:  #d8f3dc;
  --yellow:       #b5770d;
  --yellow-light: #fff3cd;
  --orange:       #c2440b;
  --orange-light: #fde8d8;
  --red:          #9b1c1c;
  --red-light:    #fde8e8;

  --text:         #1a1a2e;
  --text-muted:   #555;
  --bg:           #f9f9f9;
  --white:        #ffffff;
  --radius:       12px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

/* =====================
   QUICK EXIT
===================== */
#quick-exit {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  background: #c0392b;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.2s;
}
#quick-exit:hover {
  background: #96281b;
}

/* =====================
   HEADER
===================== */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d3561 100%);
  color: white;
  padding: 60px 20px 40px;
  text-align: center;
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
}

header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.tagline {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto;
}

/* =====================
   TAB NAV
===================== */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: #1a1a2e;
  padding: 0 20px 0;
  border-bottom: 3px solid #2d3561;
}

.tab-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: white;
}

.tab-btn.active {
  color: white;
  border-bottom-color: #74b9ff;
}

/* =====================
   MAIN / TABS
===================== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* =====================
   SPECTRUM TAB
===================== */
.spectrum-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.spectrum-intro strong {
  color: var(--text);
}

/* Gradient bar */
.spectrum-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 40px;
}

.bar-gradient {
  flex: 1;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(to right, #2d6a4f, #b5770d, #c2440b, #9b1c1c);
}

.bar-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Zone sections */
.zone-section {
  margin-bottom: 48px;
}

.zone-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.zone-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zone-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.zone-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding-left: 28px;
}

/* Behavior cards grid */
.behaviors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.behavior-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.behavior-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.behavior-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.behavior-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.behavior-card .learn-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

/* Zone-specific card colors */
.zone-green .behavior-card  { border-left: 4px solid var(--green); }
.zone-green .behavior-card:hover { border-color: var(--green); }
.zone-green .learn-more { color: var(--green); }

.zone-yellow .behavior-card { border-left: 4px solid var(--yellow); }
.zone-yellow .behavior-card:hover { border-color: var(--yellow); }
.zone-yellow .learn-more { color: var(--yellow); }

.zone-orange .behavior-card { border-left: 4px solid var(--orange); }
.zone-orange .behavior-card:hover { border-color: var(--orange); }
.zone-orange .learn-more { color: var(--orange); }

.zone-red .behavior-card   { border-left: 4px solid var(--red); }
.zone-red .behavior-card:hover { border-color: var(--red); }
.zone-red .learn-more { color: var(--red); }

/* =====================
   MODAL
===================== */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#modal-overlay.hidden {
  display: none;
}

#modal-box {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  max-width: 560px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

#modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#modal-close:hover { background: #ddd; }

#modal-zone-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}

#modal-plain {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-section p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-source {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

/* =====================
   MAPPER TAB
===================== */
.mapper-intro {
  max-width: 600px;
  margin: 0 auto 32px;
  text-align: center;
}

.mapper-intro h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.mapper-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

.mapper-zone {
  margin-bottom: 32px;
}

.mapper-zone-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  display: inline-block;
}

.mapper-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.mapper-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--text);
}

.mapper-item label {
  cursor: pointer;
}

.mapper-item label strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.mapper-item label span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Result box */
#mapper-result {
  margin-top: 32px;
  padding: 28px;
  border-radius: var(--radius);
  text-align: center;
}

#mapper-result.hidden { display: none; }

#mapper-result h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

#mapper-result p {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

/* =====================
   RESOURCES TAB
===================== */
#tab-resources h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

#tab-resources > p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.resource-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 4px solid #74b9ff;
}

.resource-card.urgent {
  border-top-color: var(--red);
  background: var(--red-light);
}

.resource-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.resource-card p {
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text);
}

.resource-note {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  margin-top: 8px !important;
  font-style: italic;
}

/* =====================
   FOOTER
===================== */
footer {
  text-align: center;
  padding: 32px 20px;
  font-size: 0.8rem;
  color: #aaa;
  border-top: 1px solid #eee;
}

footer p {
  margin-bottom: 4px;
}

/* =====================
   UTILITY
===================== */
.hidden { display: none !important; }

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 600px) {
  .tab-btn {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  #modal-box {
    padding: 24px 20px;
  }

  .behaviors-grid {
    grid-template-columns: 1fr;
  }
}
