/* ===== ESTILOS PARA MONITOREO EN TIEMPO REAL ===== */

/* Indicadores de estado en tiempo real */
.real-time-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% { 
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    }
}

/* Punto de pulso */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Indicadores de servicio */
.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
}

.service-status.healthy {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.service-status.unhealthy {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    animation: shake-alert 0.5s ease;
}

@keyframes shake-alert {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Badges de estado */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Alertas y notificaciones */
.alert-banner {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #ef4444, #f87171);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
    animation: slide-down 0.3s ease;
}

@keyframes slide-down {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Métricas en tiempo real */
.realtime-metric {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 10px;
    border: 1px solid #334155;
    transition: all 0.3s ease;
}

.realtime-metric:hover {
    border-color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text; /* Propiedad estándar añadida */
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 5px;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

/* Contadores en tiempo real */
.counter {
    font-size: 32px;
    font-weight: 800;
    color: #e2e8f0;
    position: relative;
}

.counter::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

/* Efectos de actualización */
.updating {
    position: relative;
    overflow: hidden;
}

.updating::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Logs en tiempo real */
.log-stream {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #0f172a;
    border-radius: 8px;
    padding: 15px;
}

.log-entry {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    background: rgba(30, 41, 59, 0.5);
    animation: log-fade 0.3s ease;
}

@keyframes log-fade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-entry.info { border-left-color: #3b82f6; }
.log-entry.success { border-left-color: #10b981; }
.log-entry.warning { border-left-color: #f59e0b; }
.log-entry.error { 
    border-left-color: #ef4444;
    animation: log-error 0.5s ease;
}

@keyframes log-error {
    0%, 100% { background: rgba(239, 68, 68, 0.1); }
    50% { background: rgba(239, 68, 68, 0.2); }
}

/* Panel de actividad en tiempo real */
.activity-stream {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(30, 41, 59, 1);
    transform: translateX(5px);
}

.activity-item.new {
    border-left-color: #10b981;
    animation: highlight-new 2s ease;
}

@keyframes highlight-new {
    0% { background: rgba(16, 185, 129, 0.2); }
    100% { background: rgba(30, 41, 59, 0.8); }
}

.activity-timestamp {
    font-size: 12px;
    color: #64748b;
    min-width: 80px;
}

/* Indicador de carga en tiempo real */
.realtime-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.realtime-loader .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    animation: loader-dots 1.4s infinite ease-in-out both;
}

.realtime-loader .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.realtime-loader .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loader-dots {
    0%, 80%, 100% { 
        transform: scale(0);
    } 
    40% { 
        transform: scale(1.0);
    }
}

/* Responsive para tiempo real */
@media (max-width: 768px) {
    .real-time-indicator {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .activity-timestamp {
        align-self: flex-end;
    }
}