/* Online Users Tracker - Estilos CSS */

/* Contador de usuarios online */
.online-users-counter {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 10px 0;
    transition: all 0.3s ease;
}

.online-users-counter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.online-users-counter .online-count {
    font-size: 1.2em;
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Detalles de usuarios online */
.online-users-details {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.online-users-details h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.online-users-details .user-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.online-users-details .user-item:last-child {
    border-bottom: none;
}

.online-users-details .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.online-users-details .user-info {
    flex: 1;
}

.online-users-details .user-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
}

.online-users-details .user-page {
    font-size: 12px;
    color: #666;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-users-details .user-time {
    font-size: 11px;
    color: #999;
    margin-left: 10px;
}

/* Widget de usuarios online */
.widget_online_users {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.widget_online_users h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.widget_online_users .online-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@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);
    }
}

/* Estilos para el panel de administración */
.online-stats .postbox {
    background: white;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 20px;
}

.online-stats .hndle {
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    padding: 12px 20px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.online-stats .inside {
    padding: 20px;
}

.online-stats #total-online {
    color: #2271b1;
    font-weight: bold;
    font-size: 24px;
    background: #f0f6fc;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 10px;
}

/* Tabla de usuarios online */
.online-users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.online-users-table th,
.online-users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.online-users-table th {
    background-color: #f1f1f1;
    font-weight: bold;
    color: #333;
}

.online-users-table tr:hover {
    background-color: #f9f9f9;
}

.online-users-table .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 10px;
}

.online-users-table .page-title {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-users-table .admin-badge {
    background: #dc3232;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 5px;
    font-weight: normal;
}

.online-users-table .guest-user {
    color: #666;
    font-style: italic;
}

/* Indicador de conexión */
.connection-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.connection-status.online {
    background: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.connection-status.idle {
    background: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.3);
}

.connection-status.offline {
    background: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .online-users-counter {
        padding: 8px 12px;
        font-size: 14px;
    }

    .online-users-table {
        font-size: 14px;
    }

    .online-users-table th,
    .online-users-table td {
        padding: 8px;
    }

    .online-users-table .page-title {
        max-width: 150px;
    }

    .online-users-details .user-page {
        max-width: 120px;
    }
}

/* Animaciones */
.online-users-counter {
    animation: fadeIn 0.5s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip personalizado */
.online-tooltip {
    position: relative;
    cursor: help;
}

.online-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 1000;
}

.online-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.online-tooltip:hover::after,
.online-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Estilos para estados de carga */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Notificaciones */
.online-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}