/**
 * layout.css — Estructura de página: header, footer, sidenav, tabs, contenedores.
 *
 * ORIGEN v1: styleNew.css líneas 22–402.
 * PROBLEMAS corregidos:
 *   - display:left / display:right → valores inválidos sustituidos por display:flex
 *   - #3e5f8a → var(--color-brand)
 *   - .body2 height:100vh duplicado eliminado
 */

@import './tokens.css';

/* ── Estructura principal ──────────────────────────────────────────────────── */
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.body2 {
  flex-grow: 1;
  padding: 0;
  background-color: var(--color-bg);
  margin-top: 2px;
  width: 100%;
  overflow-y: auto;          /* antes: no overflow — añadido para consistencia */
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.header {
  background-color: var(--color-brand);
  color: var(--color-white);
  width: 100%;
  height: var(--header-height);
  padding: 10px;
  flex-shrink: 0;
  text-align: center;
  align-items: center;
  justify-content: space-around;
  font-size: var(--font-size-lg);
  z-index: var(--z-nav);
}

.header ul {
  list-style: none;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.header a {
  color: var(--color-white);
  text-decoration: none;
  justify-content: center;
  text-align: center;
  font-size: var(--font-size-lg);
}

.header li {
  flex: 1;
  text-align: center;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header li + li::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background-color: var(--color-surface);
}

li img {
  display: block;
  width: 80px;
  height: 30px;
  object-fit: scale-down;
  z-index: 100;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: var(--footer-height);
  padding: 12px;
  background-color: var(--color-brand);
  color: var(--color-white);
  flex-shrink: 0;
  text-align: center;
  align-items: center;
  justify-content: space-around;
  font-size: var(--font-size-lg);
  z-index: var(--z-nav);
}

.footer ul {
  list-style: none;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.footer a {
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--font-size-lg);
}

.footer li {
  flex: 1;
  text-align: center;
  justify-content: center;
  align-items: center;
  position: relative;
}

.footer li + li::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background-color: var(--color-surface);
}

/* ── Footer secundario (dentro de paneles) ─────────────────────────────────── */
.footer2 {
  position: relative;
  width: 100%;
  padding: 10px 0;
  background-color: var(--color-brand);
  color: var(--color-white);
  flex-shrink: 0;
  align-items: center;
}

.footer2 ul  { list-style: none; display: flex; justify-content: space-around; align-items: center; }
.footer2 a   { color: var(--color-white); text-decoration: none; text-align: center; }
.footer2 li  { flex: 1; text-align: center; justify-content: center; align-items: center; position: relative; }
.footer2 li + li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background-color: var(--color-surface);
}

/* ── Iconos Font Awesome en nav ────────────────────────────────────────────── */
.fa { font-size: var(--font-size-lg); transition: none; }

/* ── Botones de menú ───────────────────────────────────────────────────────── */
.menu-button {
  background: none; border: none;
  color: var(--color-white);
  font-size: 18px; cursor: pointer;
}
.menu-button:hover { color: #ddd; }

.menu-button2 {
  background: none; border: none;
  color: var(--color-white);
  font-size: var(--font-size-xl); cursor: pointer;
  padding: 5px; display: flex; align-items: center;
}
.menu-button2:hover { color: #ddd; }
.menu-button2 i { font-size: var(--font-size-xl); color: var(--color-white); }

.menu-button3 {
  background: none; border: none; margin-right: 25px;
  color: var(--color-white);
  font-size: var(--font-size-xl); cursor: pointer;
  padding: 5px; display: flex; align-items: center;
}
.menu-button3:hover { color: #ddd; }
.menu-button3 i { font-size: var(--font-size-xl); color: var(--color-white); }

/* ── Items de menú (header) ────────────────────────────────────────────────── */
/* CORRECCIÓN v1: display:left / display:right no son válidos */
.menu-item  { display: flex; align-items: center; gap: 10px; list-style: none; }
.menu-item2 { display: flex; align-items: center; gap: 10px; list-style: none; }
.menu-item3 { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; list-style: none; }

.menu-logo { height: 40px; }

/* ── Sidenav izquierdo ─────────────────────────────────────────────────────── */
.sidenav {
  width: var(--sidenav-width);
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: 10px;
  position: fixed;
  top: 0; left: calc(-1 * var(--sidenav-width));
  height: 100%;
  transition: var(--transition-nav);
  z-index: var(--z-sidenav);
  overflow-x: hidden;
}
.sidenav.open { left: 0; }

/* ── Sidenav derecho ───────────────────────────────────────────────────────── */
.sidenav22 {
  width: var(--sidenav-width);
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: 10px;
  position: fixed;
  top: 0; right: calc(-1 * var(--sidenav-width));
  height: 100%;
  transition: var(--transition-nav);
  z-index: var(--z-sidenav);
  overflow-x: hidden;
}
.sidenav22.open { right: 0; }

.close-sidenav {
  display: flex;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: none; padding: 0; cursor: pointer; margin: 4px; font-size: 16px;
}
.close-sidenav a   { padding: 20px 60px; }
.close-sidenav img { width: 40px; height: 40px; }

/* ── Items del sidenav ─────────────────────────────────────────────────────── */
.sidenav-item {
  display: flex; align-items: center; gap: 16px; cursor: pointer; padding: var(--space-md);
}
.sidenav-item i, .sidenav-item span { font-size: 16px; color: var(--color-text); }
.sidenav-item:hover { background-color: var(--color-surface); }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs-container {
  overflow-x: auto; display: flex; align-items: center;
  position: relative; margin-top: 0; min-height: 50px;
  -webkit-overflow-scrolling: touch;
}

.tabs-wrapper {
  overflow-x: auto; scroll-behavior: smooth;
  display: flex; flex: 1; white-space: nowrap;
}

.tabs {
  display: flex; justify-content: space-around;
  background-color: var(--color-bg); width: 100%;
}
.tabs li { flex: 1; text-align: center; }

.tab {
  min-width: 40px; min-height: 40px; width: 10%;
  padding: 0; text-align: center;
  background-color: var(--color-bg);
  border: none; margin-right: 2px; cursor: pointer;
}
.tab.active { background-color: var(--color-brand); color: var(--color-white); }

.tablinkup {
  background-color: ghostwhite; color: var(--color-brand);
  float: left; border: none; outline: none; cursor: pointer;
  padding: 10px; font-size: var(--font-size-md);
  width: 14.2%;
}
.tablinkup:hover { background-color: var(--color-brand); }

.tabcontent  { color: var(--color-white); display: none; padding: 2px; text-align: left; }
.tabcontent2 { color: var(--color-white); display: none; padding: 2px; text-align: left; }
.tabcontent:not(.hidden) { display: block; }

/* IDs de paneles de ejercicios */
#M0,#M1,#M2,#M3,#M4,#M5,#M6,#M7,#M8,#M9,#M10,#M11,#M12 { background-color: var(--color-white); }
#btnM9 { display: none; }

/* ── Iconos en tabs y sidenav ──────────────────────────────────────────────── */
.tab-icon  { margin-top: 5px; width: 40px; height: 30px; object-fit: scale-down; text-align: center; }
.tab-icon2 { margin-top: 0;   width: 40px; height: 30px; object-fit: scale-down; }

/* ── Contenedores de contenido ─────────────────────────────────────────────── */
.containerNew {
  width: 100%; height: 100vh;
  overflow-y: auto; padding: 0;
  background-color: var(--color-white);
}

.containerNew2 {
  width: 100%; height: 100vh;
  background-color: var(--color-white);
}

.rowNew {
  width: 100%; height: 75vh;
  overflow-y: auto; box-sizing: border-box;
  padding: 5px; background-color: var(--color-white);
  border: 1px solid var(--color-border);
}

.row {
  display: block; padding: 2px;
  border: none; margin-top: 1px;
  width: 100%; height: 100vh;
}

.colone { float: left; width: 100%; height: 100%; display: block; padding: 0 3px; }

/* ── Formulario de login ───────────────────────────────────────────────────── */
.login-container {
  margin: auto; background: var(--color-white);
  padding: 10px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  width: 95%; max-width: 400px; box-sizing: border-box; text-align: left;
}
.login-container h1        { margin: 0 0 20px; font-size: var(--font-size-2xl); text-align: center; color: #ccc; }
.login-container button    { width: 100%; padding: 10px; background-color: var(--color-brand); color: var(--color-white); border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--font-size-md); }
.login-container button:hover { background-color: var(--color-brand-dark); }
