/* FILE: css/responsive.css — Breakpoints, minimum viewport handling */

/* ── Minimum target: 1280×800 ────────────────────────────────────────────── */
/* The simulator is designed for desktop use only.
   Below 1280px width, a blocking message is shown.
   See layout.css #mobile-guard for the guard element. */

/* ── Panel-specific layout adjustments at common desktop widths ──────────── */

/* 1280px - 1440px: compact layout, reduce some padding */
@media (max-width: 1440px) {
  :root {
    --sp-3: 10px;
    --sp-4: 14px;
    --sp-6: 20px;
  }
  .panel-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .db-row {
    flex-wrap: wrap;
  }
  .db-cell {
    min-width: 100px;
  }
}

/* 1280px - 1366px: tightest supported layout */
@media (max-width: 1366px) {
  :root {
    --fs-base: 0.82rem;
    --fs-sm: 0.75rem;
    --sp-3: 8px;
    --sp-4: 12px;
  }
  .ann-tile {
    font-size: 7.5px;
    min-height: 32px;
  }
  .annunciator-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
  }
  .tab-btn {
    padding: 0 10px;
    font-size: 9px;
  }
  #header .plant-name {
    font-size: var(--fs-md);
  }
  .tacho-rpm-readout {
    font-size: var(--fs-2xl);
  }
  .db-big-value {
    font-size: var(--fs-3xl);
  }
}

/* ── Height adjustments ──────────────────────────────────────────────────── */
@media (max-height: 768px) {
  #header { height: 40px; }
  #tab-bar { height: 32px; }
  #status-bar { height: 28px; }
  #app {
    grid-template-rows: 40px 32px 1fr 28px;
  }
  .panel {
    padding: var(--sp-2);
  }
  .card-body {
    padding: var(--sp-2);
  }
  .modal-box {
    max-height: 95vh;
  }
  .vbargraph-track {
    min-height: 60px;
  }
}

/* ── Widescreen (1920px+) — more generous spacing ───────────────────────── */
@media (min-width: 1920px) {
  :root {
    --fs-base: 0.95rem;
    --fs-sm: 0.875rem;
    --sp-3: 14px;
    --sp-4: 18px;
  }
  .panel-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .panel-grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
  .ann-tile {
    font-size: 9.5px;
    min-height: 42px;
  }
}

/* ── Print (for shift log export) ───────────────────────────────────────── */
@media print {
  #header, #tab-bar, #status-bar, #directive-console,
  #directive-toggle, .btn, .modal-overlay { display: none !important; }
  body { background: white; color: black; }
  .panel { position: static; display: block; overflow: visible; }
  #main-content { overflow: visible; }
  .card { border: 1px solid #ccc; }
  .readout, .value, .numeric { color: #111; }
}

/* ── Scrollbar theme (applied globally) ─────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: #3a3f48 transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--c-trim);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--c-trim-bright); }

/* ── Focus styles (accessibility) ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-amber);
  outline-offset: 2px;
}
button:focus-visible {
  outline: 2px solid var(--c-amber);
  outline-offset: 2px;
}

/* ── Selection ───────────────────────────────────────────────────────────── */
::selection {
  background: rgba(255,171,0,0.25);
  color: var(--c-white);
}

/* ── Tooltip (native title attribute enhancement via CSS) ───────────────── */
[data-tooltip] { position: relative; }

/* ── Skip-to-content (screen reader) ────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  background: var(--c-amber);
  color: #000;
  padding: var(--sp-2) var(--sp-4);
  font-weight: 700;
  z-index: 9999;
}
.skip-link:focus {
  top: 4px;
  left: 4px;
}

/* ── Loading / initializing screen ─────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--c-panel-dark);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  transition: opacity 0.5s ease;
}
#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loading-plant-name {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--c-amber);
  text-shadow: 0 0 40px var(--c-amber-glow);
  text-transform: uppercase;
  text-align: center;
}
.loading-subtitle {
  font-family: var(--font-label);
  font-size: var(--fs-sm);
  color: var(--c-text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}
.loading-bar-track {
  width: 300px;
  height: 3px;
  background: var(--c-trim);
  border-radius: 2px;
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  background: var(--c-amber);
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--c-amber-glow);
}
.loading-status {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  letter-spacing: 0.05em;
  text-align: center;
  min-height: 20px;
}
.loading-dots::after {
  content: '';
  animation: loading-dots 1.2s steps(4, end) infinite;
}
@keyframes loading-dots {
  0%  { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}