/* components/rivers.css */
/* River overlay styling and animations */

/* River layer container */
.river-layer {
  position: relative;
  z-index: 5;
}

/* River paths base styling */
.river-path {
  cursor: pointer;
  transition: all 0.3s ease;
  vector-effect: non-scaling-stroke;
}

/* River path on hover */
.river-path:hover {
  stroke-width: 5 !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 6px currentColor);
}

/* Active river styling */
.river-path.river-active {
  animation: riverPulse 1.5s ease-in-out infinite;
}

/* River glow animation */
@keyframes riverPulse {
  0%, 100% {
    opacity: 1;
    stroke-width: 5;
    filter: drop-shadow(0 0 4px currentColor);
  }
  50% {
    opacity: 0.85;
    stroke-width: 6;
    filter: drop-shadow(0 0 8px currentColor);
  }
}

/* River flow animation (optional - for visual effect) */
@keyframes riverFlow {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 12;
  }
}

/* Apply flow animation to rivers */
.river-path {
  stroke-dasharray: 4, 8;
  animation: riverFlow 8s linear infinite;
}

/* River path with glow on active */
.river-path.river-active {
  filter: drop-shadow(0 0 8px rgba(30, 144, 255, 0.8));
  text-shadow: 0 0 10px rgba(30, 144, 255, 0.6);
}

/* River statistics panel styling */
.river-stats {
  background: rgba(102, 126, 234, 0.08);
  border-left: 3px solid #667eea;
  padding: 12px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.8;
}

body.light .river-stats {
  background: rgba(102, 126, 234, 0.05);
}

.river-stats p {
  margin: 6px 0;
  color: #e0e0e0;
}

body.light .river-stats p {
  color: #1a1a2e;
}

.river-stats strong {
  color: #667eea;
  font-weight: 600;
}

/* Side panel adjustments for rivers */
#spContent .river-stats + #spFacts {
  margin-top: 16px;
}

/* Smooth transition when hiding/showing rivers */
.river-path {
  transition: display 0.2s ease, opacity 0.3s ease;
}

/* River layer animations */
#riverLayer {
  animation: fadeInRivers 0.6s ease-out;
}

@keyframes fadeInRivers {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* River highlight effect */
.river-path[data-highlight="true"] {
  stroke-width: 6 !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 12px rgba(30, 144, 255, 0.9));
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
  .river-path {
    stroke-width: 2;
  }

  .river-path:hover {
    stroke-width: 4 !important;
  }

  .river-stats {
    font-size: 12px;
    padding: 10px;
  }
}

/* Dark theme enhancements */
body.dark .river-path {
  mix-blend-mode: screen;
}

/* Light theme enhancements */
body.light .river-path {
  mix-blend-mode: multiply;
  opacity: 0.5 !important;
}

body.light .river-path:hover {
  opacity: 1 !important;
}

/* SVG filter effects */
@supports (filter: drop-shadow(0 0 4px #1e90ff)) {
  .river-path.river-active {
    filter: drop-shadow(0 0 8px rgba(30, 144, 255, 0.8));
  }
}

/* River crossover zones */
.river-intersection {
  fill: none;
  stroke: #667eea;
  stroke-width: 2;
  opacity: 0.4;
  pointer-events: none;
}

/* Accessible label for rivers */
.river-path[data-river-name] {
  /* Allows screen readers to read river names */
  title: attr(data-river-name);
}

/* Focus state for keyboard navigation */
.river-path:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* River tooltip (if needed) */
.river-tooltip {
  position: absolute;
  background: rgba(31, 31, 58, 0.95);
  color: #e0e0e0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  border: 1px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.light .river-tooltip {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Animation for river tooltip appearance */
@keyframes tooltipFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.river-tooltip {
  animation: tooltipFade 0.2s ease-out;
}

/* Historical river variations (for future use) */
.river-path.historical {
  stroke-dasharray: 8, 4;
  opacity: 0.4;
}

/* River information icon */
.river-info-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: #667eea;
  border-radius: 50%;
  color: white;
  text-align: center;
  font-size: 12px;
  line-height: 16px;
  margin-left: 6px;
  cursor: help;
}

/* Floating action button for river details */
.river-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  z-index: 50;
  transition: all 0.3s ease;
}

.river-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.6);
}

.river-fab.active {
  display: flex;
}

/* River legend (if implemented) */
.river-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(31, 31, 58, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 8px;
  padding: 12px;
  max-width: 200px;
  font-size: 12px;
  z-index: 10;
}

body.light .river-legend {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.river-legend-item {
  display: flex;
  align-items: center;
  margin: 6px 0;
  gap: 8px;
}

.river-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Loading states */
.river-layer.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Print styling for rivers */
@media print {
  .river-path {
    stroke: #000;
    opacity: 0.6;
  }

  .river-path.river-active {
    stroke-width: 2;
  }

  #riverLayer {
    display: block !important;
  }
}

