/* ============================================================================
   SATELLITE DETAIL PANEL
   ============================================================================
   Right-side overlay panel showing individual satellite details when clicked
   on the map. Slides in/out and coordinates with cluster status panel.
   Hidden on mobile devices.
   ============================================================================ */

/* Panel Container */
.satellite-detail-panel {
  position: fixed;
  top: calc(var(--header-height) + var(--navbar-height) + 20px);
  right: 20px;
  bottom: 20px;
  width: 320px;
  max-width: 20vw;
  min-width: 280px;
  background: var(--background);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  z-index: 101; /* Above cluster status panel */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.satellite-detail-panel.hidden {
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}

/* Hide on mobile */
@media (max-width: 1024px) {
  .satellite-detail-panel {
    display: none !important;
  }
}

/* Panel Header */
.satellite-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #00111c 0%, #002137 50%, #00406c 100%);
  color: white;
  border-bottom: 1px solid var(--border);
}

.satellite-detail-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.satellite-detail-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.satellite-detail-header h3 i {
  font-size: 16px;
  opacity: 0.9;
}

.satellite-detail-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.satellite-detail-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.satellite-detail-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Status Bar (below header) */
.satellite-detail-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.satellite-detail-status-label {
  font-size: 12px;
  font-weight: 500;
}

.satellite-detail-assignment-badge {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.satellite-detail-assignment-badge.available {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.satellite-detail-assignment-badge.assigned {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.satellite-detail-assignment-badge.responding {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.satellite-detail-assignment-badge.at-scene,
.satellite-detail-assignment-badge.at_scene {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Panel Content (Scrollable) */
.satellite-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Section Styling */
.satellite-detail-section {
  margin-bottom: 16px;
}

.satellite-detail-section:last-child {
  margin-bottom: 0;
}

.satellite-detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* Assignment Info Section */
.satellite-detail-assignment-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--muted);
  border-radius: 8px;
}

.satellite-detail-assignment-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 12px;
}

.satellite-detail-assignment-label {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.satellite-detail-assignment-value {
  color: var(--foreground);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* No Assignment State */
.satellite-detail-no-assignment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--muted);
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.satellite-detail-no-assignment svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Telemetry Grid */
.satellite-detail-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.satellite-detail-telemetry-item {
  padding: 10px;
  background: var(--muted);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.satellite-detail-telemetry-label {
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.satellite-detail-telemetry-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

/* Location Section */
.satellite-detail-location-info {
  padding: 10px;
  background: var(--muted);
  border-radius: 8px;
}

.satellite-detail-location-coords {
  font-size: 12px;
  color: var(--foreground);
  font-family: monospace;
  margin-bottom: 6px;
}

.satellite-detail-coord-label {
  color: var(--muted-foreground);
  font-weight: 500;
}

.satellite-detail-coord-separator {
  color: var(--border);
  margin: 0 8px;
}

.satellite-detail-location-time {
  font-size: 11px;
  color: var(--muted-foreground);
}

/* Panel Footer with Actions */
.satellite-detail-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--muted);
  display: flex;
  gap: 8px;
}

.satellite-detail-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.satellite-detail-btn-primary {
  background: var(--primary);
  color: white;
}

.satellite-detail-btn-primary:hover {
  opacity: 0.9;
}

.satellite-detail-btn-secondary {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.satellite-detail-btn-secondary:hover {
  background: var(--accent);
}

/* Loading State */
.satellite-detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.satellite-detail-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.satellite-detail-loading p {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* When satellite detail panel is open, push cluster status panel further right (hide it) */
.satellite-status-panel.panel-hidden-by-detail {
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}
