/* ============================================
   THEME: DARK (Default)
   ============================================ */
:root, [data-theme="dark"] {
  --bg-primary: #0a0e14;
  --bg-secondary: #111820;
  --bg-tertiary: #1a2332;
  --bg-panel: rgba(17, 24, 32, 0.92);
  --border-color: rgba(255, 180, 50, 0.25);
  --text-primary: #f0f4f8;
  --text-secondary: #a0b0c0;
  --text-muted: #8899aa;
  --accent-amber: #ffb432;
  --accent-amber-dim: rgba(255, 180, 50, 0.6);
  --accent-green: #00ff88;
  --accent-green-dim: rgba(0, 255, 136, 0.6);
  --accent-red: #ff4466;
  --accent-blue: #4488ff;
  --accent-cyan: #00ddff;
  --accent-purple: #aa66ff;
  --map-ocean: #0a0e14;
  --scanline-opacity: 0.02;
}

/* ============================================
   THEME: LIGHT
   ============================================ */
[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8ecf0;
  --bg-panel: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 100, 200, 0.2);
  --text-primary: #1a2332;
  --text-secondary: #4a5a6a;
  --text-muted: #7a8a9a;
  --accent-amber: #d4940a;
  --accent-amber-dim: rgba(212, 148, 10, 0.4);
  --accent-green: #00aa55;
  --accent-green-dim: rgba(0, 170, 85, 0.4);
  --accent-red: #cc3344;
  --accent-blue: #2266cc;
  --accent-cyan: #0099bb;
  --accent-purple: #7744cc;
  --map-ocean: #f0f4f8;
  --scanline-opacity: 0;
}

/* ============================================
   THEME: LEGACY (Green Terminal Style)
   ============================================ */
[data-theme="legacy"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #151515;
  --bg-panel: rgba(0, 0, 0, 0.95);
  --border-color: rgba(0, 255, 0, 0.3);
  --text-primary: #00ff00;
  --text-secondary: #00dd00;
  --text-muted: #00bb00;
  --accent-amber: #ffaa00;
  --accent-amber-dim: rgba(255, 170, 0, 0.5);
  --accent-green: #00ff00;
  --accent-green-dim: rgba(0, 255, 0, 0.5);
  --accent-red: #ff0000;
  --accent-blue: #00aaff;
  --accent-cyan: #00ffff;
  --accent-purple: #ff00ff;
  --map-ocean: #000008;
  --scanline-opacity: 0.05;
}

/* ============================================
   THEME: RETRO (90s Windows Style)
   ============================================ */
[data-theme="retro"] {
  --bg-primary: #008080;
  --bg-secondary: #c0c0c0;
  --bg-tertiary: #dfdfdf;
  --bg-panel: #c0c0c0;
  --border-color: #808080;
  --border-light: #ffffff;
  --border-dark: #404040;
  --text-primary: #000000;
  --text-secondary: #000000;
  --text-muted: #404040;
  --accent-amber: #ffff00;
  --accent-amber-dim: #c0c000;
  --accent-green: #00ff00;
  --accent-green-dim: #00c000;
  --accent-red: #ff0000;
  --accent-blue: #000080;
  --accent-cyan: #008080;
  --accent-purple: #800080;
  --title-bar: linear-gradient(90deg, #000080, #1084d0);
  --title-bar-text: #ffffff;
  --map-ocean: #000080;
  --scanline-opacity: 0;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* Legacy theme uses monospace font */
[data-theme="legacy"] body,
[data-theme="legacy"] * {
  font-family: 'JetBrains Mono', monospace !important;
}

/* Classic theme uses system fonts */
[data-theme="retro"] body,
[data-theme="retro"] * {
  font-family: 'Tahoma', 'MS Sans Serif', 'Arial', sans-serif !important;
}

/* Subtle scanline effect */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,var(--scanline-opacity)) 2px, rgba(0,0,0,var(--scanline-opacity)) 4px);
  pointer-events: none;
  z-index: 9999;
}

/* ============================================
   CLASSIC THEME - 90s WINDOWS STYLING
   ============================================ */

/* 3D Beveled border effect for classic theme */
[data-theme="retro"] .panel {
  background: #c0c0c0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: 
    inset -1px -1px 0 #404040,
    inset 1px 1px 0 #ffffff,
    inset -2px -2px 0 #808080,
    inset 2px 2px 0 #dfdfdf !important;
  backdrop-filter: none !important;
}

/* Classic window title bar style */
[data-theme="retro"] .panel-header,
[data-theme="retro"] .panel > div:first-child {
  background: linear-gradient(90deg, #000080, #1084d0) !important;
  color: #ffffff !important;
  font-weight: bold !important;
  padding: 2px 4px !important;
  margin: -10px -10px 8px -10px !important;
  font-size: 12px !important;
}

/* Classic buttons */
[data-theme="retro"] button,
[data-theme="retro"] .map-style-btn {
  background: #c0c0c0 !important;
  color: #000000 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: 
    inset -1px -1px 0 #404040,
    inset 1px 1px 0 #ffffff,
    inset -2px -2px 0 #808080,
    inset 2px 2px 0 #dfdfdf !important;
  font-family: 'Tahoma', 'MS Sans Serif', sans-serif !important;
  font-size: 11px !important;
  padding: 4px 12px !important;
}

[data-theme="retro"] button:hover,
[data-theme="retro"] .map-style-btn:hover {
  background: #dfdfdf !important;
}

[data-theme="retro"] button:active,
[data-theme="retro"] .map-style-btn:active,
[data-theme="retro"] .map-style-btn.active {
  box-shadow: 
    inset 1px 1px 0 #404040,
    inset -1px -1px 0 #ffffff,
    inset 2px 2px 0 #808080,
    inset -2px -2px 0 #dfdfdf !important;
}

/* Classic inputs */
[data-theme="retro"] input,
[data-theme="retro"] select {
  background: #ffffff !important;
  color: #000000 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: 
    inset 1px 1px 0 #404040,
    inset -1px -1px 0 #ffffff,
    inset 2px 2px 0 #808080,
    inset -2px -2px 0 #dfdfdf !important;
  font-family: 'Tahoma', 'MS Sans Serif', sans-serif !important;
  font-size: 11px !important;
  padding: 2px 4px !important;
}

/* Classic scrollbars */
[data-theme="retro"] ::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

[data-theme="retro"] ::-webkit-scrollbar-track {
  background: #c0c0c0;
  background-image: 
    linear-gradient(45deg, #808080 25%, transparent 25%),
    linear-gradient(-45deg, #808080 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #808080 75%),
    linear-gradient(-45deg, transparent 75%, #808080 75%);
  background-size: 4px 4px;
  background-position: 0 0, 0 2px, 2px -2px, -2px 0px;
}

[data-theme="retro"] ::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 0;
  box-shadow: 
    inset -1px -1px 0 #404040,
    inset 1px 1px 0 #ffffff,
    inset -2px -2px 0 #808080,
    inset 2px 2px 0 #dfdfdf;
}

[data-theme="retro"] ::-webkit-scrollbar-button {
  background: #c0c0c0;
  box-shadow: 
    inset -1px -1px 0 #404040,
    inset 1px 1px 0 #ffffff;
  width: 16px;
  height: 16px;
}

/* Classic links */
[data-theme="retro"] a {
  color: #0000ff !important;
  text-decoration: underline !important;
}

[data-theme="retro"] a:visited {
  color: #800080 !important;
}

/* Classic header styling */
[data-theme="retro"] [style*="gridColumn: '1 / -1'"] {
  background: #c0c0c0 !important;
}

/* Classic text colors override */
[data-theme="retro"] [style*="color: var(--accent-cyan)"],
[data-theme="retro"] [style*="color: var(--accent-amber)"],
[data-theme="retro"] [style*="color: var(--accent-green)"] {
  color: #000080 !important;
}

/* Classic modal/dialog styling */
[data-theme="retro"] [style*="position: fixed"][style*="background: rgba"] {
  background: rgba(0, 128, 128, 0.9) !important;
}

/* Classic table styling for DX cluster */
[data-theme="retro"] table,
[data-theme="retro"] [style*="display: grid"] {
  border-collapse: collapse;
}

[data-theme="retro"] tr:nth-child(even) {
  background: #dfdfdf;
}

[data-theme="retro"] tr:nth-child(odd) {
  background: #c0c0c0;
}

/* Classic Leaflet overrides */
[data-theme="retro"] .leaflet-container {
  background: #000080 !important;
}

[data-theme="retro"] .leaflet-control-zoom {
  border-radius: 0 !important;
}

[data-theme="retro"] .leaflet-control-zoom a {
  background: #c0c0c0 !important;
  color: #000000 !important;
  border-radius: 0 !important;
  box-shadow: 
    inset -1px -1px 0 #404040,
    inset 1px 1px 0 #ffffff !important;
}

[data-theme="retro"] .leaflet-popup-content-wrapper {
  background: #c0c0c0 !important;
  border-radius: 0 !important;
  box-shadow: 
    inset -1px -1px 0 #404040,
    inset 1px 1px 0 #ffffff,
    2px 2px 4px rgba(0,0,0,0.5) !important;
}

[data-theme="retro"] .leaflet-popup-tip {
  background: #c0c0c0 !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes dxnews-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.loading-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-amber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Legacy theme specific styles */
[data-theme="legacy"] .loading-spinner {
  border-color: var(--accent-green);
  border-top-color: var(--accent-amber);
}

/* Classic theme uses hourglass cursor for loading */
[data-theme="retro"] .loading-spinner {
  border-radius: 0;
  border-color: #000000;
  border-top-color: #808080;
}

/* ============================================
   LEAFLET MAP CUSTOMIZATIONS
   ============================================ */
.leaflet-container {
  background: var(--bg-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.leaflet-control-zoom {
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-tertiary) !important;
  color: var(--accent-amber) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 14, 20, 0.8) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

/* ============================================
   COUNTRY TOOLTIP STYLES
   ============================================ */
.country-tooltip {
  background: rgba(10, 14, 20, 0.9) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.country-tooltip::before {
  border-top-color: rgba(10, 14, 20, 0.9) !important;
}

/* ============================================
   CUSTOM MARKER STYLES
   ============================================ */
.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.de-marker {
  background: var(--accent-amber);
  color: #000;
  width: 32px;
  height: 32px;
}

.dx-marker {
  background: var(--accent-blue);
  color: #fff;
  width: 32px;
  height: 32px;
}

.sun-marker {
  background: radial-gradient(circle, #ffdd00 0%, #ff8800 100%);
  width: 24px;
  height: 24px;
  border: 2px solid #ffaa00;
}

.moon-marker {
  background: radial-gradient(circle, #e8e8f0 0%, #8888aa 100%);
  width: 24px;
  height: 24px;
  border: 2px solid #aaaacc;
}

/* Classic theme markers - square */
[data-theme="retro"] .custom-marker,
[data-theme="retro"] .de-marker,
[data-theme="retro"] .dx-marker {
  border-radius: 0 !important;
}

/* ============================================
   MAP STYLE SELECTOR
   ============================================ */
.map-style-control {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-style-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.map-style-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-amber);
}

.map-style-btn.active {
  background: var(--accent-amber);
  color: #000;
  border-color: var(--accent-amber);
}

/* ============================================
   POPUP STYLING
   ============================================ */
.leaflet-popup-content-wrapper {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
}

.leaflet-popup-tip {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-color) !important;
}

.leaflet-popup-content {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
  margin: 10px 12px !important;
}

/* ============================================
   PANEL STYLING
   ============================================ */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  backdrop-filter: blur(10px);
}

.panel-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* ============================================
   DX CLUSTER MAP TOOLTIPS
   ============================================ */
.dx-tooltip {
  background: rgba(20, 20, 30, 0.95) !important;
  border: 1px solid rgba(0, 170, 255, 0.5) !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 11px !important;
  color: #00aaff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.dx-tooltip::before {
  border-top-color: rgba(0, 170, 255, 0.5) !important;
}

.dx-tooltip-highlighted {
  background: rgba(68, 136, 255, 0.95) !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  font-weight: bold !important;
  font-size: 13px !important;
  box-shadow: 0 4px 16px rgba(68, 136, 255, 0.8) !important;
}

.dx-tooltip-highlighted::before {
  border-top-color: #ffffff !important;
}

/* Classic tooltips */
[data-theme="retro"] .dx-tooltip {
  background: #ffffcc !important;
  border: 1px solid #000000 !important;
  border-radius: 0 !important;
  color: #000000 !important;
  box-shadow: 2px 2px 0 #000000 !important;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-amber-dim);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-amber { color: var(--accent-amber); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-blue); }
.text-cyan { color: var(--accent-cyan); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }

.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-display { font-family: 'Orbitron', monospace; }

.bg-panel { background: var(--bg-panel); }
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }

/* ============================================
   WSPR PLUGIN ANIMATIONS (v1.3.0)
   ============================================ */

/* Animated path pulse effect */
@keyframes wspr-pulse {
  0% {
    stroke-dashoffset: 1000;
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.6;
  }
}

.wspr-animated-path {
  stroke-dasharray: 10, 5;
  animation: wspr-pulse 3s ease-in-out infinite;
}

/* Pulsing marker animation */
@keyframes wspr-marker-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.wspr-marker {
  animation: wspr-marker-pulse 2s ease-in-out infinite;
}

/* Control panel transitions */
.wspr-filter-control,
.wspr-stats,
.wspr-legend,
.wspr-chart {
  transition: all 0.3s ease;
}

.wspr-filter-control:hover,
.wspr-stats:hover,
.wspr-legend:hover,
.wspr-chart:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

/* Filter input styles */
.wspr-filter-control select,
.wspr-filter-control input[type="range"] {
  transition: all 0.2s ease;
}

.wspr-filter-control select:hover,
.wspr-filter-control select:focus {
  border-color: #00aaff;
  outline: none;
}

.wspr-filter-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00aaff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.wspr-filter-control input[type="range"]::-webkit-slider-thumb:hover {
  background: #00ddff;
}

.wspr-filter-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00aaff;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.wspr-filter-control input[type="range"]::-moz-range-thumb:hover {
  background: #00ddff;
}

/* Band activity chart bars animation */
@keyframes wspr-bar-grow {
  from {
    width: 0%;
  }
  to {
    width: var(--bar-width);
  }
}

.wspr-chart div[style*="background: linear-gradient"] {
  animation: wspr-bar-grow 0.5s ease-out;
}

/* Propagation score glow effect */
@keyframes wspr-score-glow {
  0%, 100% {
    text-shadow: 0 0 5px currentColor;
  }
  50% {
    text-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
  }
}

.wspr-stats div[style*="font-size: 18px"] {
  animation: wspr-score-glow 2s ease-in-out infinite;
}

/* ============================================
   EARTHQUAKE PLUGIN ANIMATIONS
   ============================================ */

/* New earthquake pulse animation - ring only */
@keyframes earthquake-pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Pulsing ring for new earthquakes */
.earthquake-pulse-ring {
  animation: earthquake-pulse 3s ease-out;
}

/* Flash/fade animation for new earthquakes - with shake */
@keyframes earthquake-flash {
  0% {
    opacity: 0;
    filter: brightness(3) drop-shadow(0 0 8px currentColor);
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-2px, 1px) rotate(-5deg);
  }
  20% {
    transform: translate(2px, -1px) rotate(5deg);
  }
  30% {
    opacity: 1;
    filter: brightness(2) drop-shadow(0 0 6px currentColor);
    transform: translate(-1px, 2px) rotate(-3deg);
  }
  40% {
    transform: translate(1px, -2px) rotate(3deg);
  }
  50% {
    transform: translate(-1px, 1px) rotate(-2deg);
  }
  60% {
    opacity: 1;
    filter: brightness(1.5) drop-shadow(0 0 4px currentColor);
    transform: translate(1px, -1px) rotate(2deg);
  }
  70% {
    transform: translate(0, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(0, -1px) rotate(1deg);
  }
  100% {
    opacity: 1;
    filter: brightness(1) drop-shadow(0 0 0px transparent);
    transform: translate(0, 0) rotate(0);
  }
}

.earthquake-pulse-new {
  animation: earthquake-flash 0.8s ease-out;
}

/* No animation for regular earthquake markers */
.earthquake-marker {
  /* Static, no animation */
}

/* Lightning strike animations */
@keyframes lightning-pulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(2.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Pulsing ring for new lightning strikes */
.lightning-pulse-ring {
  animation: lightning-pulse 2s ease-out;
}

/* Flash animation for new lightning strikes - no transform */
@keyframes lightning-flash {
  0% {
    opacity: 0;
    filter: brightness(3) drop-shadow(0 0 10px gold);
  }
  20% {
    opacity: 1;
    filter: brightness(4) drop-shadow(0 0 12px gold);
  }
  50% {
    opacity: 1;
    filter: brightness(2.5) drop-shadow(0 0 8px gold);
  }
  100% {
    opacity: 1;
    filter: brightness(1) drop-shadow(0 0 0px transparent);
  }
}

.lightning-strike-new {
  animation: lightning-flash 0.8s ease-out;
}

/* No animation for regular lightning markers */
.lightning-strike {
  /* Static, no animation */
}

/* Lightning stats panel styling */
.lightning-stats {
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.lightning-stats:hover {
  border-color: rgba(255, 215, 0, 0.6);
}

/* Earthquake icon markers */
.earthquake-icon {
  z-index: 10000 !important;
  pointer-events: auto;
  /* Removed position: relative - was causing icons to appear offset from marker position */
}

.earthquake-icon div {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  /* position: relative removed here too */
  z-index: 10000 !important;
}

/* Lightning icon markers */
.lightning-icon {
  z-index: 10000 !important;
  pointer-events: auto;
  position: relative !important;
}

.lightning-icon div {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 10000 !important;
}

/* ============================================
   RESPONSIVE: Phone & Small Screen Overrides
   ============================================ */

/* Tablets and small screens (under 1024px) */
@media (max-width: 1024px) {
  .panel {
    padding: 6px !important;
    border-radius: 4px !important;
  }

  .panel-header {
    font-size: 11px !important;
    padding: 4px 6px !important;
  }
}

/* Phone landscape and small tablets (under 768px) */
@media (max-width: 768px) {
  /* Force single-column on modern layout */
  .ohc-mobile-stack {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
  }

  .panel {
    padding: 4px !important;
    margin-bottom: 2px !important;
    border-radius: 3px !important;
  }

  .panel-header {
    font-size: 10px !important;
    padding: 3px 6px !important;
  }

  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
  }
}

/* Phone portrait (under 480px) */
@media (max-width: 480px) {
  /* Extra compact for phones */
  .panel {
    padding: 3px !important;
    font-size: 11px !important;
  }

  .panel-header {
    font-size: 9px !important;
  }

  /* Reduce font sizes globally for very small screens */
  body {
    font-size: 12px;
  }
}

/* Short screens (Pi 7" touchscreen at 480px height) */
@media (max-height: 520px) {
  .panel {
    padding: 3px !important;
  }

  .panel-header {
    padding: 2px 4px !important;
    font-size: 10px !important;
  }
}

/* Touch device improvements */
@media (pointer: coarse) {
  /* Larger tap targets for touchscreens */
  button {
    min-height: 36px;
    min-width: 36px;
  }

  /* Prevent text selection on tap */
  .panel-header {
    user-select: none;
    -webkit-user-select: none;
  }

  /* Scrollbar styling for touch */
  ::-webkit-scrollbar {
    width: 4px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

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