/* =============================================================
   jugadores.css  —  Mobile-first
   Breakpoints: 480 | 640 | 768 | 992 | 1200
   Paleta: --primary:#094c79  --secondary:#0b1138  --accent:#ffd700
   ============================================================= */

/* =============================================================
   1. CONTENEDOR PRINCIPAL
   ============================================================= */
.jugadores-container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

@media (min-width: 640px)  { .jugadores-container { padding: 0 1.5rem; } }
@media (min-width: 1200px) { .jugadores-container { margin: 2.5rem auto; } }

/* =============================================================
   2. TÍTULO
   ============================================================= */
.titulo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.titulo-container h1 {
    color: #fff;
    font-size: clamp(1.5rem, 5vw, 2.4rem);
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.subtitle {
    color: rgba(255,255,255,0.6);
    font-size: clamp(0.82rem, 2.5vw, 1rem);
    margin: 0;
}

/* =============================================================
   3. BÚSQUEDA
   ============================================================= */
.jugadores-filter-form {
    margin: 1.25rem 0 1.75rem;
}

.search-container {
    position: relative;
    max-width: 580px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1.25rem;
    border-radius: 30px;
    border: 2px solid #094c79;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.93);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.15);
}

.search-button {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.15rem;
    color: #094c79;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* =============================================================
   4. GRID DE TARJETAS
   ============================================================= */
.jugadores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin: 0 0 1.5rem;
}

@media (min-width: 640px)  { .jugadores-grid { gap: 0.9rem; } }
@media (min-width: 768px)  { .jugadores-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 992px)  { .jugadores-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .jugadores-grid { grid-template-columns: repeat(5, 1fr); gap: 1.2rem; } }

/* =============================================================
   5. TARJETA DE JUGADOR
   ============================================================= */
.jugador-card {
    background: #fff;
    border-radius: 12px;
    padding: 0.8rem 0.7rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border: 1px solid #eef2f7;
}

.jugador-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(9,76,121,0.14);
    border-color: #c7dff0;
}

@media (min-width: 992px) { .jugador-card { padding: 1rem 0.9rem; } }

/* Avatar + info */
.avatar-container {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.team-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #f0f4f8;
}

@media (min-width: 992px) { .team-logo { width: 46px; height: 46px; } }

.jugador-info { min-width: 0; }

.jugador-info h3 {
    color: #094c79;
    margin: 0 0 0.15rem;
    font-size: clamp(0.7rem, 2.1vw, 0.92rem);
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jugador-info .equipo {
    color: #666;
    font-size: clamp(0.62rem, 1.7vw, 0.8rem);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges */
.badges-container {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.status-badge,
.badge {
    display: inline-block;
    padding: 0.16rem 0.5rem;
    border-radius: 20px;
    font-size: clamp(0.58rem, 1.6vw, 0.72rem);
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.status-badge.activo     { background: #dcfce7; color: #166534; }
.status-badge.suspendido { background: #fee2e2; color: #991b1b; }
.badge.serie             { background: #e0f2fe; color: #0369a1; }

/* =============================================================
   6. SIN RESULTADOS
   ============================================================= */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.65);
}

.no-results i    { font-size: 3rem; display: block; margin-bottom: 1rem; }
.no-results h3   { margin: 0; font-size: 1.1rem; }

/* =============================================================
   7. PAGINACIÓN
   ============================================================= */
.pagination-container {
    margin: 1.5rem 0 2rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-pagination {
    background: #094c79;
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s, transform 0.15s;
}

.btn-pagination:hover {
    background: #063860;
    transform: translateY(-2px);
}

.current-page {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 0.88rem;
}

/* =============================================================
   8. MODAL
   ============================================================= */
.modal {
    display: flex !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.active { opacity: 1; visibility: visible; }

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 520px;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 1.5rem 1.25rem 1.75rem;
    border-radius: 16px;
    position: relative;
    animation: modalIn 0.28s cubic-bezier(0.25,0.46,0.45,0.94) both;
}

@media (min-width: 640px) {
    .modal-content { padding: 2rem; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal.closing .modal-content {
    animation: modalOut 0.22s ease both;
}

@keyframes modalOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}

/* Cerrar */
.close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    color: #555;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.close:hover { background: #094c79; color: #fff; }

/* Header modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 0.65rem;
    margin-bottom: 0.25rem;
    padding-right: 1.5rem;
}

.modal-avatar {
    width: 72px;
    height: 72px;
    background: #094c79;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    flex-shrink: 0;
}

.modal-avatar.female { background: #e83e8c; }

.modal-avatar.female i { position: relative; }

.modal-avatar.female i::after {
    content: '';
    position: absolute;
    bottom: -0.2rem;
    right: -0.2rem;
    width: 0.75rem;
    height: 0.75rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #e83e8c;
}

.modal-titles h2 {
    color: #094c79;
    margin: 0 0 0.3rem;
    font-size: clamp(1rem, 3vw, 1.25rem);
    line-height: 1.25;
}

.equipo-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.4rem;
}

.equipo-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.equipo-nombre {
    margin: 0;
    color: #444;
    font-size: 0.88rem;
    font-weight: 600;
}

/* serie-nombre mantiene el inline style del template (color:#094c79;font-weight:bold) */

.equipo-logo-modal {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background: #f0f4f8;
    padding: 3px;
    border: 1px solid #e4eaef;
    flex-shrink: 0;
}

/* Body modal */
.modal-body { color: #444; }

.info-section {
    margin: 0.9rem 0;
    padding: 0.9rem 0;
    border-top: 1px solid #eef2f7;
}

.section-title {
    color: #094c79;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.info-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #094c79;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* =============================================================
   9. ESTADÍSTICAS EN MODAL
   ============================================================= */
.stats-container { display: grid; gap: 0.6rem; }

.stat-item {
    background: #f8fafc;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #eef2f7;
}

.stat-campeonato {
    font-weight: 700;
    font-size: 0.8rem;
    color: #094c79;
    margin-bottom: 0.55rem;
}

.stat-values {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
}

.stat-value {
    text-align: center;
    background: #fff;
    border-radius: 6px;
    padding: 0.35rem 0.2rem;
    border: 1px solid #e4eaef;
}

.stat-value span:first-child {
    display: block;
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.2rem;
}

.stat-value span:last-child {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0b1138;
}

.no-stats {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 0.75rem 0;
}
