/* ====================== SECTION ====================== */
.coverage-section {
  padding: 60px 15px;
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.coverage-section {
  background: #f8fafc;
}

/* ====================== INNER CONTAINER ====================== */
.coverage-inner {
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ====================== HEADER ====================== */
.coverage-header {
  text-align: center;
  margin-bottom: 25px;
}

.coverage-header h2 {
  background: linear-gradient(90deg, #0f5ea8, #1d7ed6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  display: inline-block;
  padding-bottom: 6px;
  position: relative;
}

.coverage-header h2::after {
  content: "";
  display: block;
  height: 3px;
  background: #f9a825;
  margin-top: 6px;
  border-radius: 2px;
}

.coverage-header p {
  color: #64748b;
  font-size: 15px;
  margin-top: 6px;
}

/* ====================== TOAST ====================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background: #333;
  color: #fff;
  padding: 12px 18px;
  margin-top: 10px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #22c55e;
}
.toast.warning {
  background: #f9a825;
  color: #1e2937;
}
.toast.error {
  background: #dc3545;
}
.toast.info {
  background: #0f5ea8;
}

/* ====================== CONTROLS ====================== */
.coverage-controls {
  max-width: 800px;
  margin: 0 auto 30px;
}

/* ====================== DETECT LOCATION BUTTON ====================== */
#detect-location {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  height: 54px;
  padding: 0 20px;

  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;

  border: none;
  border-radius: 10px;

  background: linear-gradient(135deg, #f15825, #fb923c);
  color: #fff;

  box-shadow: 0 4px 12px rgba(241, 88, 37, 0.25);
  transition: all 0.25s ease;
  cursor: pointer;
}

#detect-location:hover {
  background: linear-gradient(135deg, #fb923c, #f15825);
  box-shadow: 0 6px 16px rgba(241, 88, 37, 0.35);
  transform: translateY(-1px);
}

/* Optional icon inside */
#detect-location i {
  font-size: 16px;
  color: inherit;
}

/* ====================== SEARCH ====================== */
#city-search,
#coverage-search {
  width: 100%;
  height: 54px;

  padding: 0 16px;
  font-size: 15px;

  border: 2px solid #e2e8f0;
  border-radius: 10px;

  background: #fff;
  box-sizing: border-box;

  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#coverage-search {
  flex: 1;
  max-width: 520px;
  min-width: 260px;
}

/* Focus state */
#city-search:focus,
#coverage-search:focus {
  border-color: #f15825;
  box-shadow: 0 0 0 4px rgba(241, 88, 37, 0.15);
  outline: none;
}
/* Mobile */
@media (max-width: 767.98px) {
  .coverage-controls {
    margin-bottom: 24px;
  }

  #detect-location {
    width: 100%;
  }
}
/* ====================== STATE GROUPS ====================== */
.state-group {
  transition: filter 0.3s ease;
  cursor: pointer;
  position: relative;
  will-change: filter;
}

/* Subtle Hover */
.state-group:hover {
  z-index: 5;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

/* Covered hover glow */
.state-group:hover.covered path {
  filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.75));
}

/* Coming hover glow */
.state-group:hover.coming path {
  filter: drop-shadow(0 0 10px rgba(249, 168, 37, 0.75));
}

.state-group.active {
  z-index: 12 !important;
  filter: drop-shadow(0 14px 22px rgba(15, 94, 168, 0.35)) !important;
}

.state-group.active:hover {
  filter: drop-shadow(0 16px 26px rgba(15, 94, 168, 0.45)) !important;
}

/* Path styles */
.state-group path {
  stroke: #fff;
  stroke-width: 1.3;
  stroke-linejoin: round;
  transform-box: fill-box;
  transition: stroke-width 0.3s ease, stroke 0.3s ease;
}

/* State colors with gradients + glassmorphism */
.state-group.covered path {
  fill: url(#coveredGradient);
  stroke: #008f52;
  fill-opacity: 0.9;
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  animation: breatheGreen 6s ease-in-out infinite;
  stroke-width: 1.6; 
}
.state-group.coming path {
  fill: url(#comingGradient);
  stroke: #b36100;
  fill-opacity: 0.9;
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  animation: breatheOrange 6s ease-in-out infinite;
  stroke-width: 1.6;
}

/* Active states with stronger glass effect */
.state-group.active.covered path,
.state-group.active.coming path {
  fill-opacity: 0.95;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  stroke-width: 2.6;
  stroke: rgba(255, 255, 255, 0.85); 
}

/* Distrito Federal */
.state-group path#DF {
  fill: #22b6f0;
  stroke: #0b78a1;
  stroke-width: 2.6;
  transform-box: fill-box;
  transform-origin: center center;
  transform: scale(1.8);
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(34, 182, 240, 0.6))
          drop-shadow(0 0 12px rgba(34, 182, 240, 0.4));
  transition: transform 0.3s ease, filter 0.3s ease, stroke-width 0.3s ease;
}

/* Hover */
.state-group:hover path#DF {
  transform: scale(2);
}

/* Active */
.state-group.active path#DF {
  transform: scale(2.15);
  stroke-width: 3;
}

.state-group.active path {
  stroke-width: 2.8;
  stroke: #0f5ea8;
}

/* Match highlight */
.state-group.match path {
  stroke: #0f172a;
  stroke-width: 2.2;
}

/* Breathing animations with color shift */
@keyframes breatheGreen {
  0%, 100% { fill: #22c55e; }
  50% { fill: #16a34a; }
}
@keyframes breatheOrange {
  0%, 100% { fill: #ff8c00; }
  50% { fill: #f97316; }
}

@keyframes pulse {
  0% { transform: translateY(-1px) scale(1.005); }
  50% { transform: translateY(-3px) scale(1.015); }
  100% { transform: translateY(-1px) scale(1.005); }
}

/* ====================== STATE CIRCLES ====================== */
.state-group circle {
  fill: rgba(15, 94, 168, 0.25); 
  stroke: #0f5ea8;
  stroke-width: 2;
  transition: all 0.3s ease;
  pointer-events: none; 
}

/* Hover effect */
.state-group:hover circle {
  fill: rgba(15, 94, 168, 0.4);
  stroke-width: 2.5;
}

/* Active state */
.state-group.active circle {
  fill: rgba(15, 94, 168, 0.6);
  stroke: #0f5ea8;
  stroke-width: 3;
}

/* ====================== ANIMATION ====================== */
@media (min-width: 992px) {
  @keyframes pulse {
    0% {
      transform: translateY(-3px);
    }
    50% {
      transform: translateY(-6px);
    }
    100% {
      transform: translateY(-3px);
    }
  }

  .state-group.pulse {
    animation: pulse 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .state-group.pulse circle {
    animation: circlePulse 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .coverage-map path.pulse {
    animation: pulse 0.5s ease forwards;
  }
}


/* Pulse animation */
@keyframes circlePulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

/* ====================== STATE LABELS ====================== */
.state-group text {
  transition: all 0.3s ease;
  user-select: none;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 3;
  stroke-linejoin: round;
  font-size: 13px;
  font-weight: 700;
  fill: #1e2937;
  pointer-events: none;
}

.state-group:hover text {
  font-size: 13.5px; 
  fill: #0f5ea8;
}

.state-group.covered text,
.state-group.coming text {
  fill: #1e2937;
}

.state-group.active text {
  fill: #0f5ea8; 
  font-weight: 800; 
  font-size: 13.5px; 
}

/* Dim mode */
.coverage-map.dimmed .state-group:not(.active) {
  opacity: 0.35;
}

/* Mobile */
@media (max-width: 900px) {
  .state-group text {
    font-size: 11px;
  }
  .state-group:hover {
    z-index: 5;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
    transform: none; 
  }
}
/* ====================== TOOLTIP ====================== */
#coverage-tooltip {
  position: fixed;
  background: rgba(15, 23, 42, 0.97);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(260px, 90vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  line-height: 1.4;
}

#coverage-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* ====================== LEGEND ====================== */
.coverage-legend {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a; 
}

.coverage-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease;
}
.coverage-legend span:hover {
  transform: translateY(-2px);
}

/* Dots with brand styling */
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}
.dot.covered {
  background: #22c55e; 
}
.dot.coming {
  background: #f15825; 
}
.dot.none {
  background: #94a3b8; 
}

/* ====================== LAYOUT ====================== */
.coverage-layout {
  align-items: flex-start;
  row-gap: 24px;
}

/* ====================== MAP ====================== */
.coverage-map {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 0;
}

.coverage-map svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.12));
  isolation: isolate;
}

/* ====================== PANEL ====================== */
.coverage-panel {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;

  /* removed sticky */
  position: relative;
  top: auto;

  height: fit-content;
  max-height: 420px;
  overflow-y: auto;
}

/* Telecom accent bar */
.coverage-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  background: #f15825;
  border-radius: 16px 16px 0 0;
}

/* ====================== CITY GRID ====================== */
.panel-cities {
  max-height: 240px;
  overflow-y: auto;
  margin-top: 14px;
  scrollbar-width: thin;
}
.panel-cities::-webkit-scrollbar {
  width: 6px;
}
.panel-cities::-webkit-scrollbar-thumb {
  background: #94a3b8; 
  border-radius: 3px;
}
.panel-cities span {
  display: inline-block;
  background: #e0f2fe; 
  padding: 6px 12px;
  border-radius: 6px;
  margin: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a; 
  transition: background 0.2s ease, transform 0.2s ease;
}
.panel-cities span:hover {
  background: #f15825; 
  color: #fff;
  transform: translateY(-2px);
}

.panel-cities .empty {
  color: #64748b;
  text-align: center;
  padding: 15px 0;
  font-style: italic;
}

/* ====================== MOBILE ====================== */
.mobile-info {
  display: none;
  background: #0f5ea8;
  color: #fff;
  border-left: 4px solid #f9a825;
  padding: 12px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 14px;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 991.98px) {
  /* Stack map and panel */
  .coverage-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .coverage-map,
  .coverage-panel {
    width: 100%;
    max-width: 100%;
  }

  .coverage-panel {
    position: relative;
    top: auto;
    margin-top: 0;
    max-height: none;
  }

  .coverage-map {
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  #coverage-tooltip {
    display: none;
  }

  .mobile-info {
    display: block;
  }

  .coverage-controls {
    gap: 10px;
    margin: 0 auto 28px;
    padding: 16px 12px;
    background: #f8fafc;
    border-radius: 12px;
  }

  .location-btn {
    width: 100%;
    height: 52px;
    border-radius: 10px;
    padding: 12px 20px;
  }

  .coverage-section {
    padding: 50px 12px;
  }

  /* Keep map centered */
  .coverage-map {
    width: 100%;
    min-height: 85svh; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 0;
  }

  .coverage-map svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    transform: scale(1.3);
    transform-origin: center center;
    margin-right: -14%;
  }
  .coverage-map path {
    stroke-width: 1.8;
    pointer-events: all;
  }

  .coverage-panel {
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .coverage-map {
    max-width: 100%;
  }

  .coverage-map svg {
    width: 100%;
    max-height: 860px;
  }
} 

/* Tablets */
@media (max-width: 1100px) {
  .coverage-map svg {
    max-height: 680px;
  }
}

body,
html {
  overflow-x: hidden;
}
