/**
 * Social Float Icons CSS
 * VietKhoiMinh Theme
 */

/* Container for social float icons */
.vkm-social-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual social icon */
.vkm-social-float a {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    filter: brightness(1) saturate(0.95);
    backdrop-filter: blur(10px);
}

/* Image wrapper for better control */
.vkm-social-float a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.vkm-social-float a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Initial slide-in animation with idle ripple effect */
.vkm-social-float a {
    animation: slideInRight 0.6s ease-out;
    animation-fill-mode: both;
}

.vkm-social-float a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #07294F;
    opacity: 0;
    animation: idleRipple 2.5s ease-out infinite;
}

.vkm-social-float a:nth-child(1) {
    animation-delay: 0.1s;
}

.vkm-social-float a:nth-child(1)::after {
    animation-delay: 0.1s;
}

.vkm-social-float a:nth-child(2) {
    animation-delay: 0.2s;
}

.vkm-social-float a:nth-child(2)::after {
    animation-delay: 0.8s;
}

.vkm-social-float a:nth-child(3) {
    animation-delay: 0.3s;
}

.vkm-social-float a:nth-child(3)::after {
    animation-delay: 1.5s;
}

/* Hover animation - slight scale up */
.vkm-social-float a:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    filter: brightness(1.05) saturate(1.1);
}

.vkm-social-float a:hover::before {
    opacity: 1;
}

.vkm-social-float a:hover::after {
    animation: none;
    opacity: 0;
}

/* Messenger brand color */
.vkm-social-messenger:hover {
    box-shadow: 0 6px 20px rgba(0, 132, 255, 0.3);
}

/* Phone brand color */
.vkm-social-phone:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* Zalo brand color */
.vkm-social-zalo:hover {
    box-shadow: 0 6px 20px rgba(0, 112, 240, 0.3);
}

/* Click/Active animation - press down effect */
.vkm-social-float a:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.vkm-social-float a:active::after {
    animation: clickRipple 0.6s ease-out;
}

/* Keyframe animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes idleRipple {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    30% {
        opacity: 0.4;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes clickRipple {
    0% {
        transform: scale(1);
        opacity: 0.6;
        border-width: 3px;
        border-color: #07294F;
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-width: 0;
        border-color: #07294F;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vkm-social-float {
        right: 15px;
        bottom: 15px;
        gap: 12px;
    }
    
    .vkm-social-float a {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .vkm-social-float {
        right: 10px;
        bottom: 10px;
        gap: 10px;
    }
    
    .vkm-social-float a {
        width: 45px;
        height: 45px;
    }
}

/* Accessibility improvements */
.vkm-social-float a:focus {
    outline: 3px solid #007bff;
    outline-offset: 3px;
    filter: brightness(1.15) saturate(1.2);
}

.vkm-social-float a:focus:not(:hover) {
    animation: focusPulse 1.5s ease-in-out infinite;
}

.vkm-social-float a:focus::after {
    animation: idleRipple 2.5s ease-out infinite;
}

@keyframes focusPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 123, 255, 0.5);
    }
}

/* Performance optimization */
.vkm-social-float a,
.vkm-social-float a img {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}
