/* ============================================
   PARTICLES & MESSENGER WIDGET
   Additional styles for international-topup
   ============================================ */

/* Flame rising animation */
@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity);
    }
    50% {
        transform: translateY(-400px) translateX(15px) scale(1.3);
        opacity: calc(var(--opacity) * 0.8);
    }
    100% {
        transform: translateY(-800px) translateX(-10px) scale(0.5);
        opacity: 0;
    }
}

/* Additional flame flicker animation */
@keyframes flameFlicker {
    0%, 100% {
        filter: brightness(1) blur(0px);
    }
    50% {
        filter: brightness(1.3) blur(1px);
    }
}

/* Particles Container */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: rgba(var(--color), var(--opacity));
    left: var(--left);
    top: var(--top);
    animation: particleFloat var(--duration) ease-out infinite, 
               flameFlicker 0.3s ease-in-out infinite;
    animation-delay: var(--delay);
    box-shadow: 0 0 10px rgba(var(--color), 0.6),
                0 0 20px rgba(var(--color), 0.4),
                0 0 30px rgba(var(--color), 0.2);
}

/* Flame-specific particles */
.flame-particle {
    border-radius: 60% 40% 60% 40%;
    filter: blur(2px);
}

/* Messenger Widget */
.messenger-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 999;
}

.messenger-chat-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.messenger-widget.expanded .messenger-chat-window {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

[data-theme="dark"] .messenger-chat-window {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

.chat-header {
    background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 6px;
}

.chat-title strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

.chat-title small {
    font-size: 0.75rem;
    opacity: 0.9;
}

.chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-body {
    flex: 1;
    padding: 20px;
    background: #f0f2f5;
    overflow-y: auto;
    max-height: 300px;
}

[data-theme="dark"] .chat-body {
    background: var(--bg-light);
}

.chat-message {
    margin-bottom: 12px;
    opacity: 0;
    animation: messageSlideIn 0.4s ease-out forwards;
}

.chat-message.bot {
    background: white;
    padding: 10px 14px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    max-width: 80%;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .chat-message.bot {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.messenger-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #0084ff;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 8px;
    transition: all 0.2s;
}

.messenger-link:hover {
    background: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
}

.messenger-link svg {
    width: 18px;
    height: 18px;
}

.messenger-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    animation: messengerFloat 3s ease-in-out infinite;
    position: relative;
}

.messenger-widget.expanded .messenger-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

.messenger-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 132, 255, 0.5);
}

.messenger-icon {
    width: 32px;
    height: 32px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.messenger-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border: 2px solid white;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes messengerFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (max-width: 768px) {
    .messenger-widget {
        bottom: 80px;
        right: 15px;
    }
    
    .messenger-chat-window {
        width: calc(100vw - 30px);
        max-width: 350px;
    }
}
