/* Icono flotante para tiempo real */
.realtime-floating-icon {
    position: fixed;
    bottom: 20px; /* Por defecto en la parte inferior */
    right: 20px;
    z-index: 1030; /* Por debajo del banner de cookies (z-index: 1040) */
    animation: float 3s ease-in-out infinite;
}

/* Cuando hay banner de cookies, posicionar más arriba y por encima */
body.cookie-banner-active .realtime-floating-icon {
    bottom: 200px; /* Mucho más arriba cuando el banner está activo */
    z-index: 1050; /* Por encima del banner de cookies cuando está activo */
}

/* Ocultar en la página de tiempo real */
body.realtime-page .realtime-floating-icon {
    display: none;
}

.realtime-floating-link {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    min-width: 60px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.realtime-floating-link:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.realtime-icon-container {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.realtime-icon-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s infinite;
    pointer-events: none;
}

.realtime-icon-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s infinite 0.5s;
    pointer-events: none;
}

.realtime-main-icon {
    font-size: 18px;
    animation: bounce 2s infinite;
}

.realtime-pulse-icon {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 12px;
    color: #ffd700;
    animation: pulseGlow 1.5s infinite, rotate 4s linear infinite;
    z-index: 1;
}

.realtime-email-icon {
    position: absolute;
    bottom: -2px;
    left: -2px;
    font-size: 10px;
    color: #ffc107;
    animation: emailBounce 2.5s infinite, emailGlow 3s infinite;
    z-index: 1;
}

.realtime-floating-text {
    white-space: nowrap;
    font-size: 14px;
}

/* Animación de flotación */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animación de rebote para el icono principal */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Animación de pulso y brillo para el icono secundario */
@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 3px #ffd700);
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
        filter: drop-shadow(0 0 8px #ffd700);
    }
}

/* Animación de rotación para el icono secundario */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animación de ondas (ripple) */
@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Animación de rebote para el icono de email */
@keyframes emailBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    10% {
        transform: translateY(-2px) rotate(-5deg);
    }
    30% {
        transform: translateY(-1px) rotate(3deg);
    }
    40% {
        transform: translateY(-1.5px) rotate(-2deg);
    }
    60% {
        transform: translateY(-0.5px) rotate(1deg);
    }
}

/* Animación de brillo para el icono de email */
@keyframes emailGlow {
    0%, 100% {
        filter: drop-shadow(0 0 2px #ffc107);
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 6px #ffc107) drop-shadow(0 0 12px #ffc107);
        transform: scale(1.1);
    }
}

/* Animación de pulso para el icono (mantener compatibilidad) */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Efecto de brillo al pasar el mouse */
.realtime-floating-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.realtime-floating-link:hover::before {
    left: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .realtime-floating-icon {
        bottom: 20px;
        right: 15px;
        z-index: 1060; /* Asegurar que esté visible en móviles */
    }
    
    body.cookie-banner-active .realtime-floating-icon {
        bottom: 120px; /* Ajustado para móviles */
    }
    
    .realtime-floating-link {
        padding: 12px 16px;
        font-size: 14px;
        min-width: 70px;
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    }
    
    .realtime-floating-text {
        font-size: 14px;
        white-space: nowrap;
    }
    
    .realtime-icon-container {
        margin-right: 6px;
    }
    
    .realtime-main-icon {
        font-size: 16px;
    }
    
    .realtime-pulse-icon {
        font-size: 10px;
    }
    
    .realtime-email-icon {
        font-size: 8px;
    }
}

@media (max-width: 576px) {
    .realtime-floating-icon {
        bottom: 20px;
        right: 10px;
        z-index: 1060; /* Asegurar que esté visible */
    }
    
    body.cookie-banner-active .realtime-floating-icon {
        bottom: 100px; /* Ajustado para móviles pequeños */
    }
    
    .realtime-floating-link {
        padding: 10px 14px;
        min-width: 60px;
        font-size: 13px;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
    
    .realtime-floating-text {
        font-size: 14px;
        display: block; /* Mostrar texto pero más pequeño */
        white-space: nowrap;
    }
    
    .realtime-icon-container {
        margin-right: 4px;
    }
    
    .realtime-main-icon {
        font-size: 14px;
    }
    
    .realtime-pulse-icon {
        font-size: 8px;
    }
    
    .realtime-email-icon {
        font-size: 6px;
    }
}

/* Para móviles muy pequeños (menos de 400px) */
@media (max-width: 400px) {
    .realtime-floating-icon {
        bottom: 15px;
        right: 8px;
    }
    
    .realtime-floating-link {
        padding: 8px 12px;
        min-width: 50px;
        font-size: 12px;
    }
    
    .realtime-floating-text {
        font-size: 14px;
    }
    
    .realtime-main-icon {
        font-size: 12px;
    }
    
    .realtime-pulse-icon {
        font-size: 6px;
    }
    
    .realtime-email-icon {
        font-size: 5px;
    }
}

/* Asegurar que el banner de cookies esté por encima del icono flotante */
.cookie-consent-banner {
    z-index: 1040;
}
