/* Import de police moderne */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

/* Bulle de chat flottante - Style vivant */
.chat-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #0088cc 0%, #00a0e6 50%, #29b6f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4),
        0 4px 12px rgba(41, 182, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    text-decoration: none;
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

/* Animation de flottement */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-8px) rotate(1deg);
    }
    66% {
        transform: translateY(-4px) rotate(-1deg);
    }
}

/* Effet hover sur la bulle */
.chat-bubble:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 136, 204, 0.6),
        0 8px 20px rgba(41, 182, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #00a0e6 0%, #29b6f6 50%, #42c5ff 100%);
    animation: none;
}

.chat-bubble:active {
    transform: scale(1.05) translateY(-2px);
    transition: all 0.1s ease;
}

/* Icône Messagerie avec animation */
.chat-bubble svg {
    width: 32px;
    height: 32px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.chat-bubble:hover svg {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Animation de pulsation énergique */
.chat-bubble::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(0, 160, 230, 0.4) 0%,
        transparent 70%
    );
    animation: energeticPulse 3s infinite;
    z-index: -1;
}

@keyframes energeticPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Tooltip/Message style vivant - Apparition automatique */
.chat-bubble .tooltip {
    position: absolute;
    right: 80px;
    top: 30%;
    transform: translateY(-50%) translateX(20px);
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 1001;
    animation: autoShow 5s infinite;
}

/* Flèche du tooltip avec style moderne */
.chat-bubble .tooltip::after {
    content: "";
    position: absolute;
    top: 40%;
    left: 100%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #34495e;
    filter: drop-shadow(2px 0 4px rgba(0, 0, 0, 0.1));
}

/* Animation automatique du tooltip toutes les 5 secondes */
@keyframes autoShow {
    0%,
    60% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-50%) translateX(20px) scale(0.8);
    }
    70% {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(-5px) scale(1.05);
    }
    75%,
    95% {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0px) scale(1);
    }
    100% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-50%) translateX(20px) scale(0.8);
    }
}

/* Animation d'apparition du tooltip au survol (bonus) */
.chat-bubble:hover .tooltip {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) translateX(0px) scale(1) !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Effet de brillance automatique sur le tooltip */
.chat-bubble .tooltip::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    border-radius: 12px;
    animation: shine 5s infinite;
}

@keyframes shine {
    0%,
    60% {
        left: -100%;
        opacity: 0;
    }
    75% {
        left: -100%;
        opacity: 1;
    }
    85% {
        left: 100%;
        opacity: 1;
    }
    95%,
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Particules d'animation autour de la bulle */
.chat-bubble::after {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 50%;
    border: 2px solid transparent;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(41, 182, 246, 0.5),
        transparent,
        rgba(0, 160, 230, 0.5),
        transparent
    );
    mask: radial-gradient(
        circle,
        transparent 65%,
        black 66%,
        black 68%,
        transparent 69%
    );
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-bubble:hover::after {
    opacity: 1;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive avec message visible partout */
@media (max-width: 768px) {
    .chat-bubble {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }

    .chat-bubble svg {
        width: 28px;
        height: 28px;
    }

    .chat-bubble .tooltip {
        right: 70px;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 10px;
        max-width: 500px;
        white-space: normal;
        line-height: 1.3;
    }

    .chat-bubble .tooltip::after {
        border-width: 6px;
    }
}

@media (max-width: 480px) {
    .chat-bubble {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }

    .chat-bubble svg {
        width: 26px;
        height: 26px;
    }

    .chat-bubble .tooltip {
        right: 65px;
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px;
        max-width: 180px;
        transform: translateY(-50%) translateX(15px);
    }

    .chat-bubble .tooltip::after {
        border-width: 5px;
    }

    /* Animation adaptée pour mobile */
    @keyframes autoShow {
        0%,
        55% {
            opacity: 0;
            visibility: hidden;
            transform: translateY(-50%) translateX(15px) scale(0.8);
        }
        65% {
            opacity: 1;
            visibility: visible;
            transform: translateY(-50%) translateX(-3px) scale(1.02);
        }
        70%,
        95% {
            opacity: 1;
            visibility: visible;
            transform: translateY(-50%) translateX(0px) scale(1);
        }
        100% {
            opacity: 0;
            visibility: hidden;
            transform: translateY(-50%) translateX(15px) scale(0.8);
        }
    }
}

@media (max-width: 360px) {
    .chat-bubble .tooltip {
        right: 60px;
        max-width: 160px;
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Animation d'entrée de la bulle */
.chat-bubble {
    animation: slideIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.5s both,
        float 6s ease-in-out 1.5s infinite;
}

@keyframes slideIn {
    0% {
        transform: translateX(100px) translateY(100px) scale(0);
        opacity: 0;
    }
    100% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }
}
