/* =========================================================
   ESTILOS ESPECÍFICOS PARA /ranking/index.php
   (Complementa a /assets/css/landing.css)
   ========================================================= */

.ranking-section {
    justify-content: flex-start !important;
}

.ranking-wrapper {
    width: 92%;
    max-width: 1200px;
    z-index: 2;
    margin: 1.5rem auto 3rem auto;
}

.ranking-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ranking-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--accent-elyos);
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(230, 198, 135, 0.3);
    margin-bottom: 0.5rem;
}

.ranking-header p {
    color: var(--text-silver);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Barra superior de filtros y búsqueda */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.4rem;
    background: rgba(51, 70, 84, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-silver);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.filter-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.filter-btn.active {
    background: linear-gradient(180deg, #25497b 0%, #162e54 100%);
    color: var(--accent-elyos);
    border-color: var(--accent-elyos);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.6rem 1rem;
    background: rgba(22, 30, 38, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    min-width: 210px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-elyos);
    box-shadow: 0 0 8px rgba(230, 198, 135, 0.2);
}

.search-submit {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(180deg, #25497b 0%, #162e54 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.search-submit:hover {
    border-color: var(--accent-elyos);
}

.search-clear {
    padding: 0.6rem 0.9rem;
}

/* Contenedor y Tabla del Ranking */
.ranking-card {
    background: rgba(35, 44, 51, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow-x: auto;
    transition: opacity 0.25s ease;
}

.ranking-card.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.ranking-table thead tr {
    background: rgba(22, 46, 84, 0.45);
    border-bottom: 1px solid rgba(230, 198, 135, 0.25);
}

.ranking-table th {
    padding: 1rem 1.1rem;
    font-family: 'Cinzel', serif;
    color: var(--accent-elyos);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.ranking-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.ranking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ranking-table td {
    padding: 0.9rem 1.1rem;
    color: var(--text-silver);
    white-space: nowrap;
}

/* Badges de posición Top 3 */
.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-silver);
}

.pos-1 {
    background: rgba(230, 198, 135, 0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
}

.pos-2 {
    background: rgba(209, 213, 219, 0.2);
    color: #e5e7eb;
    border: 1px solid #c0c0c0;
}

.pos-3 {
    background: rgba(205, 127, 50, 0.2);
    color: #f59e0b;
    border: 1px solid #cd7f32;
}

/* Etiquetas de Facción */
.faction-tag {
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.faction-elyos {
    background: rgba(230, 198, 135, 0.12);
    color: var(--accent-elyos);
    border: 1px solid rgba(230, 198, 135, 0.35);
}

.faction-asmo {
    background: rgba(156, 108, 167, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(156, 108, 167, 0.45);
}

/* Nivel, Rango y Puntos */
.lvl-pill {
    font-family: monospace;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-title {
    color: var(--accent-elyos);
    font-weight: 500;
}

.gp-val {
    color: #93c5fd;
    font-family: monospace;
    font-weight: 600;
}

.ap-val {
    font-family: monospace;
    color: var(--text-white);
}

.kills-val {
    font-family: monospace;
}

/* Indicador Online / Offline */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online {
    background-color: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.status-dot.offline {
    background-color: #6b7280;
}

/* Caja de Error */
.ranking-error-box {
    background: rgba(139, 38, 62, 0.35);
    border: 1px solid #ff8585;
    color: #ffd6d6;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

/* Paginación */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.55rem 0.95rem;
    background: rgba(51, 70, 84, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-silver);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.page-link:hover:not(.disabled) {
    background: rgba(37, 73, 123, 0.7);
    color: #fff;
    border-color: var(--accent-elyos);
}

.page-link.active {
    background: linear-gradient(180deg, #25497b 0%, #162e54 100%);
    color: var(--accent-elyos);
    border-color: var(--accent-elyos);
    font-weight: 600;
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Adaptación Responsiva */
@media (max-width: 768px) {
    .ranking-header h1 {
        font-size: 1.9rem;
    }
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    .search-form {
        width: 100%;
    }
    .search-input {
        flex-grow: 1;
        min-width: 0;
    }
}