/* ============================================================
   GymLog — hoja de estilos compartida
   Gimnasio nocturno · tiza fluorescente · hierro forjado
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root{
  --bg:        #16171c;
  --card:      #20222b;
  --card-2:    #262833;
  --line:      #343742;
  --line-soft: #34374270;
  --text:      #eceef2;
  --text-dim:  #9296a3;
  --text-faint:#5d6170;
  --lime:      #d6ff3f;
  --lime-dim:  #d6ff3f1a;
  --orange:    #ff6a3d;
  --orange-dim:#ff6a3d22;

  --display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', monospace;
  --radius: 12px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background:
    radial-gradient(circle at 10% -10%, #262a35 0%, transparent 42%),
    radial-gradient(circle at 100% 0%, #1d2d22 0%, transparent 38%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  line-height: 1.5;
  padding-bottom: 48px;
}

a{ color: var(--lime); text-decoration: none; }
a:hover{ text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
hr{ border: none; border-top: 1px solid var(--line); margin: 36px 18px; }
table{ border-collapse: collapse; }
b{ color: var(--text); }

/* ============ NAVBAR ============ */
.navbar{
  position: sticky; top: 0; z-index: 50;
  width: 100%;
  background: rgba(22,23,28,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.navbar td{ padding: 14px 18px; vertical-align: middle; white-space: nowrap; }
.brand{
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.5px;
  color: var(--lime);
}
.navbar a{
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.navbar a:hover{ color: var(--bg); background: var(--lime); text-decoration: none; }
.navbar .user{
  width: 100%; text-align: right;
  font-size: 13.5px; font-weight: 700; color: var(--text);
  letter-spacing: 0.3px;
}
.navbar .user::before{
  content: "●"; color: var(--lime); margin-right: 8px; font-size: 9px;
  vertical-align: middle;
}

/* ============ TITULARES DE SECCIÓN ============ */
.section-title{
  font-family: var(--display);
  font-size: 36px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  margin: 30px 18px 18px;
  padding-left: 16px;
  position: relative;
}
.section-title::before{
  content: "";
  position: absolute; left: 0; top: 5px; bottom: 8px; width: 5px;
  background: var(--lime); border-radius: 3px;
}

/* ============ LAYOUT 3 COLUMNAS (home) ============ */
.layout{ width: 100%; table-layout: fixed; }
.layout > tbody > tr > td{ vertical-align: top; padding: 0 14px 14px; width: 33.333%; }

/* ============ TARJETAS ============ */
.card{
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 8px 22px -14px rgba(0,0,0,0.7);
}
.card-title td{
  background: var(--card-2);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--lime);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.card-body td{ padding: 16px; color: var(--text); }
.card-body label{
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 4px;
}

/* mini tabla de datos dentro de tarjeta (progreso semanal) */
.mini-table{ width: 100%; }
.mini-table th{
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-faint); font-weight: 700;
  padding: 4px 8px 8px; border-bottom: 1px solid var(--line);
}
.mini-table td{
  font-family: var(--mono); font-size: 13.5px; color: var(--text-dim);
  padding: 6px 8px; border-bottom: 1px solid var(--line-soft);
}
.mini-table tr:last-child td{ border-bottom: none; }

/* ============ LISTA EJERCICIOS POPULARES ============ */
.tag-list a{
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; margin: 5px 0;
  background: #1a1c23;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono); font-size: 13px;
}
.tag-list a:hover{ border-color: var(--lime); color: var(--lime); text-decoration: none; }

/* ============ FORMULARIOS ============ */
form{ margin-top: 4px; }
input[type="text"], input[type="number"]{
  background: #1a1c23;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono); font-size: 14px;
  padding: 9px 10px; border-radius: 7px;
  width: 100%; max-width: 150px;
  margin: 2px 8px 2px 0;
}
input[type="text"]:focus, input[type="number"]:focus{ border-color: var(--lime); }
input[type="submit"]{
  background: var(--lime); color: #15171c;
  border: none; font-family: var(--body); font-weight: 800;
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 11px 20px; border-radius: 999px; cursor: pointer;
  margin-top: 10px;
  transition: transform .12s ease, background .15s ease;
}
input[type="submit"]:hover{ background: #e4ff70; transform: translateY(-1px); }
input[type="submit"]:active{ transform: translateY(0); }
.search-form{ display: flex; gap: 8px; margin-bottom: 4px; }
.search-form input[type="text"]{ max-width: none; flex: 1; margin: 0; }
.search-form input[type="submit"]{ margin: 0; white-space: nowrap; }
.set-row{ margin: 10px 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.set-row:first-of-type{ border-top: none; padding-top: 0; }

/* ============ CALENDARIO ============ */
.calendar{ width: 100%; }
.calendar caption, .calendar .cal-title td{
  background: var(--card-2);
  font-family: var(--display); font-size: 17px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--lime);
  text-align: center; padding: 12px;
}
.calendar .cal-head td{
  text-align: center; padding: 8px 2px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}
.calendar .cal-day{
  text-align: center; vertical-align: top;
  padding: 8px 4px; height: 52px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
  border: 1px solid var(--line-soft);
}
.calendar .cal-day.empty{ background: transparent; border-color: transparent; }
.calendar .cal-day a{ font-size: 15px; display: inline-block; margin-top: 2px; }
.calendar .cal-day.today{
  background: var(--lime-dim);
  border: 1px solid var(--lime);
  border-radius: 8px;
  color: var(--text);
}
.calendar .cal-day.today small{
  display: block; margin-top: 4px; line-height: 1.5;
  font-size: 10px; color: var(--text-dim); text-align: left;
}
.calendar .cal-day.today b{ color: var(--lime); font-size: 11px; }

/* ============ HISTORIAL / FEED DE ENTRENAMIENTOS ============ */
.feed-item{
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.feed-item:last-child{ border-bottom: none; }
.feed-icon{ font-size: 18px; line-height: 1; }
.feed-meta{ font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.feed-meta b{ display: block; font-family: var(--body); font-size: 14px; margin-bottom: 2px; }

/* ============ TABLA DE DATOS (Ejercicios) ============ */
.data-table{
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 18px 30px;
  width: calc(100% - 36px);
}
.data-table thead td{
  background: var(--card-2);
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--text-faint);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.data-table tbody td{
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.data-table tbody tr:last-child td{ border-bottom: none; }
.data-table tbody tr{ transition: background .12s ease; }
.data-table tbody tr:hover{ background: #1c1e26; }
.data-table .ex-name{ font-weight: 700; color: var(--text); }
.badge{
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-fuerza{ background: var(--orange-dim); color: var(--orange); }
.action-link{
  font-weight: 700; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.4px; border: 1px solid var(--lime); border-radius: 999px;
  padding: 5px 12px;
}
.action-link:hover{ background: var(--lime); color: var(--bg); }

/* ============ PERFIL ============ */
.profile-table{
  width: 100%;
}
.profile-table .profile-header td{
  background: var(--card-2);
  font-family: var(--display); font-size: 18px; letter-spacing: 0.6px;
  color: var(--lime); text-transform: uppercase; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.profile-table tr:not(.profile-header):not(.profile-form) td{
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.profile-table tr:not(.profile-header):not(.profile-form) td:first-child{
  color: var(--text-faint); font-weight: 700; width: 220px;
  text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.5px;
}
.profile-form td{ padding: 16px 18px; }

/* ============ FOOTER GLOBAL ============ */
.site-footer{ text-align: center; color: var(--text-faint); font-size: 13px; padding: 24px 18px; }
.site-footer a{ color: var(--text-dim); font-weight: 600; }
.site-footer a:hover{ color: var(--lime); }

.recipe-note{
  margin: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text-dim);
}
.recipe-note summary{ cursor: pointer; color: var(--lime); font-weight: 700; }
.recipe-note img{ max-width: 100%; border-radius: 8px; margin: 10px 0; }

/* ============ SCROLL HORIZONTAL PARA TABLAS ANCHAS ============ */
.table-scroll{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============ RESPONSIVE — TABLET (≤880px) ============ */
@media (max-width: 880px){
  .layout, .layout > tbody, .layout > tbody > tr{ display: block; width: 100%; }
  .layout > tbody > tr > td{ display: block; width: 100%; padding: 0 14px; }
  .navbar td{ padding: 10px 10px; }
  .navbar a{ padding: 6px 8px; font-size: 11.5px; }
  .section-title{ font-size: 28px; }
}

/* ============ RESPONSIVE — CELULAR (≤600px) ============ */
@media (max-width: 600px){

  body{ padding-bottom: 32px; }

  /* Navbar: pasa de fila de tabla a bloque que se envuelve */
  .navbar, .navbar tbody, .navbar tr{ display: flex; flex-wrap: wrap; width: 100%; }
  .navbar td{ padding: 8px 10px; white-space: normal; }
  .brand{ font-size: 21px; flex: 1 0 auto; }
  .navbar .user{
    width: 100%; text-align: left; order: 3;
    font-size: 12px; padding-top: 2px;
  }
  .navbar a{ font-size: 11px; padding: 6px 10px; }

  .section-title{ font-size: 24px; margin: 20px 12px 14px; padding-left: 12px; }
  .layout > tbody > tr > td{ padding: 0 10px; }

  /* Tarjetas y formularios más compactos */
  .card-title td{ font-size: 14px; padding: 10px 12px; }
  .card-body td{ padding: 12px; }

  .search-form{ flex-wrap: wrap; }
  .search-form input[type="text"]{ flex: 1 1 100%; }
  .search-form input[type="submit"]{ flex: 1 1 100%; }

  .set-row{ display: flex; flex-direction: column; gap: 6px; }
  .set-row input[type="number"]{ max-width: none; width: 100%; margin: 0; }
  .card-body input[type="text"]{ max-width: none; width: 100%; }

  .tag-list a{ font-size: 12px; padding: 8px 10px; }

  /* Calendario: se mantiene la grilla, pero con scroll horizontal si no entra */
  .calendar{ min-width: 460px; }
  .calendar .cal-day{ padding: 6px 2px; height: 44px; font-size: 11px; }
  .calendar .cal-day.today small{ font-size: 9px; }

  /* Tabla de ejercicios: scroll horizontal en vez de romper el diseño */
  .data-table{ min-width: 520px; margin: 0; width: 520px; }

  /* Perfil: la etiqueta deja de tener ancho fijo y pasa a ocupar todo el renglón */
  .profile-table tr:not(.profile-header):not(.profile-form) td:first-child{
    width: auto; display: block; font-size: 10.5px; padding-bottom: 2px;
  }
  .profile-table tr:not(.profile-header):not(.profile-form) td{ display: block; padding: 10px 14px 4px; }
  .profile-table tr:not(.profile-header):not(.profile-form) td + td{ padding-top: 0; padding-bottom: 12px; }

  input[type="submit"]{ width: 100%; }
}
