/* DWD Explorer Custom Styles */

/* Make modal title take full width so flexbox alignment works */
.modal-header .modal-title {
  flex: 1 !important;
  width: 100% !important;
}

/* Frozen overlay - blocks all interactions during data loading */
.frozen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  cursor: wait;
}

.frozen-overlay.active {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  padding: 80px 30px 30px 30px !important;
}

.frozen-overlay-content {
  position: relative;
  background: white;
  width: 400px;
  min-height: 200px;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.frozen-overlay-content .spinner-border {
  width: 3rem;
  height: 3rem;
  margin-bottom: 15px;
}

.frozen-overlay-content p {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.frozen-overlay-station {
  font-size: 1.3rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 10px;
}

.frozen-overlay-close {
  position: absolute;
  top: 10px;
  right: 15px;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  line-height: 1;
}

.frozen-overlay-close:hover {
  color: #000;
}

/* Disable pointer events on sidebar when frozen */
body.ui-frozen .bslib-sidebar-layout>.sidebar {
  pointer-events: none;
  opacity: 0.6;
}

body.ui-frozen .navbar {
  pointer-events: none;
  opacity: 0.6;
}

/* Keep the floating panel active for close button */
body.ui-frozen #station_detail_panel {
  pointer-events: auto;
  opacity: 1;
}

div.outer {
  position: relative;
  height: calc(100vh - 100px);
}

#station_detail_panel {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  max-height: 90vh;
  z-index: 1000 !important;
}

.close-btn-custom {
  position: absolute;
  top: 10px;
  right: 15px;
  border: none;
  background: none;
  font-size: 1.2rem;
  color: #666;
}

.close-btn-custom:hover {
  color: #000;
}

#zoom_home_panel {
  z-index: 999 !important;
}

.btn-home {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  color: #444;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-home:hover {
  background: #f4f4f4;
  color: #000;
}

/* Move plotly modebar to bottom */
.plotly .modebar-container {
  top: auto !important;
  bottom: 10px !important;
}

.plotly .modebar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 4px;
  padding: 2px 5px;
}

/* Collapsible Map Control Styling */
.map-layer-control {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  padding: 5px;
  width: 36px;
  height: 36px;
  overflow: hidden;
  transition: width 0.3s ease, height 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.map-layer-control.expanded {
  width: 200px;
  height: auto;
  padding: 10px;
}
.control-icon {
  width: 26px;
  height: 26px;
  text-align: center;
  margin-bottom: 5px;
  font-size: 18px;
  color: #333;
  flex-shrink: 0;
}
.control-content {
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 5px;
  white-space: nowrap;
}
.map-layer-control.expanded .control-content {
  opacity: 1;
  white-space: normal;
}
.map-layer-control.expanded .control-icon {
  display: none !important;
}
.map-layer-control .control-content label {
  font-size: 85%;
}