/* ============================================================
   mundial.css  ·  Polla Mundialista FIFA 2026
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --verde:      #006633;
  --verde-dark: #004d25;
  --verde-med:  #007a3d;
  --dorado:     #FFD700;
  --dorado2:    #f59e0b;
  --bg:         #f0f4f0;
  --radius:     12px;
  --shadow:     0 4px 20px rgba(0,0,0,.1);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.18);
}

/* ── Reset / base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { background: var(--bg); font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(0,102,51,.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0,77,37,.3) 0%, transparent 50%),
    linear-gradient(135deg, #050e08 0%, #0a1a10 50%, #0d2018 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 430px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,102,51,.25);
  border: 1px solid rgba(255,255,255,.07);
}

.login-header {
  background: linear-gradient(135deg, var(--verde-dark) 0%, var(--verde-med) 100%);
  color: #fff;
  text-align: center;
  padding: 2.2rem 2rem 1.8rem;
  position: relative;
  overflow: hidden;
}
.login-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='28' fill='none' stroke='rgba(255,255,255,.05)' stroke-width='1'/%3E%3C/svg%3E") repeat;
}
.login-ball    { font-size: 3.2rem; display: block; margin-bottom: .4rem; line-height:1; }
.login-app     { font-size: 1.4rem; font-weight: 700; letter-spacing: .5px; margin-bottom: .2rem; }
.login-sub     { font-size: .82rem; opacity: .8; font-weight: 400; }
.login-stars   { color: var(--dorado); font-size: .75rem; letter-spacing: 4px; margin-top: .5rem; }

.login-body-card {
  background: #fff;
  padding: 2rem 2.2rem 2.4rem;
}
.login-body-card label { font-weight: 600; font-size: .9rem; color: #374151; margin-bottom: .3rem; }
.login-body-card .form-control {
  border-radius: 10px; border: 1.5px solid #d1d5db;
  padding: .7rem 1rem; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.login-body-card .form-control:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(0,102,51,.15);
}
.input-icon { position: relative; }
.input-icon i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #9ca3af; font-size: 1rem; pointer-events: none;
}
.input-icon .form-control { padding-left: 2.5rem; }

.btn-login {
  background: linear-gradient(135deg, var(--verde-dark), var(--verde-med));
  color: #fff; border: none; border-radius: 10px;
  padding: .75rem; font-size: 1rem; font-weight: 700;
  width: 100%; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  letter-spacing: .3px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,102,51,.4); }
.btn-login:active { transform: translateY(0); }

.login-footer {
  background: #f9fafb; border-top: 1px solid #f0f0f0;
  text-align: center; padding: .9rem;
  font-size: .78rem; color: #9ca3af;
}

/* ══════════════════════════════════════════════════════════
   NAVBAR PRINCIPAL
   ══════════════════════════════════════════════════════════ */
.main-nav {
  background: var(--verde-dark);
  padding: .6rem 1.5rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; color: #fff;
}
.nav-ball { font-size: 1.4rem; }
.nav-title { font-size: 1rem; font-weight: 700; color: #fff; }
.nav-year  { color: var(--dorado); font-size: .85em; }

.nav-user {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.nav-nombre { color: rgba(255,255,255,.9); font-size: .9rem; font-weight: 600; }

.btn-logout {
  display: flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  padding: .35rem .85rem; font-size: .85rem; font-weight: 600;
  text-decoration: none; transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── Módulos nav bar (bajo el main-nav) ─────────────────── */
.mod-nav {
  padding: .5rem 1.5rem;
  display: flex; align-items: center;
}
.mod-superadmin { background: #0d6efd; }
.mod-admin      { background: #198754; }
.mod-usuario    { background: #d97706; }

.mod-link {
  color: rgba(255,255,255,.85); text-decoration: none;
  font-size: .9rem; font-weight: 600; padding: .4rem .9rem;
  border-radius: 8px; transition: background .2s;
}
.mod-link:hover, .mod-link.active {
  background: rgba(255,255,255,.2); color: #fff;
}

/* ── Role badges ─────────────────────────────────────────── */
.role-badge {
  display: inline-flex; align-items: center;
  padding: .3rem .8rem; border-radius: 20px;
  font-size: .78rem; font-weight: 700; color: #fff;
}
.badge-superadmin { background: #1d4ed8; }
.badge-admin      { background: #166534; }
.badge-usuario    { background: #b45309; }

/* ══════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════════════════ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.8rem 1.2rem 3rem;
}

.page-header {
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0,102,51,.1);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.page-title {
  font-size: 1.5rem; font-weight: 800; color: var(--verde-dark);
  display: flex; align-items: center; gap: .6rem; margin: 0;
}
.page-title i { font-size: 1.4rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card-pm {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); border: none;
  overflow: hidden;
}
.card-pm-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700;
}
.card-pm-body { padding: 1.4rem; }

/* Stat cards */
.stat-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.green  { background: #dcfce7; color: var(--verde); }
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.amber  { background: #fef3c7; color: #b45309; }
.stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-num  { font-size: 1.8rem; font-weight: 800; line-height: 1; color: #111827; }
.stat-label{ font-size: .8rem; color: #6b7280; font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   TABLA PRONÓSTICOS
   ══════════════════════════════════════════════════════════ */
.tbl-pronosticos {
  width: 100%; border-collapse: collapse;
  font-size: .88rem;
}
.tbl-pronosticos thead th {
  background: var(--verde-dark); color: #fff;
  padding: .75rem 1rem; font-weight: 700;
  font-size: .8rem; text-transform: uppercase;
  letter-spacing: .5px; white-space: nowrap;
}
.tbl-pronosticos tbody tr { transition: background .15s; }
.tbl-pronosticos tbody tr:nth-child(even) { background: #f8faf8; }
.tbl-pronosticos tbody tr:hover { background: #e8f5e9; }
.tbl-pronosticos td { padding: .65rem 1rem; vertical-align: middle; border-bottom: 1px solid #f0f0f0; }

.team-cell { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.team-cell img { width: 32px; height: 23px; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.team-name { font-weight: 600; font-size: .85rem; color: #1f2937; }

.puesto-1 { background: linear-gradient(135deg,#ffd700,#f59e0b); color: #713f12; }
.puesto-2 { background: linear-gradient(135deg,#e2e8f0,#cbd5e1); color: #374151; }
.puesto-3 { background: linear-gradient(135deg,#fed7aa,#fdba74); color: #7c2d12; }
.puesto-4 { background: #f1f5f9; color: #475569; }
.puesto-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: .75rem; font-weight: 800; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   MÓDULO GESTIÓN USUARIOS
   ══════════════════════════════════════════════════════════ */
.user-table td, .user-table th { vertical-align: middle; }
.user-table .btn-sm { font-size: .78rem; padding: .25rem .6rem; border-radius: 6px; }

.user-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow .2s;
}
.user-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.14); }
.user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--verde); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; flex-shrink: 0;
}

.progress-usuarios {
  height: 10px; border-radius: 5px; overflow: hidden;
  background: #e5e7eb;
}
.progress-bar-usuarios {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--verde-dark), var(--verde-med));
  transition: width .5s ease;
}

/* ══════════════════════════════════════════════════════════
   MÓDULO POLLA (JUGAR / VER)
   ══════════════════════════════════════════════════════════ */
.polla-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.polla-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.polla-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.14); }

.polla-card-header {
  padding: 1rem 1.2rem .7rem;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}
.polla-medal { font-size: 2rem; display: block; margin-bottom: .2rem; }
.polla-puesto-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #6b7280; }
.polla-puesto-name  { font-size: 1rem; font-weight: 800; color: #111827; }

.polla-card-body { padding: 1.2rem; }

/* Select estilizado */
.polla-select { position: relative; }
.polla-select select {
  appearance: none; width: 100%;
  background: #f9fafb; border: 2px solid #e5e7eb;
  border-radius: 10px; padding: .6rem 2.2rem .6rem .9rem;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  color: #111827;
}
.polla-select select:focus {
  outline: none; border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(0,102,51,.15);
}
.polla-select::after {
  content: '▾'; position: absolute; right: 12px;
  top: 50%; transform: translateY(-50%);
  color: #9ca3af; pointer-events: none;
}

/* Card de pronóstico confirmado (solo ver) */
.pronostico-confirmado {
  background: linear-gradient(135deg, var(--verde-dark), var(--verde-med));
  color: #fff; border-radius: var(--radius);
  padding: 1.5rem; text-align: center; margin-bottom: 1.5rem;
}
.pronostico-confirmado h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: .3rem; }

.resultado-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.resultado-row {
  display: flex; align-items: center;
  padding: 1rem 1.5rem; gap: 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s;
}
.resultado-row:last-child { border-bottom: none; }
.resultado-row:hover { background: #f8faf8; }
.resultado-row .medal { font-size: 1.8rem; width: 40px; text-align: center; flex-shrink: 0; }
.resultado-row .flag-lg { width: 52px; height: 36px; border-radius: 5px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,.2); flex-shrink: 0; }
.resultado-row .team-info .puesto-txt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #9ca3af; }
.resultado-row .team-info .team-txt   { font-size: 1.05rem; font-weight: 800; color: #111827; }

.locked-banner {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
  padding: .9rem 1.2rem; display: flex; align-items: center; gap: .8rem;
  color: #dc2626; font-weight: 600; font-size: .9rem; margin-bottom: 1.5rem;
}

/* ══════════════════════════════════════════════════════════
   MÓDULO PRONÓSTICOS (SUPERADMIN)
   ══════════════════════════════════════════════════════════ */
.superadmin-pass-card {
  max-width: 400px; margin: 4rem auto;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.superadmin-pass-header {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff; padding: 1.5rem; text-align: center;
}

.print-header { display: none; }

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.main-footer {
  background: var(--verde-dark); color: rgba(255,255,255,.7);
  padding: 1rem 1.5rem; margin-top: 3rem;
  font-size: .82rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: .75rem;
}
.footer-sep { opacity: .4; }

/* ══════════════════════════════════════════════════════════
   ALERTAS / TOASTS
   ══════════════════════════════════════════════════════════ */
.alert-pm {
  border-radius: 10px; border: none;
  padding: .85rem 1.1rem; font-weight: 500; font-size: .9rem;
  display: flex; align-items: center; gap: .6rem;
}
.alert-pm.success { background: #dcfce7; color: #166534; }
.alert-pm.danger  { background: #fee2e2; color: #991b1b; }
.alert-pm.warning { background: #fef3c7; color: #92400e; }
.alert-pm.info    { background: #dbeafe; color: #1e40af; }

/* ══════════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════════ */
@media print {
  .no-print, nav, footer, .btn-logout, .mod-nav { display: none !important; }
  body { background: #fff !important; }
  .main-content { padding: 0 !important; max-width: 100% !important; }
  .print-header { display: block !important; text-align: center; margin-bottom: 1.5rem; }
  .tbl-pronosticos thead th { background: #006633 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card-pm { box-shadow: none !important; border: 1px solid #ccc !important; }
  @page { size: landscape; margin: 1.5cm; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .polla-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 1rem .8rem 2rem; }
  .stat-card { padding: 1rem; }
  .tbl-pronosticos { font-size: .78rem; }
  .tbl-pronosticos td, .tbl-pronosticos th { padding: .5rem .6rem; }
}
@media (max-width: 480px) {
  .polla-grid { grid-template-columns: 1fr; }
}
