/* Popups Mobile First - Tamaño reducido 80% */
:root {
    --success: #27ae60;
    --warning: #f39c12;
    --accent: #3498db;
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --text-light: #999;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.popup-container {
    position: fixed;
    top: 70px;
    right: 8px;
    width: calc(100vw - 16px);
    max-width: 280px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px;
    display: flex;
    align-items: flex-start;
    animation: slideInRight 0.4s ease, fadeOut 0.4s ease 6s forwards;
    border-left: 3px solid var(--success);
    position: relative;
    overflow: hidden;
    min-height: 45px;
    font-size: 0.8em;
}

.popup.warning {
    border-left-color: var(--warning);
}

.popup.accent {
    border-left-color: var(--accent);
}

.popup-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 0.7rem;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--white);
}

.popup.success .popup-icon {
    background: var(--success);
}

.popup.warning .popup-icon {
    background: var(--warning);
}

.popup.accent .popup-icon {
    background: var(--accent);
}

.popup-content {
    flex: 1;
    min-width: 0;
}

.popup-title {
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.popup-message {
    color: var(--text-secondary);
    font-size: 0.65rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

.popup-time {
    font-size: 0.6rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    background: var(--success);
    color: var(--white);
    padding: 1px 5px;
    border-radius: 6px;
    font-size: 0.55rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.live-indicator:before {
    content: '';
    width: 3px;
    height: 3px;
    background: var(--white);
    border-radius: 50%;
    margin-right: 2px;
    animation: pulse 2s infinite;
}

.event-type {
    display: inline-block;
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 6px;
    font-size: 0.55rem;
    font-weight: 600;
}

/* Animaciones optimizadas */
@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(80px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
        transform: translateX(0) scale(1);
    }
    to { 
        opacity: 0; 
        transform: translateX(80px) scale(0.9);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Media queries para pantallas más grandes */
@media (min-width: 768px) {
    .popup-container {
        top: 80px;
        right: 12px;
        max-width: 260px;
    }
    
    .popup {
        padding: 12px;
        min-height: 50px;
    }
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .popup {
        animation: none;
    }
    
    .live-indicator,
    .live-indicator:before {
        animation: none;
    }
}