/* ============================================================================
   SATELLITE STATUS PANEL
   ============================================================================
   Right-side overlay panel showing cluster/satellite status on desktop.
   Hidden on mobile devices.
   ============================================================================ */

/* Panel Container */
.satellite-status-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: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

/* Panel Header */
.satellite-panel-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-panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.satellite-panel-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-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Filter Bar */
.satellite-panel-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.satellite-filter-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.satellite-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.satellite-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.satellite-panel-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted-foreground);
}

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

/* Cluster Section */
.cluster-section {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--background);
}

.cluster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
}

.cluster-header:hover {
  background: var(--accent);
}

/* Priority-colored clusters when assigned to incident */
.cluster-section.priority-p1 {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.cluster-section.priority-p1 .cluster-header {
  background: rgba(139, 92, 246, 0.08);
}

.cluster-section.priority-p2 {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

.cluster-section.priority-p2 .cluster-header {
  background: rgba(239, 68, 68, 0.08);
}

.cluster-section.priority-p3 {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.3);
}

.cluster-section.priority-p3 .cluster-header {
  background: rgba(249, 115, 22, 0.08);
}

.cluster-section.priority-p4 {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}

.cluster-section.priority-p4 .cluster-header {
  background: rgba(34, 197, 94, 0.08);
}

.cluster-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cluster-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  background: var(--primary);
}

.cluster-icon.vehicle {
  background: #6366f1;
}

.cluster-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cluster-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.cluster-meta {
  font-size: 11px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Zone tag in cluster header */
.cluster-zone-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 4px;
  color: #3b82f6;
  font-size: 10px;
}

.cluster-zone-tag i {
  font-size: 9px;
}

.cluster-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

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

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

.cluster-status-badge.at-scene {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.cluster-status-badge.on-break {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.cluster-chevron {
  transition: transform 0.2s;
  color: var(--muted-foreground);
}

.cluster-section.collapsed .cluster-chevron {
  transform: rotate(-90deg);
}

/* Cluster Body */
.cluster-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cluster-section.collapsed .cluster-body {
  display: none;
}

/* Zone Assignment */
.cluster-zone {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  font-size: 11px;
  color: #3b82f6;
}

.cluster-zone i {
  font-size: 12px;
}

/* Incident Assignment */
.cluster-incident {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  font-size: 11px;
}

.cluster-incident i {
  font-size: 12px;
}

.cluster-incident.p1 {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
}

.cluster-incident.p2 {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.cluster-incident.p3 {
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.2);
}

.cluster-incident.p4 {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

/* Staff/Satellite Items */
.cluster-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--muted);
  border-radius: 6px;
  transition: background 0.15s;
}

.member-item:hover {
  background: var(--accent);
}

.member-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* Allow text truncation */
}

.member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #00111c, #002137);
}

.member-avatar.satellite {
  border-radius: 6px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.member-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
}

.member-role {
  font-size: 10px;
  color: var(--muted-foreground);
}

.member-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.member-status-dot.warning {
  background: #f59e0b;
}

.member-status-dot.offline {
  background: #ef4444;
}

.member-status-dot.on-break {
  background: #8b5cf6;
  animation: pulse-break 2s infinite;
}

@keyframes pulse-break {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.member-break-badge {
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  text-transform: uppercase;
}

/* Compact member item */
.member-item.compact {
  padding: 6px 8px;
}

.member-item.compact .member-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.member-item.compact .member-avatar.on-break {
  border: 2px solid #8b5cf6;
}

.member-item.empty {
  justify-content: center;
  opacity: 0.6;
  font-size: 11px;
  color: var(--muted-foreground);
  padding: 12px;
}

.member-item.compact.on-break {
  background: rgba(139, 92, 246, 0.08);
  border-left: 2px solid #8b5cf6;
}

/* Tracker status icons */
.tracker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
}

.tracker-icon.online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.tracker-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.tracker-icon.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.tracker-icon.no-tracker {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
}

/* Capability badges in member row */
.member-caps {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.cap-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 500;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid;
}

.cap-more {
  font-size: 9px;
  color: var(--muted-foreground);
  padding: 1px 4px;
}

/* Capability color classes (matching capabilities.css) */
.cap-medical {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.cap-medical-alt {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: #ef4444;
}

.cap-crowd-care {
  background: rgba(236, 72, 153, 0.1);
  border-color: rgba(236, 72, 153, 0.3);
  color: #db2777;
}

.cap-crowd-care-alt {
  background: rgba(244, 114, 182, 0.1);
  border-color: rgba(244, 114, 182, 0.3);
  color: #ec4899;
}

.cap-security {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

.cap-security-alt {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
  color: #3b82f6;
}

.cap-management {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #16a34a;
}

.cap-management-alt {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: #22c55e;
}

.cap-operations {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: #ea580c;
}

.cap-operations-alt {
  background: rgba(251, 146, 60, 0.1);
  border-color: rgba(251, 146, 60, 0.3);
  color: #f97316;
}

.cap-support {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: #0891b2;
}

.cap-support-alt {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
  color: #06b6d4;
}

.cap-custom {
  background: rgba(107, 114, 128, 0.1);
  border-color: rgba(107, 114, 128, 0.3);
  color: #4b5563;
}

/* Empty State */
.satellite-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted-foreground);
}

.satellite-panel-empty i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.satellite-panel-empty p {
  font-size: 13px;
  margin: 0;
}

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

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Panel Footer */
.satellite-panel-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.satellite-panel-footer-text {
  font-size: 10px;
  color: var(--muted-foreground);
}

.satellite-panel-refresh {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.satellite-panel-refresh:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Unassigned Cluster (no satellites) */
.cluster-section.unassigned {
  opacity: 0.7;
}

.cluster-section.unassigned .cluster-header {
  background: var(--muted);
}

/* Toggle Button in Navbar */
#satellite-status-toggle {
  transition: all 0.15s;
}

#satellite-status-toggle.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

#satellite-status-toggle.active:hover {
  background: var(--primary);
  opacity: 0.9;
}
