/* ===== SECTOR VISUALIZATION ===== */
#ks-sector-viz {
  position: relative;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  user-select: none;
  cursor: default;
}

#ks-sector-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

#ks-sector-svg {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 2;
  display: block;
}

/* Hexagon base */
.ks-hex {
  cursor: pointer;
  transition: filter 0.3s ease;
}
.ks-hex:hover {
  filter: drop-shadow(0 0 6px rgba(180,200,255,0.4));
}
.ks-hex-border {
  stroke: rgba(255,255,255,0.28);
  stroke-width: 1.5;
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}
.ks-hex:hover .ks-hex-border {
  stroke: rgba(255,255,255,0.65);
}
.ks-hex.active .ks-hex-border {
  fill: url(#ks-hex-grad-active) !important;
  stroke: #e03030;
  stroke-width: 2.5;
}
.ks-hex.active {
  animation: ks-pulse 2s ease-in-out infinite;
}
@keyframes ks-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(220,40,40,0.6)); }
  50%       { filter: drop-shadow(0 0 20px rgba(220,40,40,1.0)) drop-shadow(0 0 40px rgba(180,0,0,0.5)); }
}

/* Icon inside hex */
.ks-hex-icon {
  fill: none;
  stroke: rgba(255,255,255,0.9);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.3s ease;
}
.ks-hex.active .ks-hex-icon {
  stroke: #ff6666;
}

/* Label */
.ks-hex-label {
  fill: rgba(255,255,255,0.88);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  text-anchor: middle;
  pointer-events: none;
  transition: fill 0.3s ease;
  letter-spacing: 0.015em;
}
.ks-hex.active .ks-hex-label {
  fill: #ff9999;
}

/* ===== POPUP ===== */
#ks-sector-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(10,15,40,0.97) 0%, rgba(20,5,5,0.97) 100%);
  border: 1px solid rgba(220,40,40,0.6);
  box-shadow: 0 0 40px rgba(220,40,40,0.3), 0 20px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 28px 32px;
  max-width: 420px;
  width: 90vw;
  z-index: 10000;
  color: #fff;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
#ks-sector-popup.visible {
  display: block;
  animation: ks-popup-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes ks-popup-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#ks-sector-popup .ks-popup-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 20px;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  line-height: 1;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px;
}
#ks-sector-popup .ks-popup-close:hover { color: #fff; }

#ks-sector-popup .ks-popup-icon {
  width: 48px; height: 48px;
  margin-bottom: 12px;
}
#ks-sector-popup .ks-popup-icon svg {
  width: 100%; height: 100%;
  fill: none;
  stroke: #e03030;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#ks-sector-popup h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#ks-sector-popup p {
  font-size: 13.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin: 0 0 16px;
}
#ks-sector-popup .ks-popup-clients-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(220,40,40,0.9);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
#ks-sector-popup .ks-popup-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#ks-sector-popup .ks-popup-client {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}

/* Backdrop */
#ks-sector-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  backdrop-filter: blur(2px);
}
#ks-sector-backdrop.visible { display: block; }

/* Mobile responsive */
@media (max-width: 768px) {
  .ks-hex-label { font-size: 8px; }
  #ks-sector-popup { padding: 20px 22px; }
  #ks-sector-popup h3 { font-size: 16px; }
}
@media (max-width: 480px) {
  .ks-hex-label { display: none; }
}
