/* Panel chrome, tabs, and content areas */

/* Tab bar */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-dim);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

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

.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: var(--bg-panel);
}

/* Tab content */
.tab-content {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

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

.tab-content.active {
  display: flex;
  animation: tabFadeIn 0.25s ease-out;
}

/* Plot area */
.plot-area {
  flex: 1;
  position: relative;
  min-height: 0;
}

.plot-area canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Slider panel below plot */
.slider-panel {
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-dim);
  overflow-y: auto;
  max-height: 240px;
}

.slider-panel h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Dashboard overlay */
#dashboard {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.8;
  z-index: 5;
  pointer-events: none;
  min-width: 180px;
}

#dashboard .dash-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

#dashboard .dash-label {
  color: var(--text-dim);
}

#dashboard .dash-value {
  color: var(--cyan);
  font-weight: 500;
  text-align: right;
}

#dashboard .dash-unit {
  color: var(--text-dim);
  font-size: 10px;
  margin-left: 3px;
}

/* Easy mode dashboard */
#easy-dashboard {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(5, 5, 16, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 5;
  pointer-events: none;
  min-width: 220px;
  max-width: 280px;
}

.easy-dash-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.easy-dash-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-dim);
}

.easy-dash-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.easy-dash-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.easy-dash-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.easy-dash-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  font-weight: 500;
}

.easy-dash-comp {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Encounter info callouts */
.encounter-info {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(5, 5, 16, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
  max-width: 280px;
  z-index: 5;
}

.encounter-info h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.encounter-info p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* Tab navigation (easy mode next/prev) */
.tab-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
  gap: 12px;
}

.tab-nav-btn {
  padding: 6px 16px;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  color: var(--cyan);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-nav-btn:hover {
  background: var(--cyan);
  color: var(--bg-deep);
}

.tab-nav-btn:active {
  transform: scale(0.96);
}

.tab-nav-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  flex: 1;
}

/* Mobile: fix tab content overflow and constrain panel sizes */
@media (max-width: 1024px) {
  .tab-content {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
  }

  .slider-panel {
    max-height: 160px;
  }

  .plot-area {
    flex-shrink: 1;
    min-height: 150px;
  }
}

@media (max-width: 768px) {
  .plot-area {
    min-height: 120px;
    max-height: 35vh;
  }

  .slider-panel {
    max-height: 120px;
    padding: 8px 12px;
  }

  /* Easy annotations eat too much plot space on mobile */
  .easy-annotation {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
    font-size: 11px;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .plot-area {
    min-height: 100px;
    max-height: 30vh;
  }

  .slider-panel {
    max-height: 100px;
  }

  .easy-annotation {
    display: none;
  }

  .tab-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
    min-width: 0;
  }
}

/* Frame indicator */
.frame-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(5, 5, 16, 0.8);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  z-index: 5;
  pointer-events: none;
}
