/* ============================================================
   FMS.CSS — FMS data strip, tabs, data cells
   ============================================================ */

/* Outer bezel */
.fms-strip {
  width: 100%;
  max-width: 800px;
  background: black;
  border: 2px solid #0d1520;
  font-family: var(--mono);
}

/* Tab row */
.fms-tabs {
  display: flex;
  gap: 3px;
  padding: 3px 3px 0;
  background: black;
}

.fms-tab {
  flex: 1;
  text-align: center;
  padding: .35rem .4rem;
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--white);
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s;
  background: #3a3f4a;
  border-top: 1px solid #6a7080;
  border-left: 1px solid #6a7080;
  border-right: 1px solid var(--inset);
  border-bottom: 1px solid var(--inset);
  position: relative;
}

/* Triangle indicator — pinned to the right of each tab */
.fms-tab:hover {
  background: #4a5060;
}

.fms-tab::after {
  content: '▾';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--white);
}

/* Active tab — border only around the label text, not the triangle */
.fms-tab.active {
  background: #3a3f4a;
}

.fms-tab.active .fms-tab-label {
  border: 1px solid var(--white);
  padding: .1rem .3rem;
}

/* Data row */
.fms-data-row {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  padding: .3rem .2rem;
  gap: .2rem;
}

/* Each data cell */
.fms-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: .3rem .4rem;
  gap: .25rem;
  min-width: 0;
}

/* Label */
.fms-label {
  font-size: .6rem;
  letter-spacing: .15em;
  color: var(--white);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Value field — bordered MCDU input box (inset 3D effect) */
.fms-field {
  display: inline-flex;
  align-items: baseline;
  gap: .15em;
  background: var(--surface);
  border-top: 2px solid var(--inset);
  border-left: 2px solid var(--inset);
  border-bottom: 2px solid #80858f;
  border-right: 2px solid #7d828d;
  padding: .2rem .4rem;
  white-space: nowrap;
}

/* Numeric value — cyan */
.fms-val {
  font-size: 1rem;
  letter-spacing: .08em;
  line-height: 1;
  color: var(--accent);
}

/* Unit — indigo */
.fms-unit {
  font-size: .8rem;
  letter-spacing: .06em;
  line-height: 1;
  color: #5a6aae;
}

/* ============================================================
   TAB PANELS — show/hide based on active tab
   ============================================================ */
.tab-panel {
  display: none;
  width: 100%;
  max-width: 820px;
}

.tab-panel.active {
  display: contents;
}

/* Fade-in on tab switch — triggered by JS via .tab-fade class */
.tab-fade {
  animation: tabFadeIn .6s ease both;
}

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

/* Placeholder for upcoming tabs */
.tab-placeholder {
  width: 100%;
  max-width: 800px;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  font-size: .85rem;
  letter-spacing: .14em;
  color: var(--muted);
}

/* ============================================================
   DATA SCREEN — About / info text block (FMS scratchpad style)
   ============================================================ */
.data-screen {
  width: 100%;
  max-width: 800px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--mono);
  padding: .6rem .8rem;
  display: flex;
  flex-direction: column;
  max-height: 620px;
}

.data-header {
  background: var(--white);
  padding: .35rem .5rem;
  margin-bottom: .6rem;
}

.data-title {
  font-size: 1.1rem;
  letter-spacing: .16em;
  color: black;
}

.data-body {
  padding: .4rem .4rem;
  line-height: 1.7;
  font-size: .92rem;
  letter-spacing: .04em;
  color: var(--green);
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.data-body p {
  margin-bottom: .6rem;
}

.data-body p:last-child {
  margin-bottom: 0;
}

.data-hl {
  color: var(--amber);
  font-weight: 700;
}

/* Feature sections with FMS-style label */
.data-section {
  margin: .8rem 0;
  padding-left: .6rem;
  border-left: 2px solid var(--green);
}

.data-section-title {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--white);
  margin-bottom: .3rem;
}

.data-section p {
  margin-bottom: 0;
}

.data-footer-buttons {
  display: flex;
  gap: 0;
  margin-left: auto;
}

/* Language toggle — hidden by default, shown when active */
.data-lang { display: none; }
.data-lang.active { display: block; }

.fpln-btn-lang {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .14em;
  padding: .6rem .9rem;
}

.data-footer {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .5rem .4rem .2rem;
  border-top: 1px solid var(--white);
  margin-top: .6rem;
  font-size: .6rem;
  letter-spacing: .14em;
}

.data-version {
  font-size: .8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}

a.data-version:hover {
  color: var(--accent);
}

.data-sep {
  color: #4a5a6e;
}

.data-engine {
  font-size: .8rem;
  color: var(--accent);
}

/* ============================================================
   CHANGELOG OVERLAY
   ============================================================ */
.changelog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .7);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.changelog-overlay.active {
  display: flex;
}

.changelog-screen {
  max-height: 80vh;
}

.changelog-body .changelog-version {
  margin-bottom: 1rem;
}

.changelog-body .changelog-version:last-child {
  margin-bottom: 0;
}

.changelog-body .changelog-version-title {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--white);
  margin-bottom: .3rem;
}

.changelog-body .changelog-version-date {
  font-size: .65rem;
  color: var(--text-muted);
  letter-spacing: .1em;
}

.changelog-body ul {
  list-style: none;
  padding: 0;
  margin: .4rem 0 0;
}

.changelog-body li {
  padding: .15rem 0 .15rem .8rem;
  position: relative;
}

.changelog-body li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--accent);
}

#changelog-close {
  padding: .6rem .9rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .data-screen { max-width: 100%; max-height: none; padding: .4rem .5rem; }
  .changelog-screen { max-height: 80vh; }
  .data-body { font-size: .65rem; }
  .data-footer { font-size: .52rem; gap: .5rem; }
}

@media (max-width: 400px) {
  .data-title,
  .perf-title { font-size: .68rem; }
  .data-body { font-size: .6rem; line-height: 1.6; }
}
