/* Mission Planning Styles */

/* Mission header styles */
.mission-header h1 {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.mission-back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.mission-back-link svg {
  margin-right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
}

/* Dock marker styles */
.dock-marker {
  z-index: 850 !important; /* Above waypoints but below controls */
}

.dock-marker div {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

/* Drone marker styles */
.drone-marker {
  z-index: 900 !important; /* Above waypoints */
}

.drone-marker div {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

/* Floating panels */
.waypoint-mission-panel {
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  z-index: 1000 !important; /* Ensure panels are above map elements */
  opacity: 0.95 !important; /* Start with higher opacity */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.waypoint-mission-panel:hover {
  opacity: 1 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15) !important;
}

/* Custom map controls */
.leaflet-control-zoom {
  margin-bottom: 20px !important;
  margin-right: 20px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  z-index: 900 !important; /* Below panels but above map */
}

/* Position zoom controls at bottom right for flight view */
.flight-view-container .leaflet-control-zoom {
  position: fixed !important;
  bottom: 80px !important;
  right: 20px !important;
  top: auto !important;
  left: auto !important;
  z-index: 1000 !important;
}

.leaflet-control-zoom a {
  background-color: var(--color-background-card) !important;
  color: var(--color-foreground) !important;
  border-color: var(--color-border) !important;
  font-weight: bold !important;
  font-size: 18px !important;
  font-family: 'Lucida Console', Monaco, monospace !important;
  text-indent: 1px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
}

.leaflet-control-zoom a:hover {
  background-color: var(--color-background-muted) !important;
}

/* Waypoint icons */
.waypoint-icon {
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
  z-index: 800 !important; /* Below controls but above map tiles */
}

/* Dock marker icon */
.dock-marker {
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
  z-index: 800 !important;
}

.dock-marker svg {
  transform: translate(-50%, -50%);
  overflow: visible;
}

/* Map container */
.mission-map-fullheight {
  height: calc(100vh - 220px); /* Adjusted to account for reduced header space */
  min-height: 350px;
  max-height: calc(100vh - 220px);
}

/* Fix for Leaflet map layers */
.leaflet-pane {
  z-index: 400 !important;
}

.leaflet-top, .leaflet-bottom {
  z-index: 900 !important;
}

/* Map interaction overlay */
[data-map-interaction-target="overlay"] {
  transition: background-color 0.2s ease-in-out;
  background-color: rgba(0, 0, 0, 0.05) !important; /* Very light overlay to keep map visible */
}

[data-map-interaction-target="overlay"]:hover {
  background-color: rgba(0, 0, 0, 0.2) !important; /* Slightly darker on hover but still transparent */
}

[data-map-interaction-target="overlay"] > div {
  opacity: 0.8;
  transition: opacity 0.2s ease-in-out;
}

[data-map-interaction-target="overlay"]:hover > div {
  opacity: 1;
}

/* Location map styles */
[data-controller="location-viewer"] {
  display: block;
  min-width: 80px;
  min-height: 80px;
}

[data-location-viewer-target="map"] {
  width: 80px !important;
  height: 80px !important;
  min-width: 80px !important;
  min-height: 80px !important;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
}

/* Flight view styles */
.flight-view-container {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.view-area {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  height: calc(100vh - 330px);
  min-height: 400px;
  margin-bottom: 1rem;
}

.flight-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  z-index: 5;
}

.flight-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  z-index: 5;
}

.flight-view-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
  z-index: 10;
}

/* Ensure video is visible when playing */
.flight-view-container video.playing {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 20 !important;
}

/* Ensure the page container has proper spacing */
.w-full > .overflow-hidden {
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Compact page header for flight view */
.flight-view-container + .mb-6,
.flight-view-container ~ .mb-6,
.flight-view-container ~ div .mb-6 {
  margin-bottom: 0.75rem !important;
}

/* Make the page header more compact */
.mb-6 {
  margin-bottom: 0.75rem !important;
}

/* Make breadcrumb navigation more compact */
nav.flex.mb-4 {
  margin-bottom: 0.5rem !important;
}

/* Make sure the mission header doesn't take too much space */
.mission-header {
  flex-shrink: 0;
  margin-bottom: 8px !important; /* Reduce header bottom margin */
}

.flight-video-container {
  position: relative;
  height: 100%;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.flight-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}

.flight-controls-panel {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background-color: hsl(var(--background-card) / 0.9);
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.flight-data-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background-color: hsl(var(--background-card) / 0.9);
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 200px;
}

.view-toggle-button {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background-color: hsl(var(--background-card) / 0.9);
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mqtt-connection-panel {
  background-color: hsl(var(--background-card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-bottom: 1rem;
}

.video-stream-panel {
  background-color: hsl(var(--background-card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-bottom: 1rem;
}

/* Animation for feedback messages */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.animate-fade-in-out {
  animation: fadeInOut 3s ease-in-out;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-height: 800px) {
  .mission-map-fullheight,
  .flight-view-container .view-area {
    height: calc(100vh - 330px);
    min-height: 300px;
  }
  
  .flight-controls-panel {
    padding: 0.75rem;
  }
  
  .flight-data-panel {
    padding: 0.75rem;
  }
  
  .mqtt-connection-panel,
  .video-stream-panel {
    padding: 0.75rem;
  }
}

@media (max-height: 600px) {
  .mission-map-fullheight,
  .flight-view-container .view-area {
    height: calc(100vh - 300px);
    min-height: 250px;
  }
  
  .mission-header {
    padding: 0.5rem !important;
    margin-bottom: 8px !important;
  }
  
  .flight-view-container .leaflet-control-zoom {
    bottom: 60px !important;
  }
  
  .mqtt-connection-panel,
  .video-stream-panel {
    padding: 0.5rem;
  }
} 