/* ============================================================
   PadelOrganizer - Design System: Azul Deportivo
   ============================================================ */

:root {
  --bg:          #f0f4ff;
  --surface:     #ffffff;
  --text:        #1e293b;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  --pri:         #2563eb;
  --pri-dark:    #1d4ed8;
  --pri-light:   #dbeafe;
  --border:      #e2e8f0;
  --err:         #ef4444;
  --ok:          #10b981;
  --warn:        #f59e0b;
  --topbar-h:    56px;
  --bottomnav-h: 60px;
  --radius:      14px;
  --radius-sm:   8px;
  --pad:         16px;
  --shadow-xs:   0 1px 3px rgba(30,41,59,.06);
  --shadow-s:    0 2px 8px rgba(30,41,59,.09);
  --shadow-m:    0 4px 16px rgba(30,41,59,.12);
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg) !important;
  margin: 0 !important;
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--topbar-h);
  padding-bottom: 24px;
}

.has-bottom-nav { padding-bottom: var(--bottomnav-h); }

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
center { display: block; text-align: center; }
font { font-size: inherit; }

/* --- Topbar ----------------------------------------------- */
.topbar-nativa,
.top-bar {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: var(--topbar-h);
  background: var(--pri);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}

.topbar-titulo {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
}

.topbar-btn img { width: 20px; filter: brightness(0) invert(1); }

.top-bar a {
  color: rgba(255,255,255,.85);
  font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}

.top-bar img { filter: brightness(0) invert(1) !important; }
.top-bar a.nav-active { color: #fff !important; }
.top-bar a:not(.nav-active) { opacity: .65; }

/* --- Bottom Nav ------------------------------------------- */
.app-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; width: 100%;
  height: var(--bottomnav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(30,41,59,.08);
}

.nav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 25%;
  color: var(--text-3);
  font-size: 11px; font-weight: 600;
  text-decoration: none;
  gap: 3px;
  transition: color .15s;
}

.nav-item.active { color: var(--pri); }

.nav-item img {
  width: 22px; height: 22px;
  opacity: .4;
  transition: opacity .15s;
}

.nav-item.active img { opacity: 1; }

/* --- Content ---------------------------------------------- */
.content {
  padding: 16px var(--pad) 16px;
  background: var(--bg);
}

/* --- Cards ------------------------------------------------- */
.po-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-s);
}

/* --- Grid menu -------------------------------------------- */
.grid-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 0;
  max-width: 480px;
  margin: 0 auto 16px;
}

.btn-menu-cuadrado {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 12px 16px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-s);
  color: var(--text);
  font-weight: 600; font-size: 13px;
  border: 1px solid var(--border);
  transition: transform .15s;
  text-decoration: none;
  gap: 10px;
  cursor: pointer;
}

.btn-menu-cuadrado:active { transform: scale(.95); }
.btn-menu-cuadrado img { width: 42px; height: 42px; object-fit: contain; }

/* --- Login hero ------------------------------------------- */
.login-hero {
  text-align: center;
  padding: 20px 0 16px;
}

.login-hero img {
  max-width: 140px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: var(--shadow-s);
}

/* --- Login card ------------------------------------------- */
.card-login {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-m);
  display: flex; flex-direction: column;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}

.card-login-title {
  font-size: 18px; font-weight: 700;
  color: var(--text); text-align: center;
}

/* Segmented control */
.radio-group {
  display: flex;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.radio-group input { display: none; }

.radio-group label {
  flex: 1; text-align: center;
  padding: 10px; cursor: pointer;
  border-radius: 6px;
  font-size: 14px; font-weight: 600;
  color: var(--text-3);
  transition: all .2s;
}

.radio-group input:checked + label {
  background: var(--surface);
  color: var(--pri);
  box-shadow: var(--shadow-xs);
}

/* Inputs */
.input-app-nativa,
.input-app,
input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

.input-app-nativa:focus,
.input-app:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: var(--pri);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--surface);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Buttons */
.btn-login-nativa,
button[type="submit"],
input[type="submit"] {
  width: 100%;
  padding: 14px;
  background: var(--pri);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  letter-spacing: .2px;
  transition: background .15s, transform .1s;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.btn-login-nativa:active,
button[type="submit"]:active { background: var(--pri-dark); transform: scale(.98); }

button, input[type="button"] { font-family: 'Roboto', sans-serif; cursor: pointer; }

/* Links */
.links-login {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.links-login a { color: var(--pri); font-weight: 600; }

/* Error */
.error-message {
  background: #fef2f2;
  color: var(--err);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  border-left: 3px solid var(--err);
}

/* --- Profile card ----------------------------------------- */
.card-perfil {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-s);
  border: 1px solid var(--border);
  margin: 0 auto 16px;
  max-width: 480px;
}

.card-perfil img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pri); }
.card-perfil-info { display: flex; flex-direction: column; gap: 2px; }
.card-perfil-nombre { font-size: 15px; font-weight: 700; color: var(--text); }
.card-perfil-cat { font-size: 13px; font-weight: 500; color: var(--pri); }

/* --- Page header ------------------------------------------ */
.page-header { display: flex; align-items: center; gap: 10px; padding: 10px 0 14px; }

.btn-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--pri);
  background: var(--pri-light); border: none;
  border-radius: 8px; padding: 7px 12px;
  cursor: pointer; flex-shrink: 0; text-decoration: none;
}

.page-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin: 0; flex: 1; text-align: center;
  text-transform: uppercase; letter-spacing: .3px;
}

/* --- Legacy section header --------------------------------- */
.contenedor_redondeado {
  background: transparent !important;
  border: none !important;
  border-left: 3px solid var(--pri) !important;
  padding: 2px 0 2px 12px !important;
  margin: 0 0 14px 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  display: block !important;
}

.contenedor_redondeado center,
.contenedor_redondeado b,
.contenedor_redondeado font {
  color: var(--text) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

/* --- Fixture table ---------------------------------------- */
.fixture { width: 100%; border-collapse: collapse; font-size: 13px; }
.fixture td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.green-border { width: 4px; background: var(--ok);     padding: 0 !important; border: none !important; }
.gris-border  { width: 4px; background: var(--text-3); padding: 0 !important; border: none !important; }
.date-column  { width: 50px; text-align: center; font-weight: 700; }
.event-info   { vertical-align: middle; }
.image-column { width: 48px; text-align: center; }
.image-column img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; margin: 0 auto; }
.location     { color: var(--pri); font-weight: 600; font-size: 12px; }
.status       { color: var(--ok); font-weight: 600; }
.bottom-border { height: 1px; background: var(--border); }

/* --- Misc -------------------------------------------------- */
.menu_reserva { display: flex; flex-direction: row; gap: 8px; padding: 8px 0; }
.menu_reserva a { text-align: center; flex: 1; color: var(--text); font-size: 11px; font-weight: 600; text-decoration: none; }
.menu_reserva img { display: block; margin: 0 auto 4px; }
.menu_reserva span { display: block; }
#menuItems { display: none; }
.menu { z-index: 1000; }

/* --- Tabla zonas ------------------------------------------ */
.tabla-especifica table { width: 100%; border-collapse: collapse; }
.tabla-especifica th,
.tabla-especifica td { padding: 9px 10px; text-align: center; border: 1px solid var(--border); font-size: 13px; }
.tabla-especifica th { background: var(--bg); font-weight: 700; }
.tabla-especifica .columna-fija { width: 20px; }
.tabla-especifica .columna-fija-jugadores { width: 200px; text-align: left; }
.tabla-especifica .fila-gris { background: var(--border); height: 2px; padding: 0; }
.tabla-especifica .imagen-jugador { max-width: 22px; max-height: 22px; border-radius: 50%; }

/* ============================================================
   Temas / Themes
   Configurar en p_frases_constantes: nombre_variable = 'c_tema'
   Valores: azul (default) | verde | naranja | violeta | oscuro
   ============================================================ */

/* --- verde (canchas de polvo de ladrillo) --- */
html[data-theme="verde"] {
  --pri:              #059669;
  --pri-dark:         #047857;
  --pri-light:        #d1fae5;
  --bg:               #f0fdf4;
  --bs-primary-rgb:   5, 150, 105;
}

/* --- naranja (energía / dinamismo) --- */
html[data-theme="naranja"] {
  --pri:              #ea580c;
  --pri-dark:         #c2410c;
  --pri-light:        #ffedd5;
  --bg:               #fff7ed;
  --bs-primary-rgb:   234, 88, 12;
}

/* --- violeta (premium) --- */
html[data-theme="violeta"] {
  --pri:              #7c3aed;
  --pri-dark:         #6d28d9;
  --pri-light:        #ede9fe;
  --bg:               #faf5ff;
  --bs-primary-rgb:   124, 58, 237;
}

/* --- oscuro (dark mode) --- */
html[data-theme="oscuro"] {
  --bg:               #0f172a;
  --surface:          #1e293b;
  --text:             #f1f5f9;
  --text-2:           #cbd5e1;
  --text-3:           #64748b;
  --border:           #334155;
  --pri:              #3b82f6;
  --pri-dark:         #2563eb;
  --pri-light:        #1e3a5f;
  --pri-rgb:          59, 130, 246;
  --bs-primary-rgb:   59, 130, 246;
  --shadow-xs:        0 1px 3px rgba(0,0,0,.3);
  --shadow-s:         0 2px 8px rgba(0,0,0,.4);
  --shadow-m:         0 4px 16px rgba(0,0,0,.5);
  --bs-body-bg:       #0f172a;
  --bs-body-color:    #f1f5f9;
  --bs-border-color:  #334155;
}
