/* ==========================================================================
   Dualpilot Drone Flight Control Dashboard Style Sheet
   Theme: Sci-Fi Military Cyberpunk Dark Mode
   ========================================================================== */

:root {
  --bg-color: #050811;
  --panel-bg: rgba(10, 15, 30, 0.75);
  --panel-border: rgba(0, 240, 255, 0.15);
  --panel-glow: rgba(0, 240, 255, 0.05);
  
  /* Accent Colors */
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.4);
  --red: #ff0055;
  --red-glow: rgba(255, 0, 85, 0.4);
  --yellow: #ffdd00;
  --yellow-glow: rgba(255, 221, 0, 0.4);
  --green: #00e676;
  --green-glow: rgba(0, 230, 118, 0.4);
  --blue: #0088ff;
  
  /* Text Colors */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-hud: 'Orbitron', 'Inter', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --font-body: 'Inter', sans-serif;
  
  --topbar-height: 70px;
  --bottombar-height: 90px;
  --sidebar-collapsed-width: 60px;
  --sidebar-expanded-width: 240px;
  --border-radius: 6px;
  --transition-speed: 0.3s;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */

.dashboard-container {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-columns: auto 1fr;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Map background */
.map-wrapper {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
  background: #090e17;
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Top Bar
   ========================================================================== */

.top-bar {
  grid-row: 1;
  grid-column: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(8, 12, 24, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--cyan);
  box-shadow: 0 2px 20px rgba(0, 240, 255, 0.15);
  z-index: 10;
}

.system-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon i {
  color: var(--cyan);
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 5px var(--cyan));
}

.brand-text h1 {
  font-family: var(--font-hud);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
}

.brand-text .sub-text {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--cyan);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  color: var(--cyan);
  text-shadow: 0 0 4px var(--cyan-glow);
}

.status-badge.active-flying {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0, 230, 118, 0.1);
  text-shadow: 0 0 4px var(--green-glow);
}

.status-badge.paused {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(255, 221, 0, 0.1);
  text-shadow: 0 0 4px var(--yellow-glow);
}

.status-badge.alert-danger {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 0, 85, 0.1);
  text-shadow: 0 0 4px var(--red-glow);
}

.blink-dot {
  width: 6px;
  height: 6px;
  background-color: currentColor;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.top-stats-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.stat-val {
  font-family: var(--font-hud);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.stat-val .unit {
  font-size: 0.7rem;
  color: var(--cyan);
}

.stat-divider {
  width: 1px;
  height: 25px;
  background: rgba(255, 255, 255, 0.1);
}

.power-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hud);
  font-size: 0.9rem;
  font-weight: bold;
}

.status-green {
  color: var(--green);
  filter: drop-shadow(0 0 3px var(--green-glow));
}
.status-yellow {
  color: var(--yellow);
  filter: drop-shadow(0 0 3px var(--yellow-glow));
}
.status-red {
  color: var(--red);
  filter: drop-shadow(0 0 5px var(--red-glow));
  animation: blink 0.8s infinite;
}

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

/* ==========================================================================
   Left Sidebar
   ========================================================================== */

.sidebar-left {
  grid-row: 2;
  grid-column: 1;
  width: var(--sidebar-collapsed-width);
  height: calc(100vh - var(--topbar-height));
  background: rgba(6, 10, 20, 0.95);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 0;
  z-index: 9;
  transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.sidebar-left:not(.collapsed) {
  width: var(--sidebar-expanded-width);
  align-items: stretch;
  padding: 15px;
}

.sidebar-left .toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  transition: all var(--transition-speed);
  align-self: center;
}

.sidebar-left:not(.collapsed) .toggle-btn {
  align-self: flex-end;
  border: 1px solid var(--panel-border);
}

.sidebar-left .toggle-btn:hover {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 8px var(--panel-border);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.sidebar-left.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-text {
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: none;
}

.sidebar-left:not(.collapsed) .nav-text {
  opacity: 1;
  display: inline;
}

.nav-item:hover, .nav-item.active {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: inset 3px 0 0 var(--cyan);
}

/* Playback Control Area */
.playback-controls {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

.control-header-text {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: center;
  display: none;
}

.sidebar-left:not(.collapsed) .control-header-text {
  display: block;
}

.buttons-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.sidebar-left:not(.collapsed) .buttons-row {
  flex-direction: row;
  justify-content: space-between;
}

.control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-left:not(.collapsed) .control-btn {
  flex: 1;
  border-radius: var(--border-radius);
  height: 38px;
}

.control-btn:hover {
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

#btn-play:hover, #btn-play.active {
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

#btn-pause:hover, #btn-pause.active {
  background: rgba(255, 221, 0, 0.15);
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 10px var(--yellow-glow);
}

#btn-stop:hover {
  background: rgba(255, 0, 85, 0.15);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.sim-speed-control {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}

.sidebar-left:not(.collapsed) .sim-speed-control {
  display: flex;
}

.sim-speed-control label {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.sim-speed-control select {
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.sim-speed-control select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 5px var(--cyan-glow);
}

/* ==========================================================================
   Right Sidebar (Floating Panels)
   ========================================================================== */

.sidebar-right {
  position: absolute;
  top: calc(var(--topbar-height) + 15px);
  right: 15px;
  bottom: calc(var(--bottombar-height) + 15px);
  width: 50px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 8;
  display: flex;
  flex-direction: column;
  padding: 50px 0 15px 0;
  transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
              padding var(--transition-speed) ease;
  overflow: hidden;
}

.sidebar-right:not(.collapsed) {
  width: 330px;
  padding: 50px 15px 15px 15px;
  overflow-y: auto;
}

/* Floating toggles */
.floating-toggle-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 12;
}

.floating-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.sidebar-right.collapsed .icon-close { display: none; }
.sidebar-right.collapsed .icon-open { display: block; }
.sidebar-right:not(.collapsed) .icon-close { display: block; }
.sidebar-right:not(.collapsed) .icon-open { display: none; }

/* Collapsed Fast Icons View */
.fast-access-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar-right:not(.collapsed) .fast-access-icons {
  display: none;
  opacity: 0;
}

.fast-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fast-btn:hover, .fast-btn.active {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
  background: rgba(0, 240, 255, 0.1);
}

/* Expanded View Content */
.expanded-controls-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  height: 100%;
}

.sidebar-right:not(.collapsed) .expanded-controls-content {
  opacity: 1;
  pointer-events: auto;
}

.expanded-controls-content h2 {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #fff;
  text-align: center;
  margin-top: 10px;
}

.panel-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cyan), transparent);
  margin-bottom: 5px;
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(2, 6, 12, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: var(--border-radius);
}

.control-section h3 {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-section h3 i {
  width: 16px;
  height: 16px;
}

.section-desc {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Switch styling */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 6px 0;
}

.switch-label {
  font-size: 0.75rem;
  color: var(--text-primary);
}

.switch-container input {
  display: none;
}

.switch-container .slider {
  position: relative;
  width: 34px;
  height: 18px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 9px;
  transition: .4s;
  border: 1px solid var(--text-muted);
}

.switch-container .slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}

.switch-container input:checked + .slider {
  background-color: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
  box-shadow: 0 0 5px var(--cyan-glow);
}

.switch-container input:checked + .slider:before {
  transform: translateX(16px);
  background-color: var(--cyan);
}

/* Forms and Inputs */
.input-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.form-col label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-col input {
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--panel-border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 8px;
  border-radius: 4px;
  outline: none;
}

.form-col input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 5px var(--cyan-glow);
}

.input-hint {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-hud);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  text-shadow: 0 0 4px var(--cyan-glow);
}

.btn-primary:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
}

.btn-secondary:hover, .btn-secondary.active {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 8px var(--yellow-glow);
  background: rgba(255, 221, 0, 0.05);
}

#map-picker-status {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  text-align: center;
  padding: 4px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.picker-status-inactive {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.picker-status-active {
  background: rgba(255, 221, 0, 0.15);
  color: var(--yellow);
  border: 1px dashed var(--yellow);
  animation: pulse 1s infinite alternate;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
  padding-bottom: 4px;
}

.info-row span:first-child {
  color: var(--text-secondary);
}

.info-row .val {
  color: #fff;
}

.text-cyan { color: var(--cyan) !important; }
.text-red { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-yellow { color: var(--yellow) !important; }

/* ==========================================================================
   Floating Telemetry Box (Bottom-Right)
   ========================================================================== */

.telemetry-box {
  position: absolute;
  bottom: calc(var(--bottombar-height) + 15px);
  right: 80px; /* Offset to stay beside the right sidebar */
  width: 280px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 8;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: right var(--transition-speed) ease;
}

/* Adjust telemetry box position if right sidebar is expanded */
.sidebar-right:not(.collapsed) ~ .telemetry-box {
  right: 360px;
}

.telemetry-header {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-header i {
  color: var(--cyan);
  width: 16px;
  height: 16px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tele-item {
  display: flex;
  flex-direction: column;
  background: rgba(2, 6, 12, 0.4);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.tele-label {
  font-family: var(--font-hud);
  font-size: 0.55rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.tele-val {
  font-size: 0.85rem;
  font-weight: bold;
  color: #ffffff;
}

.tele-unit {
  font-size: 0.65rem;
  color: var(--cyan);
  font-weight: normal;
}

.tele-wind-dir {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Tilt Horizon Gauges */
.tilt-indicators {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.tilt-gauge {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(2, 6, 12, 0.3);
  padding: 6px;
  border-radius: 4px;
}

.gauge-label {
  font-family: var(--font-hud);
  font-size: 0.55rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.visual-pitch-container {
  position: relative;
  width: 60px;
  height: 35px;
  background: #040811;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
}

.visual-pitch-container::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--cyan);
  opacity: 0.7;
  z-index: 3;
}

.pitch-horizon {
  position: absolute;
  top: calc(50% - 2px);
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
  transition: transform 0.1s ease;
  z-index: 2;
}

.visual-roll-container {
  position: relative;
  width: 35px;
  height: 35px;
  background: #040811;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-roll-container::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.roll-needle-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.1s ease;
}

.roll-needle {
  position: absolute;
  top: 5px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 12px;
  background: var(--green);
  border-radius: 1.5px;
  box-shadow: 0 0 4px var(--green);
}

.gauge-value {
  font-size: 0.7rem;
  color: #fff;
  margin-top: 4px;
}

/* ==========================================================================
   Bottom Status Bar (Logs)
   ========================================================================== */

.bottom-bar {
  position: absolute;
  bottom: 15px;
  left: 80px;
  right: 375px;
  height: 90px;
  background: rgba(10, 15, 30, 0.5) !important;
  backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 8;
  padding: 8px 15px;
  display: flex;
  flex-direction: column;
  transition: left var(--transition-speed) ease, right var(--transition-speed) ease, opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.bottom-bar.collapsed-logs {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.sidebar-left:not(.collapsed) ~ .bottom-bar {
  left: 260px;
}

.sidebar-right:not(.collapsed) ~ .bottom-bar {
  right: 655px;
}

.system-logs-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.logs-title {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--cyan);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logs-title i {
  width: 12px;
  height: 12px;
}

.logs-container {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.03);
}

.log-entry {
  margin-bottom: 2px;
}

.log-time {
  color: var(--text-muted);
  margin-right: 6px;
}

.log-info {
  color: var(--text-primary);
}

.log-success {
  color: var(--green);
  text-shadow: 0 0 2px rgba(0, 230, 118, 0.2);
}

.log-warning {
  color: var(--yellow);
  text-shadow: 0 0 2px rgba(255, 221, 0, 0.2);
}

.log-danger {
  color: var(--red);
  font-weight: bold;
  text-shadow: 0 0 3px rgba(255, 0, 85, 0.2);
}

/* ==========================================================================
   Altitude Control Bar (vertical version)
   ========================================================================== */

.altitude-control-bar {
  position: absolute;
  right: 80px;
  width: 110px;
  padding: 10px;
  border-radius: var(--border-radius);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: right var(--transition-speed) ease;
}

.sidebar-right:not(.collapsed) ~ .altitude-control-bar {
  right: 360px;
}

.alt-bar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding-bottom: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.alt-bar-title {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.alt-rate-display {
  font-size: 0.6rem;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.05);
}

.alt-bar-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.alt-slider-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 180px;
}

.alt-axis-label-v {
  font-size: 0.55rem;
  color: var(--text-muted);
  line-height: 1;
}

.alt-rate-slider-vertical {
  writing-mode: vertical-lr;
  direction: rtl;
  flex: 1;
  width: 10px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}

.alt-rate-slider-vertical::-webkit-slider-runnable-track {
  background: linear-gradient(to top, rgba(255, 100, 0, 0.3), rgba(255,255,255,0.07), rgba(0, 240, 255, 0.3));
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.alt-rate-slider-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 14px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
  cursor: pointer;
  border: 2px solid #fff;
  margin-left: -3px;
}

.alt-rate-slider-vertical::-moz-range-track {
  background: linear-gradient(to top, rgba(255, 100, 0, 0.3), rgba(255,255,255,0.07), rgba(0, 240, 255, 0.3));
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.alt-rate-slider-vertical::-moz-range-thumb {
  height: 20px;
  width: 14px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
  cursor: pointer;
  border: 2px solid #fff;
}

.alt-divider-h {
  width: 80%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--panel-border), transparent);
}

.alt-fixed-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.alt-fixed-label {
  font-family: var(--font-hud);
  font-size: 0.55rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.alt-fixed-row {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.alt-fixed-input {
  width: 60px;
  background: rgba(5, 10, 25, 0.9);
  border: 1px solid var(--panel-border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  text-align: center;
}

.alt-fixed-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
}

.alt-unit-badge {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  color: var(--cyan);
  font-weight: bold;
}

.btn-send-alt {
  padding: 4px 8px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-hud);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-send-alt:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* ==========================================================================
   Map Picker Yellow Dot Marker
   ========================================================================== */

.picker-dot-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: crosshair;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid #fff;
  box-shadow: 0 0 12px var(--yellow-glow), 0 0 20px rgba(255, 221, 0, 0.4);
  animation: picker-pulse 1.2s infinite ease-out;
}

@keyframes picker-pulse {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 var(--yellow-glow); }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 10px rgba(255, 221, 0, 0); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(255, 221, 0, 0); }
}

.picker-dot-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  opacity: 0.5;
  animation: ring-pulse 1.2s infinite ease-out;
}

@keyframes ring-pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ==========================================================================
   Waypoint Place Marker (Google Maps pin style dot)
   ========================================================================== */

.wp-place-dot-wrapper {
  position: relative;
  width: 22px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.wp-place-dot {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #00f0ff 0%, #0066ff 100%);
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 3px 8px rgba(0,0,0,0.5);
  transform: rotate(-45deg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wp-place-dot-wrapper:hover .wp-place-dot {
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.9), 0 3px 12px rgba(0,0,0,0.6);
  transform: rotate(-45deg) scale(1.15);
}

.wp-place-dot-inner {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  transform: rotate(45deg);
}

/* ==========================================================================
   Map Right-Click Context Menu (for picker mode road drawing)
   ========================================================================== */

.map-context-menu {
  position: fixed;
  z-index: 9999;
  background: rgba(5, 10, 25, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 240, 255, 0.1);
  min-width: 180px;
  overflow: hidden;
  animation: ctxFadeIn 0.12s ease;
}

/* ==========================================================================
   Waypoint Right-Click Context Menu
   ========================================================================== */

.wp-context-menu {
  position: fixed;
  z-index: 9999;
  background: rgba(5, 10, 25, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 240, 255, 0.1);
  min-width: 180px;
  overflow: hidden;
  animation: ctxFadeIn 0.12s ease;
}

@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.92) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wp-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wp-ctx-item:hover {
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
}

.wp-ctx-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0 10px;
}

.wp-ctx-danger {
  color: var(--red) !important;
  opacity: 0.85;
}

.wp-ctx-danger:hover {
  background: rgba(255, 0, 85, 0.15) !important;
  color: var(--red) !important;
  opacity: 1;
}

/* Replaced road segment (old path highlighted in red) */
.replaced-segment-line {
  stroke: var(--red);
  opacity: 0.7;
  animation: replaced-pulse 1s infinite ease-in-out;
}

@keyframes replaced-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}



/* Leaflet dark theme styling overrides */
.leaflet-container {
  font-family: var(--font-body) !important;
}

.leaflet-control-zoom {
  border: 1px solid var(--panel-border) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
}

.leaflet-control-zoom-in, .leaflet-control-zoom-out {
  background: var(--panel-bg) !important;
  color: var(--cyan) !important;
  border-bottom: 1px solid var(--panel-border) !important;
}

.leaflet-control-zoom-in:hover, .leaflet-control-zoom-out:hover {
  background: rgba(0, 240, 255, 0.15) !important;
}

.leaflet-bar {
  border-radius: var(--border-radius) !important;
  overflow: hidden;
}

.leaflet-popup-content-wrapper {
  background: var(--panel-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--cyan) !important;
  box-shadow: 0 4px 12px var(--cyan-glow) !important;
  backdrop-filter: blur(8px);
}

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

/* Custom Marker Styling classes */
.pulse-threat-yellow {
  animation: pulse-yellow-marker 1.5s infinite ease-out;
}

.pulse-threat-red {
  animation: pulse-red-marker 1s infinite ease-out;
}

@keyframes pulse-yellow-marker {
  0% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 0 0 var(--yellow-glow); }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 8px rgba(255, 221, 0, 0); }
  100% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 0 0 rgba(255, 221, 0, 0); }
}

@keyframes pulse-red-marker {
  0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 var(--red-glow); }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 10px rgba(255, 0, 85, 0); }
  100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

/* Drone icon rotation styling */
.drone-icon-div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.drone-svg {
  filter: drop-shadow(0 0 5px var(--cyan));
}

.threat-svg-red {
  filter: drop-shadow(0 0 4px var(--red));
}

.threat-svg-yellow {
  filter: drop-shadow(0 0 4px var(--yellow));
}

/* Grid overlay styling */
.chessboard-grid-svg {
  pointer-events: none;
}

/* Vertical slider styling */
.vertical-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 8px;
  height: 55px;
  -webkit-appearance: slider-vertical;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.vertical-slider::-webkit-slider-runnable-track {
  background: transparent;
}

.vertical-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 16px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 5px var(--cyan-glow);
  cursor: pointer;
}

#btn-toggle-logs:hover {
  color: var(--red) !important;
}
