/**
 * Frontend styles for Floating Social Buttons.
 */

#fsb-floating-sidebar {
    position: fixed;
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fsb-buttons-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

/* Base button style */
.fsb-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
}

.fsb-icon-holder {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.fsb-icon-holder svg {
    width: 100%;
    height: 100%;
}

/* Dynamic layouts based on position */
#fsb-floating-sidebar.fsb-position-left {
    left: 0;
}

#fsb-floating-sidebar.fsb-position-right {
    right: 0;
}

/* Corner styles & stacking */
/* Square: stacked together with no margin */
#fsb-floating-sidebar.fsb-shape-square .fsb-buttons-wrapper {
    gap: 0;
}
#fsb-floating-sidebar.fsb-shape-square .fsb-button {
    border-radius: 0;
}

/* Rounded: outer corners rounded, stacked together */
#fsb-floating-sidebar.fsb-shape-rounded .fsb-buttons-wrapper {
    gap: 0;
}
#fsb-floating-sidebar.fsb-shape-rounded.fsb-position-left .fsb-button:first-child {
    border-top-right-radius: 8px;
}
#fsb-floating-sidebar.fsb-shape-rounded.fsb-position-left .fsb-button:last-child {
    border-bottom-right-radius: 8px;
}
#fsb-floating-sidebar.fsb-shape-rounded.fsb-position-right .fsb-button:first-child {
    border-top-left-radius: 8px;
}
#fsb-floating-sidebar.fsb-shape-rounded.fsb-position-right .fsb-button:last-child {
    border-bottom-left-radius: 8px;
}

/* Circle: separated buttons, fully round */
#fsb-floating-sidebar.fsb-shape-circle .fsb-buttons-wrapper {
    gap: 8px;
}
#fsb-floating-sidebar.fsb-shape-circle .fsb-button {
    border-radius: 50%;
    margin-left: 5px;
    margin-right: 5px;
}

/* Hover effects */
/* Slide-out: shifts slightly on hover */
#fsb-floating-sidebar.fsb-hover-slide.fsb-position-left .fsb-button {
    transform: translateX(0);
}
#fsb-floating-sidebar.fsb-hover-slide.fsb-position-left .fsb-button:hover {
    transform: translateX(6px);
    box-shadow: 2px 4px 15px rgba(0, 0, 0, 0.2);
}
#fsb-floating-sidebar.fsb-hover-slide.fsb-position-right .fsb-button {
    transform: translateX(0);
}
#fsb-floating-sidebar.fsb-hover-slide.fsb-position-right .fsb-button:hover {
    transform: translateX(-6px);
    box-shadow: -2px 4px 15px rgba(0, 0, 0, 0.2);
}

/* Zoom: scales the button */
#fsb-floating-sidebar.fsb-hover-zoom .fsb-button:hover {
    transform: scale(1.12);
    z-index: 10;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-radius: 4px;
}
#fsb-floating-sidebar.fsb-hover-zoom.fsb-shape-circle .fsb-button:hover {
    border-radius: 50%;
}

/* Micro-animations inside the buttons */
.fsb-button:hover .fsb-icon-holder {
    transform: scale(1.1);
}

/* Tooltips */
.fsb-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background-color: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 6px 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 99;
}

/* Tooltip position based on side */
#fsb-floating-sidebar.fsb-position-left .fsb-tooltip {
    left: calc(100% + 10px);
}
#fsb-floating-sidebar.fsb-position-left .fsb-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent rgba(17, 17, 17, 0.95) transparent transparent;
}

#fsb-floating-sidebar.fsb-position-right .fsb-tooltip {
    right: calc(100% + 10px);
}
#fsb-floating-sidebar.fsb-position-right .fsb-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(17, 17, 17, 0.95);
}

/* Show tooltip on button hover */
.fsb-button:hover .fsb-tooltip {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Collapsible items style (Drawer menu) */
.fsb-button.fsb-item-collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    box-shadow: none;
    transform: scale(0.8);
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease;
}

/* When sidebar expands (class added by JS) */
#fsb-floating-sidebar.fsb-expanded .fsb-button.fsb-item-collapsed {
    max-height: 80px; /* high enough to fit */
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Expand toggle button animation */
.fsb-expand-toggle-button .fsb-plus-icon {
    transition: transform 0.3s ease;
}
#fsb-floating-sidebar.fsb-expanded .fsb-expand-toggle-button .fsb-plus-icon {
    transform: rotate(45deg);
}

/* Hide on mobile media query */
@media (max-width: 767px) {
    #fsb-floating-sidebar.fsb-hide-mobile {
        display: none !important;
    }
    
    /* If shown on mobile, scale it down slightly so it is less obtrusive */
    #fsb-floating-sidebar:not(.fsb-hide-mobile) .fsb-button {
        width: 38px !important;
        height: 38px !important;
    }
    #fsb-floating-sidebar:not(.fsb-hide-mobile) .fsb-icon-holder {
        width: 18px !important;
        height: 18px !important;
    }
    #fsb-floating-sidebar:not(.fsb-hide-mobile).fsb-shape-circle .fsb-button {
        margin-left: 2px;
        margin-right: 2px;
    }
}

/* --- Iframe Modal Styles --- */
.fsb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.7); /* slate-900 with transparency */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fsb-modal-overlay.fsb-modal-show {
    opacity: 1;
    pointer-events: auto;
}

.fsb-modal-container {
    background: #ffffff;
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* bouncy entry */
}

.fsb-modal-overlay.fsb-modal-show .fsb-modal-container {
    transform: scale(1);
}

.fsb-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
    border: none;
    outline: none;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.fsb-modal-close:hover {
    background-color: #ef4444;
    color: #ffffff;
}

.fsb-modal-content {
    width: 100%;
    height: 100%;
}

#fsb-modal-iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}

@media (max-width: 767px) {
    .fsb-modal-container {
        height: 70%;
        border-radius: 12px;
    }
    .fsb-modal-close {
        top: 10px;
        right: 10px;
    }
}

