/* Eco Engineering Services - Floating Social Media Button - Modern Design */

/* Floating Action Button Container */
.social-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: calc(var(--z-fixed) + 10);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    font-family: var(--font-family);
}

@media (max-width: 767px) {
    .social-fab {
        bottom: calc(120px + env(safe-area-inset-bottom, 0px)); /* sit above bottom nav and safe area on phones */
        right: 16px;
    }

    .social-fab-menu {
        bottom: calc(94px + env(safe-area-inset-bottom, 0px));
    }
}

/* Main Toggle Button - Modern Glassmorphism Style */
.social-fab-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 24px rgba(233, 133, 11, 0.35),
        0 4px 12px rgba(233, 133, 11, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
    color: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Ripple effect on click */
.social-fab-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.social-fab-toggle:active::before {
    width: 200px;
    height: 200px;
}

.social-fab-toggle:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 32px rgba(233, 133, 11, 0.45),
        0 6px 16px rgba(233, 133, 11, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 0 40px rgba(233, 133, 11, 0.2);
}

.social-fab-toggle:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(233, 133, 11, 0.4),
        0 3px 10px rgba(233, 133, 11, 0.25);
}

.social-fab-toggle:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 4px;
    box-shadow: 
        0 0 0 4px rgba(233, 133, 11, 0.2),
        0 8px 24px rgba(233, 133, 11, 0.35);
}

/* Share/Social Icon with smooth animation */
.social-fab-toggle svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 2.5;
    transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.social-fab-toggle[aria-expanded="true"] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    box-shadow: 
        0 8px 24px rgba(16, 110, 60, 0.35),
        0 4px 12px rgba(16, 110, 60, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.social-fab-toggle[aria-expanded="true"]:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 
        0 12px 32px rgba(16, 110, 60, 0.45),
        0 6px 16px rgba(16, 110, 60, 0.3),
        0 0 40px rgba(16, 110, 60, 0.2);
}

.social-fab-toggle[aria-expanded="true"] svg {
    transform: scale(1.15);
}

/* Social Media Menu - Modern Card Style */
.social-fab-menu {
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transform: translateY(20px) scale(0.85);
    pointer-events: none;
    transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    bottom: 74px;
    right: 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.social-fab-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Individual Social Media Button - Enhanced Design */
.social-fab-link {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    text-decoration: none;
    position: relative;
    color: #ffffff;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Ripple effect for social links */
.social-fab-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.social-fab-link:active::before {
    width: 150px;
    height: 150px;
}

.social-fab-link:hover {
    transform: translateY(-4px) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 10px 28px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 0 30px rgba(0, 0, 0, 0.1);
}

.social-fab-link:active {
    transform: translateY(-2px) scale(1.05);
}

.social-fab-link:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
    box-shadow: 
        0 0 0 4px rgba(255, 255, 255, 0.2),
        0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Social Media Icons */
.social-fab-link svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    position: relative;
    z-index: 1;
    transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-fab-link:hover svg {
    transform: scale(1.15);
}

/* Platform-specific colors with gradients */
.social-fab-link[data-platform="website"] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.social-fab-link[data-platform="website"]:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 
        0 10px 28px rgba(4, 80, 151, 0.35),
        0 4px 12px rgba(4, 80, 151, 0.25),
        0 0 30px rgba(4, 80, 151, 0.15);
}

.social-fab-link[data-platform="facebook"] {
    background: linear-gradient(135deg, #1877F2 0%, #166FE5 100%);
}

.social-fab-link[data-platform="facebook"]:hover {
    background: linear-gradient(135deg, #166FE5 0%, #1460D4 100%);
    box-shadow: 
        0 10px 28px rgba(24, 119, 242, 0.35),
        0 4px 12px rgba(24, 119, 242, 0.25),
        0 0 30px rgba(24, 119, 242, 0.15);
}

.social-fab-link[data-platform="instagram"] {
    background: linear-gradient(135deg, #E4405F 0%, #F56040 50%, #FCAF45 100%);
}

.social-fab-link[data-platform="instagram"]:hover {
    background: linear-gradient(135deg, #D32E4A 0%, #E04F2F 50%, #E89E3A 100%);
    box-shadow: 
        0 10px 28px rgba(228, 64, 95, 0.35),
        0 4px 12px rgba(228, 64, 95, 0.25),
        0 0 30px rgba(228, 64, 95, 0.15);
}

.social-fab-link[data-platform="tiktok"] {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

.social-fab-link[data-platform="tiktok"]:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    box-shadow: 
        0 10px 28px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 0, 0, 0.2);
}

/* Enhanced Tooltip/Label */
.social-fab-link::after {
    content: attr(aria-label);
    position: absolute;
    right: 68px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateX(10px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: -0.01em;
}

.social-fab-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Tooltip styling complete - arrow removed for cleaner look */

/* Mobile Responsive */
@media (max-width: 767px) {
    .social-fab {
        bottom: 240px; /* 70px nav height + 70px clearance */
        right: 16px;
        gap: 12px;
    }
    
    .social-fab-toggle {
        width: 56px;
        height: 56px;
    }
    
    .social-fab-toggle svg {
        width: 24px;
        height: 24px;
    }
    
    .social-fab-link {
        width: 48px;
        height: 48px;
    }
    
    .social-fab-link svg {
        width: 22px;
        height: 22px;
    }
    
    .social-fab-menu {
        bottom: 78px; /* Positioned above the button */
        padding: 6px;
        gap: 12px;
    }
    
    /* Hide tooltips on mobile for cleaner look */
    .social-fab-link::after {
        display: none;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .social-fab {
        bottom: 90px; /* Same clearance for consistency */
        right: 12px;
    }
    
    .social-fab-toggle {
        width: 52px;
        height: 52px;
    }
    
    .social-fab-link {
        width: 44px;
        height: 44px;
    }
    
    .social-fab-menu {
        bottom: 78px;
    }
}

/* Desktop - Ensure it doesn't overlap with back-to-top button */
@media (min-width: 768px) {
    .social-fab {
        bottom: 100px;
        right: 24px;
    }
}

/* Animation delay for staggered menu items - Enhanced */
.social-fab-menu.open .social-fab-link:nth-child(1) {
    transition-delay: 0ms;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.social-fab-menu.open .social-fab-link:nth-child(2) {
    transition-delay: 60ms;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.social-fab-menu.open .social-fab-link:nth-child(3) {
    transition-delay: 120ms;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.social-fab-menu.open .social-fab-link:nth-child(4) {
    transition-delay: 180ms;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulse animation for main button when menu is closed */
@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 8px 24px rgba(233, 133, 11, 0.35),
            0 4px 12px rgba(233, 133, 11, 0.25);
    }
    50% {
        box-shadow: 
            0 8px 24px rgba(233, 133, 11, 0.45),
            0 4px 12px rgba(233, 133, 11, 0.35),
            0 0 20px rgba(233, 133, 11, 0.2);
    }
}

/* Subtle pulse when menu is closed (optional - can be removed if too distracting) */
.social-fab-toggle:not([aria-expanded="true"]):hover {
    animation: pulse 2s ease-in-out infinite;
}
