/* AIRSPACE STANDOFF: Cockpit Workspace Layout */

.hud-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100vw;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  background-color: var(--color-pitch-black);
}

.cockpit-workspace {
  flex: 1 1 0%;
  min-height: 0;
  height: 0;
  display: grid;
  grid-template-columns: 215px 1fr 310px;
  background-color: var(--color-pitch-black);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--glass-border);
}

.strip-header {
  background: var(--liquid-glass-bg);
  padding: 6px 10px;
  font-size: 0.66rem;
  font-weight: 600;
  font-family: var(--font-untitled-sans);
  color: var(--color-ice-highlight);
  border-bottom: 1px solid var(--glass-border);
  border-top: 1px solid var(--liquid-glass-border-top);
  border-left: 3px solid var(--theme-accent);
  letter-spacing: 0.6px;
  flex-shrink: 0;
}

#fleet-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.strip-subhead {
  font-size: 0.60rem;
  font-weight: 600;
  color: var(--color-moon-mist);
  font-family: var(--font-untitled-sans);
  padding: 3px 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 2px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.fleet-drawer-close-btn {
  display: none;
}

.mobile-steering-overlay {
  display: none;
  position: absolute;
  bottom: 8px;
  right: 12px;
  gap: 5px;
  pointer-events: none;
  z-index: 15;
}

body.has-touch .mobile-steering-overlay,
.is-android .mobile-steering-overlay,
.is-android-apk .mobile-steering-overlay {
  display: flex !important;
}

@media (max-width: 1440px) and (min-width: 1201px) {
  .cockpit-workspace {
    grid-template-columns: 200px 1fr 295px;
  }
}

@media (min-width: 1025px) and (max-width: 1366px) {
  .cockpit-workspace {
    grid-template-columns: 190px 1fr 280px;
  }
}

@media (max-width: 1024px) and (orientation: portrait) {
  .cockpit-workspace {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .mobile-steering-overlay {
    display: flex !important;
  }

  #pane-radar.radar-viewport {
    display: flex !important;
    position: relative !important;
    flex: 1 1 0% !important;
    min-height: 180px !important;
    width: 100% !important;
    height: auto !important;
    z-index: 1 !important;
  }

  #pane-mfd.active-unit-mfd {
    display: flex !important;
    position: static !important;
    flex: 0 0 auto !important;
    max-height: 30vh !important;
    max-height: 30dvh !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    border-left: none !important;
    border-top: 1px solid var(--border-color) !important;
    background: var(--liquid-glass-bg) !important;
    padding: 3px 5px !important;
    gap: 2px !important;
    z-index: 2 !important;
  }

  #pane-fleet.squadron-flight-data {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.96);
    flex-direction: column;
    padding: 8px;
    overflow-y: auto;
  }

  html.safe-zone-on #pane-fleet.squadron-flight-data,
  body.safe-zone-on #pane-fleet.squadron-flight-data {
    padding: max(8px, var(--safe-top, 0px)) max(8px, var(--safe-right, 0px)) max(8px, var(--safe-bottom, 0px)) max(8px, var(--safe-left, 0px));
  }

  #pane-fleet.squadron-flight-data.drawer-open {
    display: flex !important;
  }

  #fleet-strip-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 10px !important;
    width: 100% !important;
  }

  .fleet-drawer-close-btn {
    display: inline-flex !important;
    margin-left: auto !important;
    min-height: 28px;
    padding: 3px 12px;
    font-weight: 700;
    flex-shrink: 0;
  }
}

@media (max-width: 1024px) and (orientation: landscape), (max-height: 550px) and (max-width: 1024px) {
  .cockpit-workspace {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .mobile-steering-overlay {
    display: flex !important;
  }

  #pane-radar.radar-viewport {
    display: flex !important;
    position: relative !important;
    flex: 1 1 0% !important;
    height: 100% !important;
    min-width: 0 !important;
    z-index: 1 !important;
  }

  #pane-mfd.active-unit-mfd {
    display: flex !important;
    position: static !important;
    flex: 0 0 280px !important;
    width: 280px !important;
    max-height: 100% !important;
    height: 100% !important;
    border-left: 1px solid var(--border-color) !important;
    border-top: none !important;
    background: var(--liquid-glass-bg) !important;
    padding: 3px 5px !important;
    gap: 2px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 2 !important;
  }

  #pane-fleet.squadron-flight-data {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.96);
    padding: 8px 12px;
    overflow-y: auto;
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  html.safe-zone-on #pane-fleet.squadron-flight-data,
  body.safe-zone-on #pane-fleet.squadron-flight-data {
    padding: max(8px, var(--safe-top, 0px)) max(12px, var(--safe-right, 0px)) max(8px, var(--safe-bottom, 0px)) max(12px, var(--safe-left, 0px));
  }

  #pane-fleet.squadron-flight-data.drawer-open {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  #fleet-strip-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 10px !important;
    width: 100% !important;
  }

  .fleet-drawer-close-btn {
    display: inline-flex !important;
    margin-left: auto !important;
    min-height: 28px;
    padding: 3px 12px;
    font-weight: 700;
    flex-shrink: 0;
  }
}