/**
 * Estilos CSS para Sistema de Estadísticas en Tiempo Real
 */

/* Indicador de tiempo real */
.realtime-indicator {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 12px;
    z-index: 1000;
}

.realtime-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.status-dot.loading {
    background: #FF9800;
    animation: spin 1s linear infinite;
}

.status-text {
    font-weight: 600;
    color: #4CAF50;
}

.last-update {
    color: #ccc;
    font-size: 11px;
}

/* Animaciones */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lista de jugadores online */
.online-players-container {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.online-players-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.online-players-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.online-count {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.online-players-list {
    padding: 10px;
}

.online-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
    transition: all 0.3s ease;
}

.online-player-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.player-class {
    font-size: 12px;
    color: #ccc;
    text-transform: capitalize;
}

.player-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-level,
.player-resets {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #fff;
    font-weight: 500;
}

.player-level {
    background: linear-gradient(45deg, #2196F3, #21CBF3);
}

.player-resets {
    background: linear-gradient(45deg, #FF9800, #FFB74D);
}

.online-indicator {
    font-size: 10px;
    animation: pulse 2s infinite;
}

.no-players {
    text-align: center;
    color: #ccc;
    padding: 30px;
    font-style: italic;
}

/* Efectos de actualización */
.stat-updating {
    position: relative;
    overflow: hidden;
}

.stat-updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Números animados */
.animated-number {
    transition: all 0.3s ease;
    display: inline-block;
}

.animated-number.updating {
    transform: scale(1.1);
    color: #4CAF50 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .realtime-indicator {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .online-player-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .player-stats {
        align-self: flex-end;
    }
}

/* Estados de conexión */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 15px;
}

.connection-status.connected {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.connection-status.disconnected {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #F44336;
}

.connection-status.reconnecting {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #FF9800;
}

/* Scrollbar personalizado */
.online-players-container::-webkit-scrollbar {
    width: 6px;
}

.online-players-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.online-players-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.online-players-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Efectos de entrada */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip para información adicional */
.stat-tooltip {
    position: relative;
    cursor: help;
}

.stat-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.stat-tooltip:hover::after {
    opacity: 1;
}