/*******************************************************************************
 * *
 * 4. PÁGINA DE EQUIPOS                          *
 * *
 *******************************************************************************/

/* --- CABECERA --- */
.equipo-hero {
    position: relative;
    isolation: isolate;
    min-height: 500px;
    padding: 60px 5%;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 44%, #450a0a 100%);
}

.equipo-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.equipo-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 32%;
}

.equipo-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(69, 10, 10, 0.9) 0%, rgba(69, 10, 10, 0.72) 42%, rgba(69, 10, 10, 0.36) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.36));
}

.equipo-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    color: #fff;
    text-align: center;
}

.equipo-hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.equipo-hero h1 {
    margin: 18px 0 12px;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 0.95;
    text-wrap: balance;
}

.equipo-hero p {
    margin: 0 auto;
    max-width: 62ch;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.75;
}

.botones-categoria {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.boton-categoria {
    background: rgba(255, 255, 255, 0.12);
    color: white !important;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    transition: all 0.3s ease;
}

.boton-categoria.activo,
.boton-categoria:hover {
    background: #fff !important;
    border-color: #fff !important;
    color: #b91c1c !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

/* --- SECCIÓN EQUIPO Y REJILLA --- */
.equipo-jugadores {
    padding: 50px 40px;
    background: #f9f9f9;
    /* Un gris casi blanco para que las tarjetas resalten */
}

.pie-pagina {
    margin-top: 0;
}
.equipo-hero-jugador {
    min-height: 340px;
    padding: 56px 5%;
    align-items: center;
}

.equipo-hero-jugador .equipo-hero-content {
    max-width: 1120px;
}

.contenedor-paginacion {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    width: 100%;
}

.public-alert-ok {
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #e7f8ec;
    border: 1px solid #b6e2c5;
    color: #17603a;
    text-align: center;
    font-weight: 700;
}

.public-admin-actions {
    display: flex;
    justify-content: center;
    margin: 0 auto 28px;
}

.public-card-action {
    margin-top: 18px;
}

.public-hide-button {
    border: 1px solid #d97706;
    background: #fff;
    color: #b45309;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.public-hide-button:hover {
    background: #d97706;
    color: #fff;
    transform: translateY(-1px);
}

.equipo-resumen {
    max-width: 1180px;
    margin: 0 auto 28px;
    padding: 24px 26px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fff 0%, #fff8f6 100%);
    border: 1px solid #f2d5cd;
    box-shadow: 0 18px 40px rgba(127, 29, 29, 0.08);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) auto;
    gap: 22px;
    align-items: center;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.equipo-resumen:hover {
    transform: translateY(-8px);
    border-color: #ef4444;
    box-shadow: 0 24px 50px rgba(127, 29, 29, 0.16);
}

.equipo-resumen-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.equipo-titulo-categoria {
    margin: 0;
    width: 100%;
    text-transform: uppercase;
    color: #111827;
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
}

.equipo-resumen-copy p {
    margin: 12px 0 0;
    max-width: 52ch;
    color: #6b7280;
    line-height: 1.75;
    text-align: center;
}

.equipo-resumen-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.equipo-resumen-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}

.equipo-resumen-stat {
    min-width: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #f3d8d3;
    text-align: center;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.equipo-resumen-stat:hover {
    transform: translateY(-6px);
    border-color: #ef4444;
    box-shadow: 0 16px 32px rgba(127, 29, 29, 0.12);
}

.equipo-resumen-stat strong {
    display: block;
    color: #111827;
    font-size: 1.4rem;
}

.equipo-resumen-stat span {
    display: block;
    margin-top: 4px;
    color: #b91c1c;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rejilla-jugadores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1300px;
    margin: 0 auto;
}

/* --- LA TARJETA (EFECTO PRO) --- */
.tarjeta-jugador {
    background: linear-gradient(180deg, #ffffff 0%, #fff8f6 100%);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 16px 38px rgba(127, 29, 29, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f2d5cd;
    position: relative;
}

.tarjeta-jugador-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tarjeta-jugador::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
    z-index: 2;
}

.tarjeta-jugador:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 48px rgba(127, 29, 29, 0.16);
    border-color: #ef4444;
}

/* --- FOTO Y DORSAL --- */
.foto-jugador {
    height: 340px;
    background: #ececec;
    overflow: hidden;
    position: relative;
}

.foto-jugador::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.38) 100%);
    pointer-events: none;
}

.foto-jugador img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.tarjeta-jugador:hover .foto-jugador img {
    transform: scale(1.1);
}

.dorsal-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    min-width: 56px;
    min-height: 56px;
    padding: 0 10px;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.86);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
    z-index: 2;
}

.foto-defecto {
    object-fit: cover;
}

/* --- INFO JUGADOR --- */
.info-jugador {
    padding: 22px 22px 24px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.posicion-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.info-jugador h3 {
    margin: 14px 0 0;
    font-size: 1.45rem;
    color: #111827;
    font-weight: 800;
    line-height: 1.15;
}

/* Un pequeño separador elegante */
.separador {
    width: 36px;
    height: 3px;
    background: #e60000;
    margin: 15px auto;
    border-radius: 2px;
}

.fecha-nacimiento {
    margin: 0;
    color: #6b7280;
    line-height: 1.65;
}

.fecha-nacimiento strong {
    color: #111827;
}

/* --- MENSAJES DE ERROR --- */
.contenedor-mensaje-vacio {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    min-height: 350px;
    text-align: center;
    padding: 40px 0;
}

.alerta-basket {
    text-align: center;
    max-width: 500px;
}

.alerta-basket p {
    font-size: 1.3rem;
    color: #444;
    margin-bottom: 25px;
}

.boton-rojo-centrado {
    display: inline-block;
    padding: 14px 30px;
    background-color: #e60000;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.3s;
}

.boton-rojo-centrado:hover {
    background-color: #b30000;
}
.full-grid-column {
    grid-column: 1 / -1;
}

.jugador-detalle {
    padding: 56px 40px;
    background: #f9f9f9;
}

.jugador-layout {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.jugador-media-card,
.jugador-info-card,
.jugador-companeros {
    background: linear-gradient(180deg, #ffffff 0%, #fff8f6 100%);
    border: 1px solid #f2d5cd;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(127, 29, 29, 0.08);
}

.jugador-media-card {
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.jugador-media-card img {
    width: 100%;
    height: 100%;
    max-height: 560px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.jugador-media-card:hover {
    transform: translateY(-8px);
    border-color: #ef4444;
    box-shadow: 0 24px 48px rgba(127, 29, 29, 0.16);
}

.jugador-media-card:hover img {
    transform: scale(1.04);
}

.equipo-hero-content .boton-categoria {
    transition: transform 0.28s ease, box-shadow 0.28s ease, background-color 0.28s ease, border-color 0.28s ease, color 0.28s ease;
}

.equipo-hero-content .boton-categoria:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 18px 36px rgba(127, 29, 29, 0.24);
}

.jugador-info-stack {
    display: grid;
    gap: 24px;
}

.jugador-info-card {
    padding: 30px;
}

.jugador-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.jugador-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.jugador-header h2 {
    margin: 10px 0 0;
    color: #111827;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 0.98;
}

.jugador-dorsal-grande {
    min-width: 88px;
    min-height: 88px;
    border-radius: 26px;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.jugador-copy {
    color: #6b7280;
    line-height: 1.8;
    margin-bottom: 24px;
    max-width: 56ch;
}

.jugador-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.jugador-meta-item {
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #f3d8d3;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.jugador-meta-item:hover {
    transform: translateY(-6px);
    border-color: #ef4444;
    box-shadow: 0 16px 32px rgba(127, 29, 29, 0.12);
}

.jugador-meta-item span {
    display: block;
    margin-bottom: 8px;
    color: #b91c1c;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.jugador-meta-item strong {
    color: #111827;
    line-height: 1.45;
}

.jugador-companeros {
    padding: 24px;
}

.jugador-companeros h3 {
    margin-bottom: 6px;
    color: #111827;
    font-size: 1.4rem;
}

.jugador-companeros p {
    margin-bottom: 18px;
    color: #6b7280;
}

.jugador-companeros-grid {
    display: grid;
    gap: 12px;
}

.jugador-companero-link {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #f3d8d3;
    text-decoration: none;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.jugador-companero-link:hover {
    transform: translateY(-6px);
    border-color: #ef4444;
    box-shadow: 0 16px 32px rgba(127, 29, 29, 0.12);
}

.jugador-companero-link img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 14px;
}

.jugador-companero-link strong {
    display: block;
    color: #111827;
}

.jugador-companero-link span {
    color: #6b7280;
    font-size: 0.95rem;
}

.jugador-companero-link em {
    color: #b91c1c;
    font-style: normal;
    font-weight: 800;
}

/* =========================
   Modo oscuro SOLO Equipos
   ========================= */
html[data-theme="dark"] .equipo-hero {
    background: linear-gradient(135deg, #450a0a 0%, #111827 46%, #020617 100%);
}

html[data-theme="dark"] .equipo-hero-badge {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(248, 250, 252, 0.14);
    color: #fecaca;
}

html[data-theme="dark"] .equipo-hero p {
    color: #e2e8f0;
}

html[data-theme="dark"] .boton-categoria {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(248, 250, 252, 0.14);
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .boton-categoria.activo,
html[data-theme="dark"] .boton-categoria:hover {
    background: #f8fafc !important;
    border-color: #f8fafc !important;
    color: #991b1b !important;
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.55);
}

html[data-theme="dark"] .equipo-jugadores {
    background: #0b1120;
}

html[data-theme="dark"] .equipo-resumen {
    background: linear-gradient(180deg, #1e293b 0%, #111827 100%);
    border-color: #334155;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}

html[data-theme="dark"] .equipo-titulo-categoria {
    color: #f8fafc;
}

html[data-theme="dark"] .equipo-resumen-badge {
    background: rgba(185, 28, 28, 0.18);
    color: #fecaca;
}

html[data-theme="dark"] .equipo-resumen-copy p {
    color: #cbd5e1;
}

html[data-theme="dark"] .equipo-resumen-stat {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .equipo-resumen-stat strong {
    color: #f8fafc;
}

html[data-theme="dark"] .equipo-resumen-stat span {
    color: #fca5a5;
}

html[data-theme="dark"] .public-alert-ok {
    background: #052e1a;
    border-color: #166534;
    color: #bbf7d0;
}

html[data-theme="dark"] .public-hide-button {
    background: #111827;
    border-color: #f59e0b;
    color: #fbbf24;
}

html[data-theme="dark"] .public-hide-button:hover {
    background: #f59e0b;
    color: #111827;
}

html[data-theme="dark"] .tarjeta-jugador {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.55);
}

html[data-theme="dark"] .tarjeta-jugador:hover {
    border-color: #ef4444;
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.72);
}

html[data-theme="dark"] .foto-jugador {
    background: #0b1220;
}

html[data-theme="dark"] .dorsal-badge {
    background: rgba(2, 6, 23, 0.84);
    color: #f8fafc;
}

html[data-theme="dark"] .info-jugador h3 {
    color: #f8fafc;
}

html[data-theme="dark"] .posicion-tag {
    background: rgba(185, 28, 28, 0.18);
    color: #fecaca;
}

html[data-theme="dark"] .separador {
    background: #f87171;
}

html[data-theme="dark"] .fecha-nacimiento {
    color: #cbd5e1;
}

html[data-theme="dark"] .fecha-nacimiento strong {
    color: #f8fafc;
}

html[data-theme="dark"] .alerta-basket p {
    color: #cbd5e1;
}

html[data-theme="dark"] .jugador-detalle {
    background: #0b1120;
}

html[data-theme="dark"] .jugador-media-card,
html[data-theme="dark"] .jugador-info-card,
html[data-theme="dark"] .jugador-companeros {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}

html[data-theme="dark"] .jugador-kicker {
    background: rgba(185, 28, 28, 0.18);
    color: #fecaca;
}

html[data-theme="dark"] .jugador-header h2,
html[data-theme="dark"] .jugador-meta-item strong,
html[data-theme="dark"] .jugador-companeros h3,
html[data-theme="dark"] .jugador-companero-link strong {
    color: #f8fafc;
}

html[data-theme="dark"] .jugador-copy,
html[data-theme="dark"] .jugador-companeros p,
html[data-theme="dark"] .jugador-companero-link span {
    color: #cbd5e1;
}

html[data-theme="dark"] .jugador-dorsal-grande {
    background: #111827;
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.4);
}

html[data-theme="dark"] .jugador-meta-item,
html[data-theme="dark"] .jugador-companero-link {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .jugador-meta-item span,
html[data-theme="dark"] .jugador-companero-link em {
    color: #fca5a5;
}

html[data-theme="dark"] .contenedor-mensaje-vacio .alerta-basket strong {
    color: #f8fafc;
}

html[data-theme="dark"] .boton-rojo-centrado {
    background: #dc2626;
}

html[data-theme="dark"] .boton-rojo-centrado:hover {
    background: #ef4444;
}

html[data-theme="dark"] .equipo-jugadores .pagination .page-link {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #f8fafc;
}

html[data-theme="dark"] .equipo-jugadores .pagination .page-link:hover {
    background: #2563eb;
}

html[data-theme="dark"] .equipo-jugadores .pagination .disabled .page-link,
html[data-theme="dark"] .equipo-jugadores .pagination .page-item.disabled .page-link {
    background: #334155;
    color: #94a3b8;
}

@media (max-width: 992px) {
    .equipo-hero-jugador {
        min-height: 300px;
        padding: 48px 24px;
    }

    .equipo-hero {
        min-height: 420px;
        padding: 48px 24px;
    }

    .equipo-jugadores {
        padding-left: 24px;
        padding-right: 24px;
    }

    .equipo-resumen {
        grid-template-columns: 1fr;
    }

    .rejilla-jugadores {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .foto-jugador {
        height: 300px;
    }

    .jugador-layout {
        grid-template-columns: 1fr;
    }

    .jugador-media-card img {
        max-height: 520px;
    }

    .jugador-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .equipo-hero-jugador {
        min-height: 0;
        padding: 34px 18px;
    }

    .equipo-hero {
        min-height: 0;
        padding: 34px 18px;
    }

    .botones-categoria {
        gap: 10px;
    }

    .boton-categoria {
        padding: 10px 16px;
        font-size: 14px;
    }

    .equipo-jugadores {
        padding: 34px 18px;
    }

    .equipo-resumen {
        padding: 20px;
        margin-bottom: 24px;
    }

    .equipo-resumen-stats {
        grid-template-columns: 1fr 1fr;
    }

    .rejilla-jugadores {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tarjeta-jugador {
        max-width: 420px;
        margin: 0 auto;
    }

    .foto-jugador {
        height: 280px;
    }

    .info-jugador {
        padding: 18px;
    }

    .info-jugador h3 {
        font-size: 1.25rem;
    }

    .alerta-basket p {
        font-size: 1.05rem;
    }

    .jugador-detalle {
        padding: 36px 18px;
    }

    .jugador-info-card,
    .jugador-companeros {
        padding: 20px;
    }

    .jugador-header {
        flex-direction: column;
    }

    .jugador-dorsal-grande {
        min-width: 74px;
        min-height: 74px;
        border-radius: 22px;
    }

    .jugador-companero-link {
        grid-template-columns: 56px 1fr;
    }
}

@media (max-width: 576px) {
    .equipo-hero-jugador {
        padding: 28px 16px;
    }

    .equipo-hero {
        padding: 28px 16px;
    }

    .botones-categoria {
        justify-content: center;
    }

    .boton-categoria {
        width: auto;
        text-align: center;
    }

    .equipo-jugadores {
        padding: 28px 16px;
    }

    .equipo-resumen {
        padding: 18px;
    }

    .equipo-resumen-stats {
        grid-template-columns: 1fr;
    }

    .foto-jugador {
        height: 250px;
    }

    .info-jugador h3 {
        font-size: 1.15rem;
    }

    .fecha-nacimiento,
    .posicion-tag {
        font-size: 0.92rem;
    }

    .contenedor-mensaje-vacio {
        min-height: 240px;
        padding: 24px 0;
    }
}
