/* Custom styles for Aetherview */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Source+Code+Pro:wght@300;400;600&display=swap');

:root {
  --cyan: #00d4ff;
  --green: #00ff88;
  --orange: #ffaa00;
  --red: #ff4444;
  --yellow: #ffaa00;
  --purple: #bb88ff;
}

.font-orbitron {
  font-family: 'Orbitron', monospace;
}

.font-mono {
  font-family: 'Source Code Pro', monospace;
}

/* Grid background */
.bg-grid {
  background-image: 
    linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Glowing border effect */
.glow-border {
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  transition: box-shadow 0.3s ease;
}

.glow-border:hover {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Simplified Leaflet map container styling for OpenStreetMap */
.leaflet-container {
  background: #0a0a0a !important;
  border-radius: 4px;
  border: 1px solid rgba(0, 212, 255, 0.3) !important;
  font-family: 'Source Code Pro', monospace !important;
  height: 100% !important;
  width: 100% !important;
}

/* Simple dark theme for OpenStreetMap tiles */
.osm-tiles {
  filter: brightness(0.3) contrast(1.3) saturate(0.7) !important;
  transition: filter 0.3s ease;
}

/* Enhanced pulse effect for map markers */
.pulse-marker {
  animation: pulse-marker 2s infinite;
  cursor: pointer !important;
  transition: all 0.3s ease;
}

.pulse-marker:hover {
  animation-duration: 1s;
  filter: brightness(1.5) drop-shadow(0 0 8px currentColor);
  transform: scale(1.1);
}

@keyframes pulse-marker {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* Enhanced Leaflet tooltip styling */
.leaflet-tooltip {
  background: rgba(0, 0, 0, 0.95) !important;
  border: 1px solid #00d4ff !important;
  color: #ffffff !important;
  font-family: 'Source Code Pro', monospace !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4) !important;
  backdrop-filter: blur(8px) !important;
  padding: 8px !important;
}

.custom-leaflet-tooltip {
  background: rgba(0, 0, 0, 0.95) !important;
  border: 1px solid #00d4ff !important;
  border-radius: 6px !important;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5) !important;
  backdrop-filter: blur(10px) !important;
}

.custom-leaflet-tooltip .leaflet-tooltip-content {
  color: #ffffff !important;
  margin: 0 !important;
  font-family: 'Source Code Pro', monospace !important;
  line-height: 1.3 !important;
}

/* Simplified Leaflet zoom controls */
.leaflet-control-zoom {
  border: 1px solid rgba(0, 212, 255, 0.4) !important;
  border-radius: 6px !important;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3) !important;
}

.leaflet-control-zoom a {
  background: rgba(0, 0, 0, 0.9) !important;
  color: #00d4ff !important;
  border: none !important;
  font-family: 'Source Code Pro', monospace !important;
  font-weight: bold !important;
  font-size: 16px !important;
  transition: all 0.3s ease !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  text-align: center !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(0, 212, 255, 0.2) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.3) !important;
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid rgba(0, 212, 255, 0.3) !important;
}

/* Leaflet attribution styling (hidden but styled if shown) */
.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.8) !important;
  color: #00d4ff !important;
  font-family: 'Source Code Pro', monospace !important;
  font-size: 10px !important;
  border: 1px solid rgba(0, 212, 255, 0.3) !important;
  border-radius: 4px !important;
}

/* Interactive marker enhancements */
.leaflet-interactive {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.leaflet-interactive:hover {
  filter: brightness(1.4) drop-shadow(0 0 12px currentColor);
  transform: scale(1.2);
  z-index: 1000;
}

/* Simplified map pane styling */
.leaflet-map-pane {
  filter: contrast(1.1) brightness(0.9);
}

/* Popup styling (if used) */
.leaflet-popup {
  font-family: 'Source Code Pro', monospace !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(0, 0, 0, 0.95) !important;
  border: 1px solid #00d4ff !important;
  border-radius: 6px !important;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4) !important;
  backdrop-filter: blur(10px) !important;
}

.leaflet-popup-content {
  color: #ffffff !important;
  margin: 12px !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}

.leaflet-popup-tip {
  background: rgba(0, 0, 0, 0.95) !important;
  border: 1px solid #00d4ff !important;
}

/* Ensure proper map sizing */
.leaflet-container .leaflet-control-container {
  font-family: 'Source Code Pro', monospace !important;
}

/* Fix for map sizing issues */
.leaflet-container {
  position: relative !important;
  height: 100% !important;
  width: 100% !important;
}

/* Ensure the map renders properly */
.leaflet-map-pane svg,
.leaflet-map-pane canvas {
  pointer-events: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.5);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.7);
}

/* Animation for data points */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--cyan);
  }
  50% {
    box-shadow: 0 0 20px var(--cyan), 0 0 30px var(--cyan);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* Terminal-like text effects */
.terminal-text {
  text-shadow: 0 0 10px currentColor;
}

/* Enhanced backdrop blur */
.backdrop-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Loading animation */
@keyframes matrix-scan {
  0% { width: 0%; }
  100% { width: 100%; }
}

.matrix-loading {
  animation: matrix-scan 3s infinite;
}

/* Connection status indicators */
.status-online {
  color: #00ff88;
  animation: pulse 2s infinite;
}

.status-offline {
  color: #ff4444;
  opacity: 0.8;
}

.status-connecting {
  color: #ffaa00;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Enhanced hover effects */
.hover-glow:hover {
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
  border-color: rgba(0, 212, 255, 0.8);
}

/* Enhanced button transitions */
button {
  transition: all 0.3s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

/* Grid layout improvements */
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

/* Enhanced loading states */
@keyframes scanning {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.animate-scanning {
  animation: scanning 2s infinite;
}

/* Real-time data indicators */
@keyframes data-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.data-updating {
  animation: data-pulse 1s infinite;
}

/* Enhanced map overlay controls */
.map-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .w-80 {
    width: 18rem;
  }
  
  .leaflet-container {
    min-height: 350px !important;
  }
}

@media (max-width: 768px) {
  .w-80 {
    width: 16rem;
  }
  
  .text-2xl {
    font-size: 1.5rem;
  }
  
  .p-4 {
    padding: 0.75rem;
  }
  
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  .leaflet-container {
    min-height: 300px !important;
  }
  
  .leaflet-control-zoom {
    transform: scale(0.9);
  }
}

/* Error state styling */
.error-state {
  background: rgba(255, 68, 68, 0.1);
  border-color: rgba(255, 68, 68, 0.3);
}

.warning-state {
  background: rgba(255, 170, 0, 0.1);
  border-color: rgba(255, 170, 0, 0.3);
}

/* Success state styling */
.success-state {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
}

/* AI analysis specific styling */
.ai-powered {
  background: linear-gradient(45deg, rgba(0, 212, 255, 0.1), rgba(187, 136, 255, 0.1));
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.ai-powered::before {
  content: '🤖';
  margin-right: 0.5rem;
}

/* Map mode indicators */
.map-mode-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 0.5rem;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.75rem;
  color: #00d4ff;
}

/* Smooth transitions for all interactive elements */
* {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Enhanced focus states for accessibility */
button:focus,
input:focus {
  outline: 2px solid rgba(0, 212, 255, 0.5);
  outline-offset: 2px;
}

/* Loading spinner for AI analysis */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin 2s linear infinite;
}

/* Enhanced real-time visual feedback */
@keyframes live-pulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.live-indicator {
  animation: live-pulse 2s infinite;
}

/* Ensure proper layering of map elements */
.leaflet-pane {
  z-index: auto;
}

.leaflet-map-pane {
  z-index: 1;
}

.leaflet-tile-pane {
  z-index: 1;
}

.leaflet-overlay-pane {
  z-index: 2;
}

.leaflet-shadow-pane {
  z-index: 3;
}

.leaflet-marker-pane {
  z-index: 4;
}

.leaflet-tooltip-pane {
  z-index: 5;
}

.leaflet-popup-pane {
  z-index: 6;
}

.leaflet-control-pane {
  z-index: 7;
}

/* Simple tile loading optimization */
.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  cursor: pointer;
}

/* Ensure map is visible and functional */
.leaflet-container a {
  color: inherit;
}

.leaflet-container a.leaflet-active {
  outline: 2px solid orange;
}

/* Improved tile rendering performance */
.leaflet-tile-container {
  transform: translate3d(0, 0, 0);
}

/* Ensure tiles load smoothly */
.leaflet-tile {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}