:root {
  --border: #d7d7d7;
  --bg: #f7f7f8;
  --panel-bg: #ffffff;
  --text-muted: #5a5a5a;
  --accent: #1f6feb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background: var(--bg);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.15rem;
}

/* Selector de idioma (en/es): boton compacto a la derecha del titulo. */
.lang-toggle {
  margin-left: auto;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: inherit;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.lang-toggle:hover {
  background: var(--border);
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Barra de pestañas vertical (equivalente a QTabWidget.TabPosition.West) */
.tab-strip {
  display: flex;
  flex-direction: column;
  width: 190px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--panel-bg);
  overflow-y: auto;
}

.tab-strip button {
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: #333;
}

.tab-strip button:hover {
  background: #eef3ff;
}

.tab-strip button.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.tab-panels {
  flex: 1;
  min-width: 0;
  overflow: auto;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
}

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

.app-footer {
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--panel-bg);
}

/* --- Layout de un experimento: parametros | comparacion | explicaciones */
.experiment {
  display: flex;
  height: 100%;
  min-height: 0;
}

.panel {
  padding: 10px;
  overflow-y: auto;
}

.panel-left {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.panel-center {
  flex: 2 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-right {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}

.experiment-title {
  margin: 4px 0 12px;
  font-size: 1.2rem;
}

.box {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0 0 12px;
  padding: 8px 10px 12px;
}

.box legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #444;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.row select {
  flex: 1;
}

.btn {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f0f0f0;
  cursor: pointer;
  font-size: 0.85rem;
  margin: 3px 0;
  display: inline-block;
  width: 100%;
}

.btn:hover {
  background: #e4e4e4;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #185fce;
}

.btn-export {
  margin-top: 4px;
}

.status-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 6px 0;
}

.param-row {
  margin-bottom: 10px;
}

.param-label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.param-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.param-controls input[type="range"] {
  flex: 3;
}

.param-controls input[type="number"] {
  flex: 1;
  min-width: 0;
  width: 70px;
}

.param-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 2em;
}

.center-hint {
  margin: 2px 0 0;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
}

.plot-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-bg);
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 220px;
}

.plot-panel-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.plot-panel-canvases {
  flex: 1;
  display: flex;
  gap: 8px;
  min-height: 0;
}

.plot-panel-canvas-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.tab-button {
  padding: 6px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  border-bottom: 2px solid transparent;
}

.tab-button.active {
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content h3 {
  font-size: 0.95rem;
  margin-top: 0;
}

.tab-content {
  font-size: 0.85rem;
  line-height: 1.4;
}

.tab-content ul {
  padding-left: 1.2em;
}
