/* EuroMeteo Explorer Shiny App 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-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;
}

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

.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%;
}

/* Time Slider Panel */
#time_slider_panel {
  z-index: 999 !important;
}

#time_slider_panel .form-group {
  margin-bottom: 0;
}

#time_slider_panel .irs {
  font-size: 11px;
}

#time_slider_panel .irs-bar,
#time_slider_panel .irs-bar-edge {
  background: #3498db;
  border: none;
}

#time_slider_panel .irs-single,
#time_slider_panel .irs-from,
#time_slider_panel .irs-to {
  background: #3498db;
}

#selected_time_label {
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

/* Map Legend Styling */
.map-legend-panel {
  background: rgba(255, 255, 255, 0.85);
  padding: 18px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: 140px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.legend-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 15px;
  text-align: center;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

.legend-item {
  display: flex;
  align-items: center;
  height: 15px;
  position: relative;
}

.legend-color {
  width: 40px;
  height: 100%;
}

.legend-label {
  font-size: 13px;
  font-weight: 500;
  color: #2c3e50;
  margin-left: 0;
  position: absolute;
  left: 50px;
  top: -6px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .map-legend-panel {
    display: none;
  }
}