/* beam-support-lab-styles.css — Beam Support Lab simulation
   Follows the SimpliPhys GCSE simulation layout pattern:
   centred max-width container, floating white panel cards on a tinted page.
*/

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --navy: #2c3e50;
  --teal: #1abc9c;
  --gold: #f1c40f;
  --coral: #e74c3c;
  --slate: #556366;
  --softgray: #e9ecef;
  --white: #ffffff;
  --gray-100: #f7fafc;
  --gray-200: #edf2f7;
  --gray-300: #e2e8f0;
  --max-width: 1120px;
  --radius: 10px;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--navy);
  background: linear-gradient(135deg, #ecf0f1 0%, #d6dbdf 100%);
  padding: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

/* ===== HEADER ===== */
.page-header {
  text-align: center;
  color: var(--navy);
  padding: 0.5rem 1rem;
}

.page-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--slate);
  font-size: 1rem;
  font-weight: 500;
}

/* ===== SIM AREA ===== */
.sim-area {
  background: var(--softgray);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.sim-area canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 440;
  display: block;
  border-radius: 6px;
  background: var(--white);
}

.sim-area.can-drag {
  cursor: grab;
}
.sim-area.dragging {
  cursor: grabbing;
}

/* ===== PANELS ===== */
.panel {
  background: var(--white);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.panel-note {
  margin: 0 0 14px;
  color: var(--slate);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ===== CONTROLS ===== */
.controls {
  padding: 16px 20px;
}

.control-group {
  margin-bottom: 4px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--slate);
  font-weight: 600;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range {
  flex: 1;
}

.value {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(26, 188, 156, 0.12);
  color: var(--teal);
  min-width: 64px;
  text-align: center;
  font-weight: 700;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  border-radius: 0.375rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  font-family: inherit;
}

.teal-btn {
  background-color: rgba(26, 188, 156, 0.8);
  color: white;
}
.teal-btn:hover {
  background-color: rgba(26, 188, 156, 0.7);
  transform: translateY(-2px);
}

.gold-btn {
  background-color: rgba(241, 196, 15, 1);
  color: var(--navy);
  opacity: 0.9;
}
.gold-btn:hover {
  background-color: rgba(241, 196, 15, 0.5);
  transform: translateY(-2px);
}

.coral-btn {
  background-color: rgba(231, 76, 60, 0.8);
  color: white;
}
.coral-btn:hover {
  background-color: rgba(231, 76, 60, 0.7);
  transform: translateY(-2px);
}

.navy-btn {
  background-color: rgba(44, 62, 80, 0.8);
  color: white;
}
.navy-btn:hover {
  background-color: rgba(44, 62, 80, 0.7);
  transform: translateY(-2px);
}

/* ===== RESULTS TABLE + GRAPH ===== */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--softgray);
}

.results-table th,
.results-table td {
  border: 1px solid var(--softgray);
  padding: 6px;
  text-align: left;
}

.results-table thead tr {
  background: var(--softgray);
}

.results-table th {
  font-weight: 700;
  font-size: 13px;
}

.results-table input {
  width: 100%;
  min-width: 80px;
  padding: 8px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
}

.results-table input:focus {
  outline: none;
  border-color: var(--teal);
}

.table-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.graph-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#graph {
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 380 / 300;
  background: var(--gray-100);
  border-radius: 8px;
  border: 1px solid var(--softgray);
}

.graph-key {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--slate);
  font-weight: 600;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.key-dot--teal {
  background: var(--teal);
}
.key-dot--gold {
  background: var(--gold);
}

/* ===== MOMENTS CHECK / TURNING EFFECTS ===== */
.moments-formula {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: var(--gray-100);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.moments-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px;
  margin-top: 4px;
}

.moments-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
}

.moment-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.moment-input {
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
}

.moment-input:focus {
  outline: none;
  border-color: var(--teal);
}

.field-status {
  font-size: 13px;
  font-weight: 700;
  min-height: 18px;
}

.field-status.ok {
  color: var(--teal);
}

.field-status.bad {
  color: var(--coral);
}

.moments-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.moments-feedback {
  margin: 14px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.6;
  min-height: 1.2em;
}

.moments-feedback.ok {
  color: var(--teal);
}

.moments-feedback.bad {
  color: var(--coral);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.pivot-buttons {
  display: flex;
  gap: 10px;
}

.pivot-btn {
  background: var(--white);
  color: var(--slate);
  border: 1px solid var(--gray-300);
}

.pivot-btn:hover {
  transform: translateY(-2px);
}

.pivot-btn.is-active {
  background-color: rgba(44, 62, 80, 0.9);
  color: var(--white);
  border-color: transparent;
}

/* ===== GUIDED INVESTIGATION / COLLAPSIBLES ===== */
.gi-outer {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gi-details {
  background: var(--white);
}

.gi-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 12px;
  background: var(--navy);
  color: #fff;
  transition: background 0.2s;
}

.gi-summary::-webkit-details-marker {
  display: none;
}
.gi-summary::marker {
  display: none;
}
.gi-summary:hover {
  background: #34495e;
}

.gi-summary-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.gi-summary-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.gi-details[open] .gi-summary-chevron {
  transform: rotate(180deg);
}

.gi-body {
  padding: 8px 28px 28px;
}

.gi-intro {
  margin: 20px 0 0;
  color: var(--slate);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 820px;
}

.gi-part {
  margin-top: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.gi-part--last {
  border-bottom: none;
  padding-bottom: 0;
}

.gi-part-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.gi-part-heading--teal {
  color: var(--teal);
}
.gi-part-heading--gold {
  color: #c49a00;
}
.gi-part-heading--navy {
  color: var(--navy);
}

.gi-list {
  margin: 0;
  padding-left: 20px;
  color: var(--navy);
  font-size: 0.88rem;
  line-height: 1.8;
}

.gi-list li {
  margin-bottom: 10px;
}

.gi-list li:last-child {
  margin-bottom: 0;
}

/* ===== DEV PANEL ===== */
.dev-panel {
  border: 2px dashed var(--gray-300);
}

.dev-output {
  margin: 14px 0 0;
  padding: 12px;
  background: var(--navy);
  color: #ecf0f1;
  border-radius: 8px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 360px;
  overflow: auto;
}

/* ===== RANGE INPUT STYLING ===== */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: transparent;
}

input[type='range']:focus {
  outline: none;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, #d0d0d0, #bdbdbd);
  border-radius: 6px;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  margin-top: -6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type='range']::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, #d0d0d0, #bdbdbd);
  border-radius: 6px;
}

input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  border: none;
}

a:focus,
button:focus,
input:focus {
  outline: 3px solid rgba(26, 188, 156, 0.18);
  outline-offset: 2px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  body {
    padding: 24px;
  }
  .container {
    padding: 0;
  }
  .page-title {
    font-size: 2.2rem;
  }
  .results-grid {
    flex-direction: row;
    align-items: flex-start;
  }
  .table-wrap {
    flex: 1.4;
  }
  .graph-wrap {
    flex: 1;
  }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  margin: 32px -16px -16px;
}

.site-footer p {
  margin: 0;
}
