/**
 * Interactive World Map - Styles
 * Version: 1.0.0
 * Includes light and dark theme support
 */

/* ============= BASE STYLES ============= */
.interactive-map-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* ============= LIGHT THEME ============= */
.interactive-map-container.theme-light {
  background-color: #ffffff;
  color: #000000;
}

.interactive-map-container.theme-light .plotly-graph-div {
  background-color: #ffffff !important;
}

.interactive-map-container.theme-light .svg-container {
  background-color: #ffffff !important;
}

/* ============= DARK THEME ============= */
.interactive-map-container.theme-dark {
  background-color: #0d1117;
  color: #ffffff;
}

.interactive-map-container.theme-dark .plotly-graph-div {
  background-color: #0d1117 !important;
}

.interactive-map-container.theme-dark .svg-container {
  background-color: #0d1117 !important;
}

/* Colorbar styling for dark theme */
.interactive-map-container.theme-dark .colorbar text {
  fill: #ffffff !important;
}

.interactive-map-container.theme-dark .colorbar path {
  stroke: #3d4451 !important;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
  .interactive-map-container {
    font-size: 0.9rem;
  }
  
  /* Adjust colorbar for mobile */
  .interactive-map-container .colorbar {
    transform: scale(0.8);
  }
}

@media (max-width: 480px) {
  .interactive-map-container {
    font-size: 0.8rem;
  }
  
  .interactive-map-container .colorbar {
    transform: scale(0.7);
  }
}

/* ============= LOADING STATE ============= */
.interactive-map-container.loading {
  opacity: 0.6;
  pointer-events: none;
}

.interactive-map-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: #29707A;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.interactive-map-container.theme-dark.loading::after {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: #6bb6d6;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============= CUSTOM CONTROLS ============= */
.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-control-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.theme-light .map-control-btn {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #e1e4e8;
}

.theme-light .map-control-btn:hover {
  background-color: #f6f8fa;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.theme-dark .map-control-btn {
  background-color: #21262d;
  color: #ffffff;
  border: 1px solid #3d4451;
}

.theme-dark .map-control-btn:hover {
  background-color: #2d333b;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ============= TOOLTIP CUSTOMIZATION ============= */
.plotly .hoverlayer .hovertext {
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.theme-light .plotly .hoverlayer .hovertext {
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #000000 !important;
  border: 1px solid #e1e4e8;
}

.theme-dark .plotly .hoverlayer .hovertext {
  background-color: rgba(30, 37, 48, 0.95) !important;
  color: #ffffff !important;
  border: 1px solid #3d4451;
}

/* ============= ACCESSIBILITY ============= */
.interactive-map-container:focus {
  outline: 2px solid #4a9ec9;
  outline-offset: 2px;
}

.theme-dark .interactive-map-container:focus {
  outline-color: #6bb6d6;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============= PRINT STYLES ============= */
@media print {
  .interactive-map-container {
    background-color: #ffffff !important;
  }
  
  .map-controls {
    display: none;
  }
}
