@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

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

body {
  font-family: 'Inter', sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  padding: 30px 20px 60px;
}

.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
}

.title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #1a2744;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: #6b7a99;
  margin-bottom: 40px;
}

/* ── MAP CONTAINER ── */
.map-container {
  position: relative;
  width: 100%;
  height: 780px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
  overflow: hidden;
}

.connectors {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── NODES ── */
.node {
  position: absolute;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.node:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(0,0,0,0.18); }

.node-icon { font-size: 1.4rem; margin-bottom: 4px; }
.node-label { font-size: 0.82rem; font-weight: 700; line-height: 1.3; }
.node-label .sub { font-weight: 400; font-size: 0.72rem; opacity: 0.8; }

/* CENTER */
.node.center {
  width: 140px; height: 140px;
  background: linear-gradient(135deg, #1a2744, #2d4a8a);
  color: white;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(26,39,68,0.4);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
}
.node.center .node-label { font-size: 0.78rem; letter-spacing: 0.5px; }

/* BRANCH NODES */
.node.branch {
  width: 110px; height: 80px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.node.orange  { background: #ff8c42; color: white; }
.node.purple  { background: #7c5cbf; color: white; }
.node.teal    { background: #1aaa8a; color: white; }
.node.red     { background: #e05c5c; color: white; }
.node.darkred { background: #b02020; color: white; }

/* ── BRANCH GROUPS ── */
.branch-group { position: absolute; z-index: 2; }

/* Positions for each branch group */
#branch1 { left: 60px;  top: 50%; transform: translateY(-50%); }
#branch2 { left: 200px; top: 60px; }
#branch3 { right: 200px; top: 60px; }
#branch4 { right: 60px; top: 50%; transform: translateY(-50%); }
#branch5 { left: 50%; bottom: 40px; transform: translateX(-50%); }

/* ── LEAF GROUPS ── */
.leaf-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

#branch1 .leaf-group,
#branch4 .leaf-group { margin-top: 10px; }

#branch5 .leaf-group {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  max-width: 480px;
}

/* ── LEAF PILLS ── */
.leaf {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: center;
}

.orange-light  { background: #fff0e0; color: #b85c00; border: 1px solid #ffcc88; }
.green-light   { background: #e6f9ee; color: #1a7a3a; border: 1px solid #88dda8; }
.green         { background: #27ae60; color: white; }
.purple-light  { background: #f0eaff; color: #5a3a9a; border: 1px solid #c4a8f0; }
.grey-light    { background: #f2f2f2; color: #555; border: 1px solid #ccc; }
.grey          { background: #9e9e9e; color: white; }
.red-light     { background: #ffeaea; color: #a00; border: 1px solid #f5aaaa; }
.teal-light    { background: #e0f7f2; color: #0a6e58; border: 1px solid #80d8c8; }
.teal          { background: #1aaa8a; color: white; }
.yellow        { background: #fff8d6; color: #7a5c00; border: 1px solid #f0d060; }
.danger        { background: #c0392b; color: white; font-weight: 700; }
.danger-outline{ background: white; color: #c0392b; border: 2px dashed #c0392b; font-weight: 600; }

/* ── LEGEND ── */
.legend {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #444;
  font-weight: 500;
}
.dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.green-dot  { background: #27ae60; }
.red-dot    { background: #c0392b; }
.grey-dot   { background: #9e9e9e; }
.orange-dot { background: #ff8c42; }
.purple-dot { background: #7c5cbf; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .map-container { height: 1100px; }
  #branch1 { left: 20px; top: 120px; transform: none; }
  #branch2 { left: 20px; top: 300px; }
  #branch3 { right: 20px; top: 300px; }
  #branch4 { right: 20px; top: 120px; transform: none; }
  #branch5 { left: 50%; bottom: 30px; transform: translateX(-50%); }
}