/* assets/css/fab-style.css */

/* Base and Container Reset */
.floating-button-container {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 1000;
    /* Basic reset for container context */
    font-family: sans-serif;
    line-height: normal;
    font-size: 1rem;
}
/* Reset styles for all elements within the container */
.floating-button-container *,
.floating-button-container *::before,
.floating-button-container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    background: transparent;
    text-decoration: none;
    color: inherit;
    line-height: normal;
}

/* Main Floating Button - High Specificity */
body .floating-button-container button.floating-button.main-button {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--fab-accent-color, #486cef); /* Accent color variable */
    border-radius: 50% !important; /* Ensure roundness */
    border: none !important;
    padding: 0 !important; /* Ensure no padding */
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.3); /* Initial shadow */
    cursor: pointer;
    width: 50px !important; /* Fixed size */
    height: 50px !important; /* Fixed size */
    min-width: 50px;
    min-height: 50px;
    position: relative;
    transition: background-color 0.3s, box-shadow 0.3s;
    overflow: hidden; /* Clip icon animation */
    /* Enhanced shadow pulse animation */
    animation: pulse-shadow-enhanced 1.5s infinite;
    /* Text style reset */
    font-family: sans-serif !important;
    font-size: 1rem !important;
    line-height: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: white !important; /* Default icon/content color */
    appearance: none !important; /* Reset default button appearance */
    -webkit-appearance: none !important;
}

/* Wrapper for the icon inside the main button */
body .floating-button-container button.floating-button .main-icon-wrapper {
    width: 25px;  /* Icon container size */
    height: 25px; /* Icon container size */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit; /* Inherit color (white) from button */
    padding: 0; /* Default padding */
    margin: 0;
    border: none;
    box-sizing: border-box; /* Correct padding calculation */
    /* Optional transition for padding change */
    /* transition: padding 0.1s ease-out; */
}

.main-icon-wrapper img.main-button-icon[src$="/icons/telegram.svg"] {
 padding: 4px 2px 4px 0px !important;
}

/* The icon image itself inside the main button */
body .floating-button-container button.floating-button .main-icon-wrapper img.main-button-icon {
    display: block;
    /* Width/Height 100% refers to the available space inside the wrapper (after padding) */
    width: 100%;
    height: 100%;
    position: absolute; /* Remains absolute for slide animation */
    top: 0;
    left: 0;
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.320, 1.275),
                opacity 0.4s ease-in-out;
    object-fit: contain; /* Ensure icon fits without distortion */
    padding: 0; /* No padding on the image itself */
    margin: 0;
    border: none;
    max-width: none; /* Override theme constraints */
    box-sizing: border-box;
}

/* Animation States for main button icon */
body .floating-button-container button.floating-button .main-icon-wrapper img.main-button-icon.slide-out {
    transform: translateX(-120%);
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}
body .floating-button-container button.floating-button .main-icon-wrapper img.main-button-icon.slide-in {
    transform: translateX(120%);
    opacity: 0;
}
/* Utility class to disable transitions for instant changes */
body .floating-button-container button.floating-button .main-icon-wrapper img.main-button-icon.no-transition {
     transition: none !important;
}

/* Pulse Ring Animation (Background) - High Specificity */
body .floating-button-container button.floating-button.main-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    /* Ring color with more opacity using color-mix */
    background: color-mix(in srgb, var(--fab-accent-color, #486cef) 50%, transparent);
    transform: translate(-50%, -50%);
    /* Ring animation */
    animation: pulse-ring 1.5s infinite;
    z-index: -1; /* Behind button content */
    display: block; /* Ensure visibility */
}

/* Keyframes for the outer pulse ring - More prominent */
@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.95); /* Start slightly larger */
        opacity: 0.8; /* Start more opaque */
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2); /* End significantly larger */
        opacity: 0;
    }
}

/* Keyframes for the button shadow pulse - ENHANCED */
@keyframes pulse-shadow-enhanced {
    0% {
        /* Initial shadow + subtle outer glow */
        box-shadow: 0 8px 10px color-mix(in srgb, var(--fab-accent-color, #486cef) 30%, transparent),
                    0 0 0 0 color-mix(in srgb, var(--fab-accent-color, #486cef) 35%, transparent);
    }
    70% {
        /* Peak shadow + wider, more visible outer glow */
         box-shadow: 0 10px 15px color-mix(in srgb, var(--fab-accent-color, #486cef) 40%, transparent), /* Slightly stronger main shadow */
                     0 0 0 20px color-mix(in srgb, var(--fab-accent-color, #486cef) 0%, transparent); /* Significantly increased glow radius */
    }
    100% {
        /* Return to initial shadow + faded glow */
         box-shadow: 0 8px 10px color-mix(in srgb, var(--fab-accent-color, #486cef) 30%, transparent),
                     0 0 0 0 color-mix(in srgb, var(--fab-accent-color, #486cef) 0%, transparent);
    }
}

/* Social Buttons Container */
.floating-button-container .social-buttons {
    display: flex;
    position: absolute;
    bottom: 65px; /* Position above the main button */
    right: 0;
    flex-direction: column;
    gap: 10px; /* Spacing */
    align-items: center;
    opacity: 0; /* Hidden by default */
    transform: translateY(10px); /* Start slightly lower for animation */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none; /* Not interactive when hidden */
}

/* Individual Social Buttons (Links) - High Specificity */
body .floating-button-container .social-buttons a.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px !important; /* Fixed size */
    height: 50px !important; /* Fixed size */
    min-width: 50px;
    min-height: 50px;
    border-radius: 50% !important; /* Ensure roundness */
    border: none !important;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px !important; /* Default shadow */
    cursor: pointer;
    text-decoration: none !important; /* No underline */
    color: white !important; /* Default icon color */
    transition: transform 0.2s ease-out, box-shadow 0.3s ease-out;
    padding: 0 !important; /* Ensure no padding */
    background-color: transparent; /* Base background, overridden by inline style from JS */
}

/* Icon image within social buttons */
body .floating-button-container .social-buttons a.social-button img {
    display: block;
    width: 25px !important; /* Fixed icon size */
    height: 25px !important; /* Fixed icon size */
    object-fit: contain;
    padding: 0; /* Reset padding */
    margin: 0;
    border: none;
    max-width: none; /* Override theme constraints */
}

/* Specific padding for Telegram icon within social buttons */
body .floating-button-container .social-buttons a.social-telegram img {
    /* Apply padding if needed for visual alignment in social button */
     padding: 4px 2px 4px 0px !important;
}

/* Hover effect for Social Buttons */
body .floating-button-container .social-buttons a.social-button:hover {
    transform: scale(1.1); /* Enlarge slightly */
    /* Hover shadow */
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2) !important;
}

/* Active State: When the menu is open */
.floating-button-container.active .social-buttons {
    opacity: 1; /* Make visible */
    transform: translateY(0); /* Animate to final position */
    pointer-events: auto; /* Make interactive */
}
/* Active State: Stop animations on main button */
.floating-button-container.active button.floating-button.main-button {
    animation: none !important; /* Stop shadow pulse */
}
.floating-button-container.active button.floating-button.main-button::before {
    animation: none !important; /* Stop ring pulse */
    opacity: 0 !important; /* Hide ring */
    display: none; /* Can also hide completely */
}