/* =========================================
   FLOATING CTA — Frontend Styles
   ========================================= */

/* Reset & base */
#floating-cta-wrapper {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Positions */
#floating-cta-wrapper.fcta-pos-bottom-right { bottom: 28px; right: 28px; }
#floating-cta-wrapper.fcta-pos-bottom-left  { bottom: 28px; left: 28px; }
#floating-cta-wrapper.fcta-pos-top-right    { top: 28px; right: 28px; }
#floating-cta-wrapper.fcta-pos-top-left     { top: 28px; left: 28px; }

/* Hidden on mobile if option disabled */
@media (max-width: 768px) {
    #floating-cta-wrapper.fcta-hide-mobile { display: none !important; }

    /* On mobile: always bottom-left, round icon only */
    #floating-cta-wrapper {
        bottom: 20px !important;
        left: 20px !important;
        right: auto !important;
        top: auto !important;
    }
    .fcta-label {
        display: none !important;
    }
    .fcta-button {
        border-radius: 50% !important;
        padding: 14px !important;
        width: 52px;
        height: 52px;
    }
}

/* ---- ENTRY ANIMATIONS ---- */
/* Default: hidden */
#floating-cta-wrapper {
    opacity: 0;
    pointer-events: none;
}

#floating-cta-wrapper.fcta-visible {
    opacity: 1;
    pointer-events: all;
}

/* slide-up */
#floating-cta-wrapper.fcta-anim-slide-up {
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#floating-cta-wrapper.fcta-anim-slide-up.fcta-visible {
    transform: translateY(0);
}

/* slide-right */
#floating-cta-wrapper.fcta-anim-slide-right {
    transform: translateX(60px);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#floating-cta-wrapper.fcta-anim-slide-right.fcta-visible {
    transform: translateX(0);
}

/* scale */
#floating-cta-wrapper.fcta-anim-scale {
    transform: scale(0.5);
    transform-origin: bottom right;
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#floating-cta-wrapper.fcta-pos-bottom-left .fcta-anim-scale,
#floating-cta-wrapper.fcta-anim-scale.fcta-pos-bottom-left { transform-origin: bottom left; }
#floating-cta-wrapper.fcta-anim-scale.fcta-visible {
    transform: scale(1);
}

/* fade */
#floating-cta-wrapper.fcta-anim-fade {
    transition: opacity 0.6s ease;
}

/* ---- BUTTON ---- */
.fcta-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: var(--fcta-bg);
    color: var(--fcta-text);
    text-decoration: none !important;
    border-radius: var(--fcta-radius);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.18),
        0 1px 4px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.1);
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease,
        filter 0.2s ease;
    outline: none;
    border: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fcta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.fcta-button:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.25),
        0 4px 10px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.15);
    filter: brightness(1.08);
    color: var(--fcta-text) !important;
    text-decoration: none !important;
}

.fcta-button:active {
    transform: translateY(-1px) scale(0.98);
}

/* ---- ICON ---- */
.fcta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fcta-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--fcta-text);
}

/* ---- LABEL ---- */
.fcta-label {
    display: inline-block;
    line-height: 1;
}

/* ---- PULSE RING ---- */
.fcta-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
}

.fcta-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid var(--fcta-accent);
    opacity: 0;
    animation: fcta-pulse-ring 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    animation-delay: 1.2s;
    border-radius: 40px;
}

@keyframes fcta-pulse-ring {
    0%   { opacity: 0; transform: scale(1); }
    15%  { opacity: 0.6; }
    50%  { opacity: 0; transform: scale(1.25); }
    100% { opacity: 0; transform: scale(1); }
}

/* ---- TOOLTIP ---- */
.fcta-tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    white-space: nowrap;
}

/* Tooltip positioning based on parent position */
.fcta-pos-bottom-right .fcta-tooltip,
.fcta-pos-top-right .fcta-tooltip {
    right: 0;
    bottom: calc(100% + 12px);
    transform: translateY(8px);
}

.fcta-pos-bottom-left .fcta-tooltip,
.fcta-pos-top-left .fcta-tooltip {
    left: 0;
    bottom: calc(100% + 12px);
    transform: translateY(8px);
}

.fcta-button:hover .fcta-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: none;
}

.fcta-tooltip-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow:
        0 20px 40px rgba(0,0,0,0.35),
        0 4px 12px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
}

.fcta-tooltip-inner::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 10px;
    height: 10px;
    background: #0f172a;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

.fcta-pos-bottom-left .fcta-tooltip-inner::after,
.fcta-pos-top-left .fcta-tooltip-inner::after {
    right: auto;
    left: 20px;
}

.fcta-tooltip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--fcta-accent);
    border-radius: 10px;
    flex-shrink: 0;
}

.fcta-tooltip-icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

.fcta-tooltip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fcta-tooltip-text strong {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.fcta-tooltip-text small {
    color: rgba(255,255,255,0.55);
    font-size: 11.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.fcta-tooltip-arrow {
    color: var(--fcta-accent);
    font-size: 16px;
    margin-left: 4px;
    flex-shrink: 0;
}

/* Mobile: no tooltip */
@media (max-width: 768px) {
    .fcta-tooltip { display: none !important; }
}

/* ---- ACCESSIBILITY ---- */
.fcta-button:focus-visible {
    outline: 2px solid var(--fcta-accent);
    outline-offset: 3px;
}
