/* ============================================
   1. ESTRUCTURA Y COMPONENTES
   ============================================ */
.content-wrapper {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.card {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

/* ============================================
   2. PESTAÑAS Y FILTROS (NAV-PILLS)
   ============================================ */
#ranking-tabs .btn {
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

#ranking-tabs .btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35) !important;
}

#ranking-tabs .btn:not(.active):hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* ============================================
   3. TABLAS UNIFICADAS Y ANIMACIONES
   ============================================ */
@keyframes fadeInUpRow {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-custom,
.table-light-custom {
    margin-bottom: 0;
    vertical-align: middle;
}

.table-custom th,
.table-light-custom th {
    background-color: #ffffff;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.table-custom td,
.table-light-custom td {
    padding: 0.85rem 0.75rem;
    color: #334155;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

/* Animación Escalonada en Filas */
.table-custom tbody tr,
.table-light-custom tbody tr {
    opacity: 0;
    animation: fadeInUpRow 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

.table-custom tbody tr:nth-child(1),  .table-light-custom tbody tr:nth-child(1)  { animation-delay: 0.03s; }
.table-custom tbody tr:nth-child(2),  .table-light-custom tbody tr:nth-child(2)  { animation-delay: 0.06s; }
.table-custom tbody tr:nth-child(3),  .table-light-custom tbody tr:nth-child(3)  { animation-delay: 0.09s; }
.table-custom tbody tr:nth-child(4),  .table-light-custom tbody tr:nth-child(4)  { animation-delay: 0.12s; }
.table-custom tbody tr:nth-child(5),  .table-light-custom tbody tr:nth-child(5)  { animation-delay: 0.15s; }
.table-custom tbody tr:nth-child(6),  .table-light-custom tbody tr:nth-child(6)  { animation-delay: 0.18s; }
.table-custom tbody tr:nth-child(7),  .table-light-custom tbody tr:nth-child(7)  { animation-delay: 0.21s; }
.table-custom tbody tr:nth-child(8),  .table-light-custom tbody tr:nth-child(8)  { animation-delay: 0.24s; }
.table-custom tbody tr:nth-child(9),  .table-light-custom tbody tr:nth-child(9)  { animation-delay: 0.27s; }
.table-custom tbody tr:nth-child(10), .table-light-custom tbody tr:nth-child(10) { animation-delay: 0.30s; }
.table-custom tbody tr:nth-child(n+11), .table-light-custom tbody tr:nth-child(n+11) { animation-delay: 0.33s; }

.table-custom tbody tr:hover td,
.table-light-custom tbody tr:hover td {
    background-color: rgba(245, 158, 11, 0.04) !important;
}

/* Indicadores Online/Offline en Tablas */
.status-indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.status-indicator.offline {
    background-color: #94a3b8;
}

/* ============================================
   4. INSIGNIAS Y BADGES
   ============================================ */
/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
    color: #1e293b;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    color: #0f172a;
    box-shadow: 0 3px 10px rgba(148, 163, 184, 0.3);
}

.rank-3 {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(180, 83, 9, 0.3);
}

.rank-default {
    background: #f1f5f9;
    color: #64748b;
}

/* Badges Unificados (Clase, VIP, Gens, Estado) */
.class-badge,
.status-badge,
.vip-badge,
.gens-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.class-badge   { background: #f1f5f9; color: #475569; }
.status-online { background: #dcfce7; color: #15803d; }
.status-offline { background: #f1f5f9; color: #64748b; }

/* VIP Badges */
.vip-badge-0 { background-color: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.vip-badge-1 { background-color: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.vip-badge-2 { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.vip-badge-3 { background-color: #fef08a; color: #854d0e; border: 1px solid #fde047; font-weight: bold; }

/* Gens Badges */
.gens-duprian { background: #fee2e2; color: #991b1b; }
.gens-vanert  { background: #dbeafe; color: #1e40af; }

/* ============================================
   5. ENLACES Y ELEMENTOS VISUALES
   ============================================ */
.char-link,
.guild-link {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.char-link:hover,
.guild-link:hover {
    color: #d97706;
}

.guild-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
    background: #ffffff;
}

.bg-light-soft {
    background-color: #f8fafc !important;
}

.fs-7 { font-size: 0.85rem !important; }
.fs-8 { font-size: 0.725rem !important; }

/* ============================================
   6. MODAL DE DETALLE DE PERSONAJE
   ============================================ */
#char-detail-content {
    animation: fadeInUpRow 0.3s ease;
}

/* Tarjetas e Información */
.info-pill-card {
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.info-pill-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03) !important;
}

.metric-box {
    border: 1px solid #f1f5f9;
    background-color: #f8fafc;
}

.character-avatar img {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

#modal-online-indicator {
    width: 14px;
    height: 14px;
}

#modal-online-indicator.online { background-color: #10b981 !important; }
#modal-online-indicator.offline { background-color: #94a3b8 !important; }

/* Grilla de Atributos */
.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 0.5rem;
}

.stat-compact-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.stat-compact-item .stat-label {
    font-size: 0.68rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-compact-item .stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

/* Visor de Equipamiento */
#equipment-content {
    min-height: 220px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
}

/* ============================================
   7. RESPONSIVE / ADAPTATIVO (MÓVILES)
   ============================================ */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #ranking-tabs {
        justify-content: flex-start !important;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .table-custom th,
    .table-light-custom th {
        font-size: 0.7rem;
        padding: 0.75rem 0.5rem;
    }

    .table-custom td,
    .table-light-custom td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }

    .rank-badge {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .class-badge,
    .status-badge,
    .vip-badge,
    .gens-badge {
        font-size: 0.68rem;
        padding: 0.2rem 0.45rem;
    }

    #characterDetailModal .modal-dialog {
        margin: 0.35rem;
    }
    
    .stats-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Ajuste de contenedor para eliminar espacio muerto */
#equipment-section, 
#equipment-content {
    background: transparent;
    border: none;
    padding: 0;
}

/* Centrar componente del inventario y ajustar su contenedor */
.mu-inventory-container {
    margin: 0 auto;
    max-width: 360px; /* Ancho real del render del inventario MU */
    width: 100%;
}
/* ============================================
   INSIGNIAS Y FILAS DE PRIVACIDAD (INCÓGNITO)
   ============================================ */

/* Variables de temas de privacidad */
:root {
    --privacy-stealth-color: #8b5cf6;
    --privacy-stealth-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --privacy-stats-color: #3b82f6;
    --privacy-stats-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --privacy-location-color: #f59e0b;
    --privacy-location-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Efecto base para filas en la tabla con privacidad */
.privacy-shadow-row {
    position: relative;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.03) 0%, rgba(139, 92, 246, 0.08) 50%, rgba(139, 92, 246, 0.03) 100%);
    transition: background-color 0.25s ease-in-out;
}

.privacy-shadow-row:hover {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.06) 0%, rgba(139, 92, 246, 0.14) 50%, rgba(139, 92, 246, 0.06) 100%);
}

/* Solución técnica para borde lateral en celdas <td> de la fila */
.privacy-shadow-row td:first-child {
    border-left: 3px solid var(--privacy-stealth-color) !important;
}

.privacy-shadow-stats-row td:first-child {
    border-left: 3px solid var(--privacy-stats-color) !important;
}

.privacy-shadow-location-row td:first-child {
    border-left: 3px solid var(--privacy-location-color) !important;
}

/* Insignia / Ícono de privacidad */
.privacy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    position: relative;
    vertical-align: middle;
    cursor: help;
    user-select: none;
    will-change: transform, filter;
}

/* Variantes por nivel */
.privacy-shadow-stealth {
    background: var(--privacy-stealth-gradient);
    color: #ffffff;
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.6));
    animation: pulse-stealth 2s ease-in-out infinite;
}

.privacy-shadow-stats {
    background: var(--privacy-stats-gradient);
    color: #ffffff;
    filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.5));
}

.privacy-shadow-location {
    background: var(--privacy-location-gradient);
    color: #ffffff;
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4));
}

/* Floating Tooltip Customizado */
.privacy-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #f8fafc;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.privacy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.privacy-icon:hover .privacy-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Animación fluida de pulsación para Stealth Total */
@keyframes pulse-stealth {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.9));
    }
}

/* Adaptación Responsive */
@media (max-width: 768px) {
    .privacy-icon {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }

    .privacy-tooltip {
        display: none !important;
    }
}
/* ------------------------------------------------------------
   CONTENEDOR Y BASE
   ------------------------------------------------------------ */
.rank-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
}

/* Base unificada para iconos */
.rank-icon {
    font-size: 0.85rem;
    line-height: 1;
}

/* ------------------------------------------------------------
   PODIO PRINCIPAL (#1, #2, #3)
   ------------------------------------------------------------ */
.rank-badge-podium {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
    cursor: pointer;
}

.rank-badge-podium:hover {
    transform: translateY(-2px) scale(1.05);
}

.rank-badge-podium .rank-text {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
}

/* Shimmer / Destello continuo */
.rank-shine {
    position: absolute;
    top: -50%;
    left: -60%;
    width: 35%;
    height: 200%;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: rankShineSweep 3.5s infinite ease-in-out;
}

/* TOP 1 - ORO IMPERIAL */
.rank-top-1 {
    background: linear-gradient(135deg, #fff3a1 0%, #ffd700 45%, #d4af37 80%, #996515 100%);
    color: #3b2000;
    border: 1px solid #ffe875;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* TOP 2 - PLATA CROMADA */
.rank-top-2 {
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 40%, #cbd5e1 75%, #94a3b8 100%);
    color: #0f172a;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* TOP 3 - BRONCE FUEGO */
.rank-top-3 {
    background: linear-gradient(135deg, #ffe4d6 0%, #f97316 45%, #ea580c 80%, #9a3412 100%);
    color: #ffffff;
    border: 1px solid #ffedd5;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------
   POSICIONES PREMIADAS (#4 Y #5)
   ------------------------------------------------------------ */
.rank-badge-reward {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.rank-badge-reward:hover {
    transform: translateY(-1px);
}

/* TOP 4 - VIOLETA ÉPICO */
.rank-top-4 {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #ffffff;
    border: 1px solid #c084fc;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.rank-top-4 .rank-icon {
    color: #fef08a; /* Estrella dorada clara sobre fondo violeta */
}

/* TOP 5 - CIAN místico */
.rank-top-5 {
    background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
    color: #ffffff;
    border: 1px solid #67e8f9;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.rank-top-5 .rank-icon {
    color: #e0f2fe; /* Estrella celeste clara sobre fondo azul/cian */
}

/* ------------------------------------------------------------
   POSICIONES COMUNES (#6+)
   ------------------------------------------------------------ */
.rank-badge-default {
    display: inline-block;
    min-width: 28px;
    padding: 3px 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background-color: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Estado inactivo predeterminado de los botones de clase */
#class-filters .btn-class-filter {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease-in-out;
}

/* Hover suave para los botones inactivos */
#class-filters .btn-class-filter:hover {
    background-color: #e9ecef;
    color: #212529;
}

/* Estado ACTIVO (Estilo Dorado estilo 'Top Resets') */
#class-filters .btn-class-filter.active {
    background-color: #ff9800 !important; /* Color dorado / naranja */
    border-color: #ff9800 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.35) !important; /* Sombra dorada */
}