:root {
  --bg-color: #060b10;
  --panel-color: rgba(13, 23, 33, 0.85);
  --accent-color: #00f7ff;
  --accent-glow: rgba(0, 247, 255, 0.4);
  --text-color: #e0f3ff;
  --muted-text: #7b91a6;
  --card-radius: 16px;
  --transition-fast: 0.2s ease;
  --transition-slow: 0.5s ease;
  --shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.35);
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --warning-color: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Rajdhani", "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top left, #07121f, #02060b 55%);
  color: var(--text-color);
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  overflow-x: hidden;
  position: relative;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(13, 31, 49, 0.98), rgba(9, 19, 32, 0.98));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 247, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateX(400px);
  animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  pointer-events: all;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toast:hover {
  transform: translateX(-5px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 247, 255, 0.3);
}

.toast.toast-exit {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast.success .toast-icon {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 2px solid rgba(46, 213, 115, 0.4);
}

.toast.error .toast-icon {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border: 2px solid rgba(255, 71, 87, 0.4);
}

.toast.info .toast-icon {
  background: rgba(0, 247, 255, 0.2);
  color: var(--accent-color);
  border: 2px solid rgba(0, 247, 255, 0.4);
}

.toast.warning .toast-icon {
  background: rgba(255, 165, 2, 0.2);
  color: #ffa502;
  border: 2px solid rgba(255, 165, 2, 0.4);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--muted-text);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .toast-container {
    left: 10px;
    right: 10px;
    top: 70px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* Development Notice Banner */
.dev-notice-banner {
  position: fixed;
  top: -100px;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(254, 187, 18, 0.95));
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(251, 191, 36, 0.2);
  z-index: 1000;
  transition: top 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-bottom: 2px solid rgba(245, 158, 11, 0.8);
}

.dev-notice-banner.show {
  top: 0;
}

.dev-notice-banner.hide {
  top: -100px;
}

.dev-notice-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

.dev-notice-icon {
  font-weight: bold;
  color: #ff4757;
  background: rgba(255, 71, 87, 0.2);
  border: 2px solid #ff4757;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

@keyframes warningPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.dev-notice-text {
  color: #1a1a1a;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: center;
  flex: 1;
}

.dev-notice-text strong {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.dev-notice-close {
  position: absolute;
  right: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #1a1a1a;
  font-size: 1.5rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: 300;
}

.dev-notice-close:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: rotate(90deg);
}

/* Adjust page wrapper when banner is shown */
body.banner-visible {
  padding-top: 60px;
}

/* Mobile adjustments for banner */
@media (max-width: 640px) {
  .dev-notice-content {
    padding: 0.6rem 0.75rem;
    padding-right: 3rem;
  }

  .dev-notice-icon {
    display: none;
  }

  .dev-notice-text {
    font-size: 0.75rem;
  }

  .dev-notice-close {
    right: 0.5rem;
    width: 24px;
    height: 24px;
    font-size: 1.25rem;
  }

  body.banner-visible {
    padding-top: 50px;
  }
}

/* Blurred node entries for disconnected devices */
.node-blurred {
  opacity: 0.5;
  filter: blur(1px);
  pointer-events: none;
  position: relative;
}

.node-blurred::after {
  content: "Offline";
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  color: var(--muted-text);
  font-size: 0.75rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobile First - Base Styles */
.page-wrapper {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  animation: fadeSlideIn 0.8s var(--transition-slow);
  padding: var(--spacing-sm);
  transition: padding-top 0.6s ease;
  flex: 1;
  min-height: 100vh;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header - Mobile First */
.app-header {
  background: linear-gradient(120deg, rgba(13, 31, 49, 0.9), rgba(9, 19, 32, 0.95));
  border-radius: var(--card-radius);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 247, 255, 0.08);
}

.branding {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo {
  background: rgba(0, 247, 255, 0.1);
  border: 1px solid rgba(0, 247, 255, 0.35);
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.25);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
}

.logo:hover {
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 0 30px rgba(0, 247, 255, 0.5);
  background: rgba(0, 247, 255, 0.2);
}

.logo:active {
  transform: rotate(15deg) scale(0.95);
}

.title-block h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}

.title-block p {
  margin-top: 0.2rem;
  color: var(--muted-text);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.connect-button {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.2), rgba(0, 158, 196, 0.9));
  color: var(--text-color);
  border: 1px solid rgba(0, 247, 255, 0.4);
  border-radius: 999px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  align-self: stretch;
  white-space: nowrap;
}

.connect-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.connect-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 247, 255, 0.35);
}

.connect-button:hover::after {
  left: 120%;
}

/* Connection Status Indicator */
.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(5, 14, 24, 0.6);
  border: 1px solid rgba(0, 247, 255, 0.15);
  border-radius: 999px;
  transition: all 0.3s ease;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4757;
  position: relative;
  transition: all 0.3s ease;
}

.status-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: none;
}

.connection-status.connected .status-dot {
  background: #2ed573;
  box-shadow: 0 0 15px rgba(46, 213, 115, 0.6);
}

.connection-status.connected .status-dot::before {
  border-color: #2ed573;
  opacity: 1;
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.connection-status.connecting .status-dot {
  background: #ffa502;
  box-shadow: 0 0 15px rgba(255, 165, 2, 0.6);
  animation: connectingBlink 1s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(2.5);
    opacity: 0;
  }
}

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

.status-text {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-text);
  transition: color 0.3s ease;
}

.connection-status.connected .status-text {
  color: #2ed573;
}

.connection-status.connecting .status-text {
  color: #ffa502;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.disconnect-button {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.2), rgba(255, 71, 87, 0.8));
  color: var(--text-color);
  border: 1px solid rgba(255, 71, 87, 0.4);
  border-radius: 999px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.disconnect-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 71, 87, 0.35);
}

.hidden {
  display: none !important;
}

/* Dashboard - Mobile First */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
}

/* Intel Panel - Combined for mobile */
.intel-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
  min-height: 0;
}

.section-card {
  background: var(--panel-color);
  border-radius: var(--card-radius);
  padding: var(--spacing-md);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 247, 255, 0.08);
  animation: fadePulse 0.9s ease both;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex children to shrink */
}

/* Alert Log Panel - Expand to fill available space */
#alerts-panel {
  flex: 1;
  min-height: 300px;
  position: relative;
}

/* Subtle glow effect for alert panel on wide screens */
@media (min-width: 900px) {
  #alerts-panel::before {
    opacity: 0.5;
  }

  #alerts-panel:hover::before {
    opacity: 0.8;
  }
}

.section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 247, 255, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.section-card:hover::before {
  opacity: 1;
}

@keyframes fadePulse {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.section-card h2 {
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-subtitle {
  color: var(--muted-text);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* Lists - Optimized for mobile */
.nodes-list,
.alerts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--spacing-xs);
  min-height: 0;
  max-height: none;
}

/* Custom scrollbar */
.nodes-list::-webkit-scrollbar,
.alerts-list::-webkit-scrollbar {
  width: 4px;
}

.nodes-list::-webkit-scrollbar-track,
.alerts-list::-webkit-scrollbar-track {
  background: rgba(0, 247, 255, 0.05);
  border-radius: 2px;
}

.nodes-list::-webkit-scrollbar-thumb,
.alerts-list::-webkit-scrollbar-thumb {
  background: rgba(0, 247, 255, 0.3);
  border-radius: 2px;
}

.nodes-list__item,
.alerts-list__item {
  padding: var(--spacing-sm);
  background: rgba(5, 14, 24, 0.65);
  border: 1px solid rgba(0, 247, 255, 0.08);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  transition: transform var(--transition-fast), border var(--transition-fast);
  min-height: 60px;
}

.nodes-list__item:hover,
.alerts-list__item:hover {
  transform: translateX(4px);
  border-color: rgba(0, 247, 255, 0.3);
  background: rgba(5, 14, 24, 0.85);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 247, 255, 0.15);
}

.alerts-list__item.clicked,
.nodes-list__item.clicked {
  animation: itemClickFlash 0.4s ease-out;
}

@keyframes itemClickFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 247, 255, 0.7);
    background: rgba(0, 247, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 30px 10px rgba(0, 247, 255, 0);
    background: rgba(0, 247, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 247, 255, 0);
    background: rgba(5, 14, 24, 0.65);
  }
}

/* Loading States & Skeleton Screens */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 247, 255, 0.05) 0%,
    rgba(0, 247, 255, 0.1) 50%,
    rgba(0, 247, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-alert {
  padding: var(--spacing-sm);
  background: rgba(5, 14, 24, 0.65);
  border: 1px solid rgba(0, 247, 255, 0.08);
  border-radius: 12px;
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
}

.skeleton-text {
  height: 12px;
  margin: 6px 0;
}

.skeleton-text.title {
  width: 60%;
  height: 14px;
}

.skeleton-text.subtitle {
  width: 40%;
}

.skeleton-badge {
  width: 60px;
  height: 24px;
  border-radius: 999px;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 247, 255, 0.1);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 11, 16, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner-large {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 247, 255, 0.1);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loading-text {
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.node-info {
  flex: 1;
  min-width: 0;
}

.node-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-status {
  margin-top: 0.2rem;
  color: var(--muted-text);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.node-status strong {
  font-weight: 700;
  text-transform: uppercase;
}

/* Status color coding */
.node-status-active {
  color: #4ade80 !important;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.node-status-idle {
  color: #f87171 !important;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.node-status-scanning {
  color: #fbbf24 !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.node-status-connecting {
  color: #fbbf24 !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.node-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  color: var(--muted-text);
  font-size: 0.7rem;
  white-space: nowrap;
}

.alert-node {
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-timestamp {
  margin-top: 0.2rem;
  color: var(--muted-text);
  font-size: 0.7rem;
}

.alert-coordinates {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.threat-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border var(--transition-fast);
  font-weight: 600;
}

.threat-pill--high {
  background: rgba(255, 71, 87, 0.18);
  border-color: rgba(255, 71, 87, 0.5);
  color: #ff8a95;
}

.threat-pill--medium {
  background: rgba(255, 166, 0, 0.18);
  border-color: rgba(255, 166, 0, 0.45);
  color: #ffb84d;
}

.threat-pill--low {
  background: rgba(55, 214, 143, 0.18);
  border-color: rgba(55, 214, 143, 0.45);
  color: #6dffb9;
}

/* Alert Controls - Filter and Sort */
.alert-controls {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding: 0 var(--spacing-xs);
  flex-shrink: 0; /* Don't allow controls to shrink */
}

.filter-dropdown,
.sort-dropdown {
  position: relative;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 247, 255, 0.05);
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-btn:hover {
  background: rgba(0, 247, 255, 0.1);
  border-color: rgba(0, 247, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 247, 255, 0.2);
  transform: translateY(-1px);
}

.control-btn:active {
  transform: translateY(0);
}

.control-btn.active {
  background: rgba(0, 247, 255, 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: rgba(13, 23, 33, 0.98);
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 8px;
  padding: 0.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 0.5rem 0.8rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(0, 247, 255, 0.1);
  color: var(--text-primary);
  transform: translateX(3px);
  transition: all 0.2s ease;
}

.dropdown-item.active {
  background: rgba(0, 247, 255, 0.15);
  color: var(--accent-color);
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 247, 255, 0.1);
  margin: 0.4rem 0;
}

.dropdown-item.reset-filter {
  color: #ff4757;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dropdown-item.reset-filter:hover {
  background: rgba(255, 71, 87, 0.1);
  color: #ff6b7a;
}

/* Map Panel - Mobile First */
.map-panel {
  background: var(--panel-color);
  border-radius: var(--card-radius);
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 247, 255, 0.08);
  position: relative;
  overflow: hidden;
  animation: fadePulse 1s ease both;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

/* Custom Map Markers */
.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: relative;
}

.marker-pin.danger {
  background-color: #dc143c !important;
  box-shadow: none;
  border: 2px solid #8b0000;
  /* No animation, no glow - static red danger zones */
}

.marker-pin.node-go {
  width: 20px;
  height: 20px;
  background-color: #00b894 !important;
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(0, 184, 148, 0.6);
  animation: nodePulse 2s infinite;
}

.marker-pin.node-nano {
  width: 20px;
  height: 20px;
  background-color: #0984e3 !important;
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(9, 132, 227, 0.6);
  animation: nodePulse 2s infinite;
}

.marker-pin.node-core {
  width: 20px;
  height: 20px;
  background-color: #6c5ce7 !important;
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.6);
  animation: nodePulse 2s infinite;
}

@keyframes nodePulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Selection Info Panel */
.selection-info {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: rgba(13, 23, 33, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 247, 255, 0.2);
  border-radius: 12px;
  padding: var(--spacing-md);
  max-width: 320px;
  max-height: 80%;
  overflow-y: auto;
  z-index: 5;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.selection-info.hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid rgba(0, 247, 255, 0.1);
  gap: var(--spacing-md);
}

.selection-header h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  flex: 1;
}

.clear-btn {
  background: rgba(255, 71, 87, 0.2);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: #ff8a95;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.clear-btn:hover {
  background: rgba(255, 71, 87, 0.3);
  transform: translateY(-1px);
}

.points-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.point-detail {
  background: rgba(5, 14, 24, 0.6);
  border: 1px solid rgba(0, 247, 255, 0.1);
  border-radius: 8px;
  padding: var(--spacing-sm);
}

.point-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid rgba(0, 247, 255, 0.05);
}

.point-number {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.threat-indicator {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid;
}

.threat-indicator--high {
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.5);
  color: #ff8a95;
}

.threat-indicator--medium {
  background: rgba(255, 166, 0, 0.2);
  border-color: rgba(255, 166, 0, 0.5);
  color: #ffb84d;
}

.threat-indicator--low {
  background: rgba(55, 214, 143, 0.2);
  border-color: rgba(55, 214, 143, 0.5);
  color: #6dffb9;
}

.point-data {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.data-label {
  color: var(--muted-text);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.data-value {
  color: var(--text-color);
  text-align: right;
  font-weight: 600;
  max-width: 60%;
  word-break: break-word;
}

.distance-info {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(0, 247, 255, 0.1);
}

.distance-info h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  margin-bottom: var(--spacing-sm);
}

.distance-value {
  background: linear-gradient(135deg, rgba(0, 247, 255, 0.1), rgba(0, 158, 196, 0.2));
  border: 1px solid rgba(0, 247, 255, 0.3);
  border-radius: 8px;
  padding: var(--spacing-md);
  text-align: center;
}

#distance-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.05em;
}

/* Custom scrollbar for selection info */
.selection-info::-webkit-scrollbar {
  width: 4px;
}

.selection-info::-webkit-scrollbar-track {
  background: rgba(0, 247, 255, 0.05);
  border-radius: 2px;
}

.selection-info::-webkit-scrollbar-thumb {
  background: rgba(0, 247, 255, 0.3);
  border-radius: 2px;
}

#map {
  width: 100%;
  height: 300px;
  border-radius: calc(var(--card-radius) - 8px);
  overflow: hidden;
}

.maplibregl-canvas {
  filter: saturate(1.1) contrast(1.05);
}

.maplibregl-ctrl-group {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(2, 18, 33, 0.4);
  backdrop-filter: blur(6px);
}

.map-marker {
  width: 14px;
  height: 14px;
  background: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0, 247, 255, 0.5);
  animation: pulse 2.4s infinite;
  border: 2px solid rgba(2, 10, 18, 0.8);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.map-marker:hover {
  transform: scale(1.2);
  background: #00d4ff;
}

.map-marker.selected {
  background: #ff4757;
  border-color: #ff6b7a;
  animation: selectedPulse 1.5s infinite;
  transform: scale(1.3);
  z-index: 10;
}

@keyframes selectedPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(255, 71, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 247, 255, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 247, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 247, 255, 0);
  }
}

.popup-card {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: #0b1724;
  min-width: 140px;
}

.popup-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.popup-card p {
  margin: 0.15rem 0;
  font-size: 0.75rem;
}

/* Mobile adjustments for selection info */
@media (max-width: 640px) {
  .selection-info {
    top: auto;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    left: var(--spacing-sm);
    max-width: none;
    max-height: 40%;
  }

  .point-detail {
    padding: var(--spacing-xs);
  }

  .data-row {
    font-size: 0.7rem;
  }

  #distance-text {
    font-size: 1.2rem;
  }
}

/* Tablet Styles - 640px and up */
@media (min-width: 640px) {
  body {
    padding: var(--spacing-md);
  }

  .page-wrapper {
    gap: var(--spacing-lg);
  }

  .app-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
  }

  .logo {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
  }

  .title-block h1 {
    font-size: 1.5rem;
  }

  .title-block p {
    font-size: 0.85rem;
  }

  .connect-button {
    align-self: center;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
  }

  .intel-panel {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
  }

  .section-card {
    flex: 1 1 calc(50% - var(--spacing-md) / 2);
    min-width: 280px;
  }

  /* Alert panel can take full width if needed */
  #alerts-panel {
    flex: 1 1 100%;
    min-height: 350px;
  }

  .section-card {
    padding: var(--spacing-lg);
  }

  .section-card h2 {
    font-size: 1.25rem;
  }

  .nodes-list,
  .alerts-list {
    max-height: 450px;
  }

  /* Mobile: Alert panel should have reasonable min-height */
  #alerts-panel {
    min-height: 400px;
  }

  #map {
    height: 400px;
  }
}

/* Wide Screen Layout - 900px and up (for demo browser) */
@media (min-width: 900px) {
  html, body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    padding: 0;
  }

  .page-wrapper {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .app-header {
    border-radius: 0;
    position: relative;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
  }

  .title-block h1 {
    font-size: 1.75rem;
    letter-spacing: 0.08em;
  }

  .title-block p {
    font-size: 0.95rem;
  }

  .logo {
    width: 3.2rem;
    height: 3.2rem;
    font-size: 1.6rem;
  }

  .connect-button {
    padding: 0.75rem 1.8rem;
    font-size: 1rem;
  }

  .dashboard {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  .intel-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-md);
    padding-right: var(--spacing-sm);
    background: var(--bg-color);
    border-right: 1px solid rgba(0, 247, 255, 0.08);
  }

  /* Alert panel takes all available space */
  #alerts-panel {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .section-card {
    border-radius: var(--card-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    flex: 1; /* Allow cards to share space equally by default */
  }

  .section-card:first-child {
    margin-bottom: 0;
  }

  .section-card header {
    flex-shrink: 0;
    margin-bottom: var(--spacing-sm);
  }

  .section-card h2 {
    font-size: 1.25rem;
  }

  .section-subtitle {
    font-size: 0.8rem;
  }

  .nodes-list,
  .alerts-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    gap: 0.5rem;
    min-height: 0;
  }

  .nodes-list__item,
  .alerts-list__item {
    padding: 0.6rem 0.75rem;
    min-height: 55px;
  }

  .node-info h3 {
    font-size: 0.95rem;
  }

  .node-status {
    font-size: 0.75rem;
  }

  .node-meta {
    font-size: 0.75rem;
  }

  .alert-node {
    font-size: 0.9rem;
  }

  .alert-timestamp {
    font-size: 0.75rem;
  }

  .alert-coordinates {
    font-size: 0.8rem;
  }

  .threat-pill {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }

  .map-panel {
    height: 100%;
    border-radius: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
  }

  #map {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
    border-radius: 0;
    margin: 0;
    padding: 0;
  }

  /* Ensure map legend stays visible */
  .map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1001;
  }

  /* Footer always visible on wide screens */
  .app-footer {
    margin-top: 0;
    border-radius: 0;
    flex-shrink: 0;
    width: 100%;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
  }
}

/* Desktop Styles - 1024px and up */
@media (min-width: 1024px) {
  .intel-panel {
    padding: var(--spacing-lg);
    padding-right: var(--spacing-md);
  }

  .map-panel {
    padding: var(--spacing-lg);
    padding-left: var(--spacing-md);
  }

  .section-card {
    padding: var(--spacing-lg);
  }

  .section-card h2 {
    font-size: 1.4rem;
  }

  .nodes-list__item,
  .alerts-list__item {
    padding: 0.7rem 0.9rem;
    min-height: 58px;
  }

  .node-info h3 {
    font-size: 1.05rem;
  }

  .node-status {
    font-size: 0.85rem;
  }

  .node-meta {
    font-size: 0.85rem;
  }

  .alert-node {
    font-size: 1rem;
  }

  .alert-timestamp {
    font-size: 0.85rem;
  }

  .alert-coordinates {
    font-size: 0.9rem;
  }

  .threat-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }

  .title-block h1 {
    font-size: 2rem;
  }
}

/* Large Desktop - 1280px and up */
@media (min-width: 1280px) {
  .dashboard {
    grid-template-columns: 32% 68%;
  }

  .intel-panel {
    padding: var(--spacing-xl);
    padding-right: var(--spacing-lg);
  }

  .map-panel {
    padding: var(--spacing-xl);
    padding-left: var(--spacing-lg);
  }

  .section-card {
    height: 100%;
  }

  .section-card:first-child {
    margin-bottom: 0;
  }
}

/* Ultra Wide - 1536px and up */
@media (min-width: 1536px) {
  .dashboard {
    grid-template-columns: 30% 70%;
  }

  .intel-panel {
    padding: var(--spacing-xl);
    padding-right: var(--spacing-lg);
  }

  .map-panel {
    padding: var(--spacing-xl);
    padding-left: var(--spacing-lg);
  }

  .nodes-list,
  .alerts-list {
    flex: 1;
    min-height: 0;
  }
}

/* Extra Large Screens - 1920px and up */
@media (min-width: 1920px) {
  .dashboard {
    grid-template-columns: 28% 72%;
  }

  .section-card {
    padding: var(--spacing-xl);
  }

  .section-card h2 {
    font-size: 1.5rem;
  }

  .nodes-list__item,
  .alerts-list__item {
    padding: 0.8rem 1rem;
    min-height: 60px;
  }
}

/* Accessibility and Performance */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.5);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .nodes-list__item,
  .alerts-list__item {
    min-height: 70px;
    padding: var(--spacing-md);
  }

  .connect-button {
    padding: 0.75rem 1.5rem;
  }
}

/* Footer Styles - Hidden until scroll */
.app-footer {
  background: linear-gradient(135deg, rgba(13, 31, 49, 0.95), rgba(9, 19, 32, 0.98));
  border-radius: var(--card-radius);
  margin-top: auto;
  padding: var(--spacing-lg) var(--spacing-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 247, 255, 0.08);
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.app-footer.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  animation: fadeSlideIn 0.8s ease both;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid rgba(0, 247, 255, 0.1);
}

.footer-brand h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: var(--spacing-xs);
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
}

.footer-tagline {
  color: var(--muted-text);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-style: italic;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.footer-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: var(--spacing-sm);
  opacity: 0.9;
}

.footer-section a {
  display: block;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.85rem;
  padding: var(--spacing-xs) 0;
  transition: all 0.2s ease;
  letter-spacing: 0.03em;
}

.footer-section a:hover {
  color: var(--accent-color);
  transform: translateX(4px);
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.4);
}

.social-icon {
  display: inline-block;
  margin-right: var(--spacing-xs);
  font-size: 1rem;
}

.footer-address {
  color: var(--text-color);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
}

.footer-bottom p {
  color: var(--muted-text);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Footer Responsive Styles */
@media (min-width: 640px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
  }

  .footer-brand {
    flex: 0 0 auto;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
  }
}

@media (min-width: 1024px) {
  .app-footer {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  .footer-brand h3 {
    font-size: 1.75rem;
  }

  .footer-section h4 {
    font-size: 1rem;
  }

  .footer-section a,
  .footer-address {
    font-size: 0.9rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .map-panel {
    display: none;
  }

  .connect-button {
    display: none;
  }

  .app-footer {
    display: none;
  }
}
