/* ============================================================
   Ciencia en el Cole — laboratorio.css (v5.0 Alta Legibilidad y Contraste 3D)
   Estilo del Laboratorio Virtual 3D (Menú a la Derecha + Toolbar 3D de Alto Contraste)
   ============================================================ */

.lab-page {
  background: var(--clr-bg, #f5f7ff);
  min-height: calc(100vh - var(--nav-h, 70px));
  color: var(--clr-text, #1e1b4b);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.lab-top {
  display: grid;
  grid-template-columns: 1fr 430px;
  height: calc(100vh - var(--nav-h, 70px));
  overflow: hidden;
}

/* ── BOTÓN GUÍA PEDAGÓGICA EN LA PARTE SUPERIOR DEL PANEL DERECHO ── */
.btn-lab-prof-guide {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: all 0.22s ease;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.btn-lab-prof-guide:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

/* ── VISOR CENTRAL 3D: MESA DE TRABAJO (IZQUIERDA) ── */
.lab-viewer {
  position: relative;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  display: flex; flex-direction: column;
  justify-content: space-between; padding: 16px;
  overflow: hidden; height: 100%;
}
.lab-viewer__header {
  display: flex; align-items: center; justify-content: space-between; z-index: 10;
}
.lab-badge {
  font-size: 11px; font-weight: 700; color: #38bdf8;
  background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 12px; border-radius: 20px; text-transform: uppercase;
}
.lab-viewer__title {
  font-size: 16px; font-weight: 800; color: #ffffff;
}

#lab3DCanvasContainer {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2;
}

/* ── BARRA DE HERRAMIENTAS 3D FLOTANTE (ESQUINA SUPERIOR DERECHA DEL VISOR) ── */
.viewer-toolbar-3d {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 8px; background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(14px); border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  padding: 6px 10px; border-radius: 14px; z-index: 50 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.tool-btn-3d {
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: rgba(30, 41, 59, 0.95) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  font-size: 13px !important; font-weight: 700 !important;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s ease; position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tool-btn-3d:hover {
  background: #0284c7 !important; color: #ffffff !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.tool-btn-3d--active {
  background: #0284c7 !important; color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.8) !important;
}

.tool-tooltip {
  display: inline-block !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  margin-left: 4px !important;
}

.toolbar-separator {
  width: 1px; height: 24px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 4px; align-self: center;
}

/* ── CAJA DE CONSEJO Y GUÍA DE EXPLORACIÓN (ESQUINA INFERIOR IZQUIERDA) ── */
.tip-note-box {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  padding: 10px 16px; border-radius: 12px;
  font-size: 12px; color: #f8fafc !important; z-index: 30 !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.tip-note-box strong {
  color: #38bdf8 !important;
  display: block; margin-bottom: 2px; font-weight: 800;
}

/* ── COLUMNA DERECHA: ESTANTE DE REACTIVOS, MONITOR Y PRÁCTICAS ── */
.lab-sidebar-right {
  background: var(--clr-card, #ffffff);
  border-left: 1px solid var(--clr-border, #e0e7ff);
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 18px 20px; gap: 14px;
}

.lab-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; flex-shrink: 0;
}
.lab-sidebar-title {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--clr-muted, #8b8fc9);
}
.lab-sidebar-count {
  font-size: 11px; font-weight: 700; color: var(--clr-purple, #6c63ff);
  background: var(--clr-purple-lt, #eef2ff); padding: 2px 8px; border-radius: 20px;
}

.reagent-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}

.reagent-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  background: #ffffff; border: 1.5px solid #e2e8f0;
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.reagent-card:hover {
  background: #f8fafc; border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.12);
}
.reagent-card--active {
  background: #eff6ff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.25) !important;
}
.reagent-icon {
  font-size: 18px; width: 28px; height: 28px; border-radius: 6px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.reagent-name {
  font-size: 11px; font-weight: 700; color: #0f172a; line-height: 1.2;
}
.reagent-formula {
  font-size: 9.5px; color: #0284c7; font-weight: 600; font-family: monospace;
}

.lab-instrument-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px;
}
.instrument-box {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 8px 6px; text-align: center;
}
.inst-label {
  font-size: 9px; font-weight: 800; color: #64748b; letter-spacing: 0.5px;
}
.inst-val {
  font-size: 14px; font-weight: 800; color: #0284c7; margin: 3px 0 1px 0; font-family: monospace;
}
.inst-sub {
  font-size: 9.5px; color: #475569; font-weight: 600;
}

.lab-formula-box {
  background: #0f172a; color: #38bdf8; padding: 10px 12px; border-radius: 10px;
  font-family: monospace; font-size: 11.5px; font-weight: 700; text-align: center;
  border: 1px solid rgba(56, 189, 248, 0.3); min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}

.lab-practice-list {
  display: flex; flex-direction: column; gap: 6px; margin-top: 6px;
}
.lab-practice-btn {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  background: #ffffff; border: 1.5px solid #e2e8f0; font-size: 11.5px;
  font-weight: 700; color: #1e293b; cursor: pointer; transition: all 0.2s ease;
}
.lab-practice-btn:hover {
  background: #eff6ff; border-color: #0284c7; color: #0284c7;
}
.lab-practice-btn--active {
  background: #eff6ff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18) !important;
}

/* ── MODAL PEDAGÓGICO DE INFORMACIÓN PARA PROFESORES ── */
.lab-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(8px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: all 0.25s ease;
}
.lab-modal-overlay--active {
  opacity: 1; pointer-events: auto;
}
.lab-modal-card {
  background: #ffffff; border-radius: 20px; width: 90%; max-width: 680px;
  max-height: 85vh; overflow-y: auto; padding: 26px 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3); border: 1px solid #e2e8f0;
}
.lab-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #e0e7ff;
}
.lab-modal-title {
  font-size: 17px; font-weight: 800; color: #0f172a;
}
.lab-modal-close {
  background: #f1f5f9; border: none; font-size: 22px; color: #64748b;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.lab-modal-close:hover {
  background: #ef4444; color: #ffffff;
}

.modal-intro {
  font-size: 13.5px; color: #334155; line-height: 1.6; margin-bottom: 18px; font-weight: 500;
}
.modal-section {
  margin-bottom: 16px; background: #f8fafc; padding: 14px 16px; border-radius: 12px;
  border-left: 4px solid #0284c7;
}
.modal-section h3 {
  font-size: 14px; font-weight: 800; color: #0f172a; margin-bottom: 6px;
}
.modal-section p {
  font-size: 12.5px; color: #475569; line-height: 1.55; margin: 0;
}

@media (max-width: 900px) {
  .lab-top {
    grid-template-columns: 1fr; grid-template-rows: 55vh auto;
    height: auto; overflow: visible;
  }
}
