/* Floating Widget Core */
.social-fly-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: inherit;
}

@media (max-width: 767px) {
    .social-fly-container {
        bottom: 100px;
        right: 20px;
    }
}

.social-fly-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: -1;
    backdrop-filter: blur(2px);
}

.social-fly-container.active .social-fly-overlay {
    opacity: 1;
    pointer-events: auto;
    display: block !important;
}

.social-fly-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* List of icons */
.social-fly-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

.social-fly-container.active .social-fly-list {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.social-fly-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Labels (Tags) */
.social-fly-label {
    background: rgba(39, 39, 42, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 11px;
    letter-spacing: 0.05em;
    font-weight: 800;
    text-transform: uppercase;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-fly-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid rgba(39, 39, 42, 0.9);
}

.social-fly-container.active .social-fly-label {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation for items */
.social-fly-container.active .social-fly-item:nth-child(1) .social-fly-label { transition-delay: 0.1s; }
.social-fly-container.active .social-fly-item:nth-child(2) .social-fly-label { transition-delay: 0.15s; }
.social-fly-container.active .social-fly-item:nth-child(3) .social-fly-label { transition-delay: 0.2s; }
.social-fly-container.active .social-fly-item:nth-child(4) .social-fly-label { transition-delay: 0.25s; }
.social-fly-container.active .social-fly-item:nth-child(5) .social-fly-label { transition-delay: 0.3s; }
.social-fly-container.active .social-fly-item:nth-child(6) .social-fly-label { transition-delay: 0.35s; }
.social-fly-container.active .social-fly-item:nth-child(7) .social-fly-label { transition-delay: 0.4s; }
.social-fly-container.active .social-fly-item:nth-child(8) .social-fly-label { transition-delay: 0.45s; }

/* The Trigger Button */
.social-fly-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
}

.social-fly-trigger:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.5);
}

.social-fly-trigger-icons {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
}

.social-fly-trigger-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    background: transparent !important;
}

.social-fly-trigger-icon.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.social-fly-trigger-icons svg {
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    fill: currentColor !important;
    color: #ffffff !important;
}

/* Hide background elements for icons like 'Max' in the trigger */
.social-fly-trigger-icons svg rect,
.social-fly-trigger-icons svg [fill^="url"] {
    display: none !important;
}

/* Close icon */
.social-fly-trigger-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
    transition: all 0.4s ease;
    color: #fff;
}

.social-fly-container.active .social-fly-trigger-close {
    opacity: 1;
    transform: rotate(0) scale(1);
    color: #333;
}

.social-fly-container.active .social-fly-trigger-icons {
    opacity: 0;
    visibility: hidden;
}

.social-fly-container.active .social-fly-trigger {
    background: #fff;
    transform: rotate(180deg);
}

/* Pulse Animation - Sync with Icon Change */
.social-fly-pulse, .social-fly-pulse::after {
    position: absolute;
    inset: 0;
    background: rgba(59, 130, 246, 0.4);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
}

.social-fly-pulse::after {
    content: '';
}

.social-fly-pulse.animate, .social-fly-pulse.animate::after {
    animation: sonarWave 2.5s ease-out forwards;
}

.social-fly-pulse.animate::after {
    animation-delay: 0.3s;
}

@keyframes sonarWave {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3.5); opacity: 0; }
}

/* Common Icon styles (Reused from social.css) */
.s-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px;
    height: 44px;
    color: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.s-icon svg {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    fill: currentColor !important;
    color: #ffffff !important;
    opacity: 1;
    transition: transform 0.3s ease;
}

.s-icon svg rect,
.s-icon svg [fill^="url"] {
    display: none !important;
}

.social-fly-item:hover .s-icon svg {
    transform: scale(1.1);
}

/* Brand Colors (Darkened for better contrast with white icons) */
.phone { background-color: #0369a1; }
.email { background-color: #0369a1; }
.facebook { background-color: #1e3a8a; }
.github { background-color: #09090b; }
.google { background-color: #991b1b; }
.instagram { background-color: #9d174d; }
.odnoklassniki { background-color: #9a3412; }
.pinterest { background-color: #991b1b; }
.skype { background-color: #0369a1; }
.telegram { background-color: #0369a1; }
.twitter { background-color: #0369a1; }
.viber { background-color: #4c1d95; }
.vimeo { background-color: #0369a1; }
.vk { background-color: #1e3a8a; }
.whatsapp { background-color: #166534; }
.youtube { background-color: #991b1b; }
.tiktok { background-color: #000000; }
.discord { background-color: #3730a3; }
.linkedin { background-color: #1e40af; }
.snapchat { background-color: #854d0e; }
.snapchat svg { color: #fff; }
.reddit { background-color: #9a3412; }
.threads { background-color: #000000; }
.max { background-color: #0369a1; }
