/* ============================================================
   social-float.css
   Floating Social Media Widget – ChennaiBuilders.com
   Premium glassmorphism design | Desktop: vertical | Mobile: horizontal
   ============================================================ */

/* ---------- Fade-in keyframe ---------- */
@keyframes socialFadeIn {
    0% {
        opacity: 0;
        transform: translateX(60px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes socialFadeInMobile {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Pulse ring on load ---------- */
@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.25); }
    70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ============================================================
   WIDGET CONTAINER
   ============================================================ */
.social-float-widget {
    position: fixed;
    bottom: 100px;          /* sits comfortably above footer */
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    /* Glassmorphism panel */
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 60px;
    padding: 14px 10px;

    /* Subtle shadow depth */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.22),
        0 2px 8px  rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    /* Fade-in on load */
    animation: socialFadeIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

/* ============================================================
   LABEL (optional small title strip – hidden on mobile)
   ============================================================ */
.social-float-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 4px;
    user-select: none;
}

/* ============================================================
   INDIVIDUAL ICON WRAPPER
   ============================================================ */
.social-float-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   ANCHOR / BUTTON
   ============================================================ */
.social-float-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.28s ease,
        filter 0.28s ease;
    will-change: transform;
    outline: none;
    border: 2px solid rgba(255,255,255,0.18);
}

/* Icon sizing */
.social-float-link i {
    pointer-events: none;
    line-height: 1;
    font-size: 15px;
}

/* ---------- Per-platform colours ---------- */
.sf-facebook  { background: #1877F2; }
.sf-instagram {
    background: linear-gradient(
        135deg,
        #f09433 0%,
        #e6683c 25%,
        #dc2743 50%,
        #cc2366 75%,
        #bc1888 100%
    );
}
.sf-twitter   { background: #000; }
.sf-youtube   { background: #FF0000; }
.sf-linkedin  { background: #0A66C2; }
.sf-whatsapp  { background: #25D366; }

/* ============================================================
   HOVER STATES
   ============================================================ */
.sf-facebook:hover {
    transform: scale(1.22) translateY(-2px);
    box-shadow: 0 0 18px 4px rgba(24, 119, 242, 0.60);
    filter: brightness(1.12);
}
.sf-instagram:hover {
    transform: scale(1.22) translateY(-2px);
    box-shadow: 0 0 18px 4px rgba(220, 39, 67, 0.55);
    filter: brightness(1.10);
}
.sf-twitter:hover {
    transform: scale(1.22) translateY(-2px);
    box-shadow: 0 0 18px 4px rgba(80, 80, 80, 0.50);
    filter: brightness(1.25);
}
.sf-youtube:hover {
    transform: scale(1.22) translateY(-2px);
    box-shadow: 0 0 18px 4px rgba(255, 0, 0, 0.60);
    filter: brightness(1.12);
}
.sf-linkedin:hover {
    transform: scale(1.22) translateY(-2px);
    box-shadow: 0 0 18px 4px rgba(10, 102, 194, 0.60);
    filter: brightness(1.12);
}
.sf-whatsapp:hover {
    transform: scale(1.22) translateY(-2px);
    box-shadow: 0 0 18px 4px rgba(37, 211, 102, 0.60);
    filter: brightness(1.12);
}

/* Active press feel */
.social-float-link:active {
    transform: scale(0.95) !important;
    transition-duration: 0.1s !important;
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
.sf-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 15, 25, 0.88);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    transform: translateY(-50%) translateX(6px);
    border: 1px solid rgba(255,255,255,0.12);

    /* Arrow pointing right */
    &::after {
        content: '';
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        border: 5px solid transparent;
        border-left-color: rgba(15, 15, 25, 0.88);
    }
}

.social-float-item:hover .sf-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ============================================================
   DIVIDER LINE BETWEEN ICONS
   ============================================================ */
.sf-divider {
    width: 22px;
    height: 1px;
    background: rgba(255,255,255,0.15);
    border-radius: 1px;
    flex-shrink: 0;
}

/* ============================================================
   MOBILE RESPONSIVE  (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
    .social-float-widget {
        /* Horizontal row at bottom */
        flex-direction: row;
        bottom: 12px;
        right: 50%;
        transform: translateX(50%);
        border-radius: 60px;
        padding: 10px 14px;
        gap: 8px;
        animation: socialFadeInMobile 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
        /* Remove transform from animation to not conflict */
        animation-fill-mode: both;
    }

    .social-float-link {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .social-float-link i {
        font-size: 13px;
    }

    /* Hide label and dividers on mobile */
    .social-float-label,
    .sf-divider {
        display: none;
    }

    /* Tooltip above on mobile */
    .sf-tooltip {
        right: auto;
        left: 50%;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(-4px);

        &::after {
            left: 50%;
            top: 100%;
            transform: translateX(-50%);
            border-left-color: transparent;
            border-top-color: rgba(15, 15, 25, 0.88);
        }
    }

    .social-float-item:hover .sf-tooltip {
        transform: translateX(-50%) translateY(0);
    }

    /* Simpler hover on mobile – no translateY */
    .social-float-link:hover {
        transform: scale(1.18) !important;
    }
}

/* ============================================================
   SMALL DESKTOP / TABLET (641px – 1024px)
   ============================================================ */
@media (min-width: 641px) and (max-width: 1024px) {
    .social-float-widget {
        bottom: 80px;
        right: 14px;
        gap: 9px;
        padding: 12px 9px;
    }

    .social-float-link {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
}

/* ============================================================
   ENSURE WIDGET NEVER HIDES BEHIND FOOTER
   (If footer is sticky / position relative, bump bottom value)
   ============================================================ */
@media (min-width: 641px) {
    /* Extra clearance if the page has a taller footer */
    .has-tall-footer .social-float-widget {
        bottom: 140px;
    }
}
