/* Constraints Map specific styles */

.map-container {
  position: relative;
  height: 600px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0;
}

#constraints-map {
  height: 100%;
  width: 100%;
}

/* Map Legend Compact Style */
.map-legend-compact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  padding: 10px;
  background: rgba(44, 62, 80, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item-compact {
  display: flex;
  align-items: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legend-item-compact .legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 5px;
}

.legend-note {
  font-size: 12px;
  font-style: italic;
}

/* Time Slider Styles */
.period-control {
  flex-grow: 1;
  min-width: 200px;
}

.slider-container {
  position: relative;
  margin-top: 8px;
}

.compact-slider input[type="range"] {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: none;
}

.compact-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.compact-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.period-display {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
  color: var(--text-color);
}

/* Boundary Selection Styles */
.constraints-filter {
  margin-bottom: 20px;
}

.boundary-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 20px;
}

.boundary-btn {
  padding: 8px 15px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.boundary-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.boundary-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Legend styles */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: 15px;
  min-width: 200px;
  background: rgba(44, 62, 80, 0.85);
  backdrop-filter: blur(var(--blur-intensity));
  -webkit-backdrop-filter: blur(var(--blur-intensity));
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-legend h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.legend-color {
  height: 12px;
  width: 30px;
  margin-right: 10px;
  border-radius: 2px;
}

.legend-note {
  margin-top: 10px;
  font-size: 12px;
  font-style: italic;
  opacity: 0.8;
}

/* Constraints Table Styles */
.constraints-data-table {
  margin-top: 15px;
  max-height: 400px;
}

#constraints-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

#constraints-table th {
  position: sticky;
  top: 0;
  background: rgba(44, 62, 80, 0.85);
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(var(--blur-intensity));
  -webkit-backdrop-filter: blur(var(--blur-intensity));
  padding: 12px 15px;
  text-align: left;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#constraints-table th:hover {
  background: rgba(255, 255, 255, 0.3);
}

#constraints-table td {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#constraints-table tr {
  transition: all 0.3s ease;
  border-radius: 8px;
}

#constraints-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.1);
}

#constraints-table tr.normal {
  background-color: rgba(0, 128, 0, 0.1);
}

#constraints-table tr.warning {
  background-color: rgba(255, 165, 0, 0.15);
}

#constraints-table tr.critical {
  background-color: rgba(255, 0, 0, 0.15);
}

#constraints-table tr:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.01);
}

/* Info Panel Styles */
.info-panel {
  margin-bottom: 30px;
}

.info-panel .card-content {
  padding: 0 20px 20px;
  line-height: 1.6;
}

.info-panel p {
  margin-bottom: 15px;
  font-size: 15px;
  color: var(--text-color);
}

.info-panel p:last-child {
  margin-bottom: 0;
}

/* Loader and Error styles */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  font-size: 16px;
  color: var(--text-color);
}

.error-message {
  display: none;
  background-color: rgba(255, 0, 0, 0.1);
  border-left: 4px solid #ff3b30;
  color: #ff3b30;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

/* Compact Controls for Map Interface */
.compact-controls {
  margin-bottom: 20px;
}

.compact-header {
  padding: 15px 20px;
}

.controls-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 0 20px 20px;
}

.compact-group {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.compact-input {
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  font-size: 14px;
}

.compact-btn {
  margin-top: auto;
  align-self: flex-end;
}

/* Responsiveness for mobile devices */
@media (max-width: 768px) {
  .map-container {
    height: 500px;
  }
  
  .map-legend-compact {
    padding: 5px;
    gap: 5px;
  }
  
  .legend-item-compact {
    font-size: 10px;
    padding: 3px 6px;
  }
  
  .legend-item-compact .legend-color {
    width: 10px;
    height: 10px;
    margin-right: 3px;
  }
  
  .constraints-data-table {
    max-height: 300px;
  }
  
  #constraints-table {
    font-size: 12px;
  }
  
  #constraints-table th,
  #constraints-table td {
    padding: 8px;
  }
  
  .controls-flex-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .compact-group {
    width: 100%;
  }
  
  .boundary-options {
    justify-content: center;
  }
}

/* Updated Toggle Switch positioning for map header */
.card-header {
  position: relative;
}

.mode-toggle-container {
  display: flex;
  align-items: center;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

#mode-label {
  margin-right: 10px;
  font-weight: 600;
  font-size: 14px;
}

/* Remove the description paragraph as it's no longer needed */
.mode-description {
  display: none;
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Remove old arrow styles */
.custom-arrow-marker {
  display: none;
}

.arrow-head {
  display: none;
}

.arrow-north .arrow-head, .arrow-south .arrow-head {
  display: none;
}

/* Animation classes for the arrows are kept above */

/* Ensure dashed lines remain static */
.glassmorphic-line {
  filter: blur(0.5px);
  transition: all 0.3s ease;
  animation: none !important;
}

/* Prevent any animation from applying to the interactive lines */
.leaflet-interactive {
  animation: none !important;
}

/* Glassmorphic styling for map controls */
.leaflet-control-zoom {
  background: rgba(40, 40, 40, 0.7) !important;
  border: none !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: rgba(60, 60, 60, 0.8) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  transition: all 0.3s ease !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(80, 80, 80, 0.9) !important;
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.5) !important;
  color: white !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  padding: 3px 8px !important;
  border-radius: 4px 0 0 0 !important;
}

.leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Glassmorphic popup styling */
.leaflet-popup-content-wrapper {
  background: rgba(20, 30, 40, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: white !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-popup-tip {
  background: rgba(20, 30, 40, 0.85) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-popup-close-button {
  color: white !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  line-height: 20px !important;
  text-align: center !important;
  right: 5px !important;
  top: 5px !important;
}

.leaflet-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Flow value labels on map */
.flow-value-label {
  background-color: transparent !important;
  border: none !important;
}

.flow-value {
  background-color: rgba(20, 30, 40, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flow-value:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(30, 40, 50, 0.9);
}

.flow-value-label.red .flow-value {
  border-left: 3px solid red;
}

.flow-value-label.orange .flow-value {
  border-left: 3px solid orange;
}

.flow-value-label.green .flow-value {
  border-left: 3px solid green;
}

/* Make feather icons visible and ensure animations work */
.feather-arrow-marker {
  background-color: transparent !important;
  border: none !important;
  pointer-events: none; /* Prevent blocking clicks on the underlying line */
}

.arrow-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.feather-icon {
  width: 36px;
  height: 36px;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.feather-icon.red {
  stroke: red;
  filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.7));
}

.feather-icon.orange {
  stroke: orange;
  filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.7));
}

.feather-icon.green {
  stroke: green;
  filter: drop-shadow(0 0 5px rgba(0, 128, 0, 0.7));
}

/* Animation for north-pointing arrows */
@keyframes float-north {
  0% {
    transform: translateY(20px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-20px);
    opacity: 0.4;
  }
}

/* Animation for south-pointing arrows */
@keyframes float-south {
  0% {
    transform: translateY(-20px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(20px);
    opacity: 0.4;
  }
}

/* Apply animations to feather icons */
.arrow-north .feather-icon {
  animation: float-north 2s infinite ease-in-out;
}

.arrow-south .feather-icon {
  animation: float-south 2s infinite ease-in-out;
} 