/**
 * Social Float Button - Frontend Styles
 *
 * @package Social_Float_Button
 * @since 1.0.0
 */

/* ===========================
   Float Button Base
   =========================== */
.sfb-float-button {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    z-index: 99999;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.sfb-float-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.sfb-float-button:active {
    transform: scale(0.95);
}

.sfb-float-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 3px;
}

/* ===========================
   Icon
   =========================== */
.sfb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.sfb-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.sfb-icon svg path {
    fill: currentColor;
}

/* ===========================
   Tooltip
   =========================== */
.sfb-tooltip {
    position: absolute;
    background: #1e293b;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(0) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
    z-index: 100000;
}

.sfb-tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

/* Tooltip a la izquierda del botón */
.sfb-tooltip-left {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(5px) scale(0.9);
}

.sfb-tooltip-left::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #1e293b;
}

.sfb-float-button:hover .sfb-tooltip-left {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
}

/* Tooltip a la derecha del botón */
.sfb-tooltip-right {
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-5px) scale(0.9);
}

.sfb-tooltip-right::after {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #1e293b;
}

.sfb-float-button:hover .sfb-tooltip-right {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
}

/* ===========================
   Animations
   =========================== */

/* Pulse */
@keyframes sfb-pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 0 currentColor;
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 12px transparent;
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 0 transparent;
    }
}

.sfb-animation-pulse {
    animation: sfb-pulse 2s ease-in-out infinite;
}

.sfb-animation-pulse:hover {
    animation: none;
}

/* Bounce */
@keyframes sfb-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-4px);
    }
}

.sfb-animation-bounce {
    animation: sfb-bounce 2s ease-in-out infinite;
}

.sfb-animation-bounce:hover {
    animation: none;
    transform: scale(1.1);
}

/* Shake */
@keyframes sfb-shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(-10deg);
    }
    20% {
        transform: rotate(10deg);
    }
    30% {
        transform: rotate(-8deg);
    }
    40% {
        transform: rotate(8deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

.sfb-animation-shake {
    animation: sfb-shake 3s ease-in-out infinite;
}

.sfb-animation-shake:hover {
    animation: none;
    transform: scale(1.1);
}

/* ===========================
   Responsive Visibility
   =========================== */
@media (max-width: 768px) {
    .sfb-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .sfb-hide-desktop {
        display: none !important;
    }
}

/* ===========================
   Entrance Animation
   =========================== */
@keyframes sfb-entrance {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sfb-float-button {
    animation: sfb-entrance 0.5s ease-out forwards;
}

/* Preserve the specific animation after entrance */
.sfb-animation-pulse {
    animation: sfb-entrance 0.5s ease-out forwards, sfb-pulse 2s ease-in-out 0.5s infinite;
}

.sfb-animation-bounce {
    animation: sfb-entrance 0.5s ease-out forwards, sfb-bounce 2s ease-in-out 0.5s infinite;
}

.sfb-animation-shake {
    animation: sfb-entrance 0.5s ease-out forwards, sfb-shake 3s ease-in-out 0.5s infinite;
}

/* ===========================
   Print - ocultar en impresión
   =========================== */
@media print {
    .sfb-float-button {
        display: none !important;
    }
}
