/* ============================================
   RANKINGS MODULE - ELEGANT DESIGN
   Estilo elegante inspirado en Balduneta MU
   ============================================ */

/* Variables específicas para rankings */
:root {
    --ranking-cyan: #00d4ff;
    --ranking-cyan-dark: #0099cc;
    --ranking-cyan-light: #5ce1ff;
}

/* Contenedor principal del ranking */
.rankings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header estilo missions.css */
.page-title {
    margin-bottom: 2rem;
    padding: 0;
}

.rankings-header-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(10, 10, 15, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.rankings-icon-container {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-radius: 50%;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.rankings-title-content {
    flex: 1;
}

.rankings-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rankings-subtitle {
    font-size: 1rem;
    color: #9e9e9e;
    margin: 0;
}

/* Menú de navegación de rankings */
.rankings-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--ranking-bg-card);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--ranking-border);
}

.rankings-menu a {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.rankings-menu a:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.rankings-menu a.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #ffffff;
    border-color: transparent;
}

/* Tabla de rankings - Estilo elegante Balduneta */
table.rankings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(10, 10, 15, 0.6);
    border: 1px solid #00d4ff !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 40px rgba(0, 212, 255, 0.15);
    overflow: hidden;
}

/* Header de la tabla */
table.rankings-table thead {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

table.rankings-table thead th {
    padding: 1rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #00d4ff;
    text-align: center;
    border: none;
}

table.rankings-table thead th:first-child {
    text-align: center;
    width: 80px;
}

table.rankings-table thead th:nth-child(2) {
    text-align: left;
}

/* Filas del cuerpo - Patrón moderno estilo Balduneta */
table.rankings-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
    background: transparent;
}

/* Patrón alternado muy sutil */
table.rankings-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

table.rankings-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

table.rankings-table tbody tr:last-child {
    border-bottom: none;
}

/* Celdas del cuerpo */
table.rankings-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border: none;
    color: #e0e0e0;
    font-size: 0.9rem;
}

table.rankings-table tbody td:first-child {
    text-align: center;
    width: 80px;
    font-weight: 600;
    color: #00d4ff;
}

table.rankings-table tbody td:nth-child(2) {
    text-align: left;
    font-weight: 600;
    color: #ffffff;
}

table.rankings-table tbody td:nth-child(3),
table.rankings-table tbody td:nth-child(4),
table.rankings-table tbody td:nth-child(5) {
    text-align: center;
    font-weight: 500;
    color: #9e9e9e;
}

table.rankings-table tbody td:nth-child(6) {
    text-align: center;
    font-weight: 500;
    color: #9e9e9e;
}

/* Avatar del personaje - Minimalista */
table.rankings-table .character-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
}

table.rankings-table .character-avatar:hover {
    border-color: rgba(0, 212, 255, 0.5);
}

table.rankings-table .character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge de ranking - Minimalista */
table.rankings-table .rank-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #ff8c00;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 140, 0, 0.5);
    z-index: 2;
}

/* Badges para TOP 3 - Colores sutiles */
table.rankings-table tbody tr:nth-child(1) .rank-badge {
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.5);
}

table.rankings-table tbody tr:nth-child(2) .rank-badge {
    color: #C0C0C0;
    border-color: rgba(192, 192, 192, 0.5);
}

table.rankings-table tbody tr:nth-child(3) .rank-badge {
    color: #CD7F32;
    border-color: rgba(205, 127, 50, 0.5);
}

/* Indicador de online */
table.rankings-table .online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff00;
    margin-left: 0.5rem;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    animation: pulse 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.4);
    }
}

/* Link del perfil del jugador */
table.rankings-table .player-profile-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
}

table.rankings-table .player-profile-link:hover {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
    transform: translateX(4px);
}

/* Guild logo y nombre */
table.rankings-table .guild-logo {
    vertical-align: middle;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Timestamp de actualización */
.rankings-update-time {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 0.5rem;
    color: #9e9e9e;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .rankings-container {
        padding: 1.5rem;
    }
    
    table.rankings-table thead th,
    table.rankings-table tbody td {
        padding: 1rem 1rem;
        font-size: 0.9rem;
    }
    
    .page-title span {
        font-size: 2.5rem;
    }
    
    .page-title span::before {
        left: -50px;
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .rankings-menu {
        flex-direction: column;
    }
    
    .rankings-menu a {
        text-align: center;
    }
    
    .page-title span {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .page-title span::before {
        position: relative;
        left: 0;
        display: block;
        margin-bottom: 0.5rem;
    }
    
    table.rankings-table {
        font-size: 0.85rem;
        border-spacing: 0 0.4rem;
    }
    
    table.rankings-table .character-avatar {
        width: 44px;
        height: 44px;
    }
    
    table.rankings-table tbody td {
        padding: 1rem 0.75rem;
    }
    
    table.rankings-table thead th:nth-child(4),
    table.rankings-table tbody td:nth-child(4) {
        display: none; /* Ocultar Master Level en móvil */
    }
}

@media (max-width: 480px) {
    .rankings-container {
        padding: 1rem;
    }
    
    .page-title span {
        font-size: 1.5rem;
    }
    
    table.rankings-table thead th:nth-child(5),
    table.rankings-table tbody td:nth-child(5),
    table.rankings-table thead th:nth-child(6),
    table.rankings-table tbody td:nth-child(6) {
        display: none; /* Ocultar Resets y Guild en móvil */
    }
    
    table.rankings-table .character-avatar {
        width: 40px;
        height: 40px;
    }
    
    table.rankings-table .rank-badge {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}
