/* --- Share Button Styles --- */
.share-btn-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 15px;
  gap: 10px;
}

.share-btn {
  background-color: #fff;
  color: #0984e3;
  border: 1px solid #0984e3;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  font-weight: bold;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.share-btn:hover {
  background-color: #0984e3;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.share-btn:active {
  transform: translateY(0);
}

.share-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor; /* Inherits text color */
  transition: fill 0.2s ease;
}

/* Success state for Copy to Clipboard */
.share-btn.copied {
  background-color: #27ae60; /* Green */
  border-color: #27ae60;
  color: #fff;
}

.blurred-cea-pane {
  opacity: 0.85;
  mix-blend-mode: normal;
  /* Make sure transitions are smooth if the user clicks zoom buttons */
  transition: filter 0.2s ease-out;
}

.generic-legend {
  background: rgba(45, 52, 54, 0.9);
  color: #f8f8f8;
  border-radius: 5px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  line-height: 1.5;
  font-family: Arial, sans-serif;
  width: 230px;
  font-size: 12px;
  z-index: 1000;
  padding: 0;
  overflow: hidden; /* Hide content when closed */
  transition: max-height 0.3s ease-in-out;
  font-size: 0.9em;
}

/* Tie into your existing legend animation logic */
.generic-legend.open .legend-content {
  max-height: 500px;
  padding-bottom: 10px;
  transition: max-height 0.3s ease-in;
  overflow-y: auto; /* Allow scrolling inside if it gets too tall */
}
.generic-legend.open .legend-chevron {
  transform: rotate(45deg);
}
.generic-legend .legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.generic-legend .legend-color {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}
.generic-legend .legend-label {
  font-size: 11px;
}
.generic-legend img {
  max-width: 100%;
  display: block;
}

/* ADD: Risk Table and Pill Styles */
.risk-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  color: #25385b;
}
.risk-table th,
.risk-table td {
  padding: 12px;
  text-align: center;
  border: 1px solid #e0e0e0;
}
.risk-table th {
  background-color: #f8f8f8;
  font-size: 0.9em;
}
.risk-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  color: white;
  font-weight: bold;
  font-size: 0.8em;
  text-transform: capitalize;
  min-width: 80px;
}
#risk-iframe {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* --- NEW FORECAST LOADING SPINNER --- */
@keyframes spin-pulse {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.loading-logo {
  width: 80px;
  height: 80px;
  animation: spin-pulse 2s infinite linear;
}

.loading-text {
  color: #487b99;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
}

#forecast-loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9); /* Light theme to match panel */
  z-index: 2000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

/* --- FORECAST DATA TABLE --- */
.forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  color: #25385b;
}
.forecast-table th,
.forecast-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid #e0e0e0;
}
.forecast-table th:first-child,
.forecast-table td:first-child {
  text-align: left;
}
.forecast-table th {
  background-color: #f8f8f8;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.forecast-table tr:hover {
  background-color: #f1f3f5;
}
