/* ===== JCB Floating Buttons ===== */
.jcb-floating-buttons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999999;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.jcb-floating-buttons * {
    box-sizing: border-box;
}

/* ===== Button Wrappers ===== */
.jcb-button-wrapper {
    position: fixed;
    bottom: var(--jcb-bottom-position, 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    z-index: 999999;
}

.jcb-call-wrapper {
    right: 25px;
}

.jcb-wa-wrapper {
    left: 25px;
}

/* ===== Buttons ===== */
.jcb-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--jcb-button-size, 60px);
    height: var(--jcb-button-size, 60px);
    border-radius: 50%;
    text-decoration: none !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    outline: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.jcb-call-button {
    background: var(--jcb-call-color, #25D366);
    color: var(--jcb-call-icon-color, #ffffff) !important;
}

.jcb-wa-button {
    background: var(--jcb-wa-color, #25D366);
    color: var(--jcb-wa-icon-color, #ffffff) !important;
}

.jcb-button:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
}

.jcb-button:active {
    transform: scale(0.95);
}

/* ===== Icon ===== */
.jcb-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: inherit;
}

/* ===== Badge ===== */
.jcb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--jcb-badge-color, #ff3b30);
    color: var(--jcb-badge-text-color, #ffffff);
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
    animation: jcb-badge-pulse 2s ease-in-out infinite;
    border: 2px solid white;
}

@keyframes jcb-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ===== Labels ===== */
.jcb-button-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    order: -1;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.jcb-button-wrapper:hover .jcb-button-label,
.jcb-button-wrapper.jcb-show-label .jcb-button-label {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Pulse Ring Animation ===== */
.jcb-button.jcb-pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    animation: jcb-pulse-ring 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

.jcb-call-button.jcb-pulse::before {
    border: 3px solid var(--jcb-call-color, #25D366);
}

.jcb-wa-button.jcb-pulse::before {
    border: 3px solid var(--jcb-wa-color, #25D366);
}

@keyframes jcb-pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ===== Entrance Animations ===== */

/* Bounce */
.jcb-anim-bounce .jcb-call-wrapper {
    animation: jcb-bounceInRight 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.jcb-anim-bounce .jcb-wa-wrapper {
    animation: jcb-bounceInLeft 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes jcb-bounceInRight {
    0% { transform: translateX(120px); opacity: 0; }
    60% { transform: translateX(-15px); opacity: 1; }
    80% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

@keyframes jcb-bounceInLeft {
    0% { transform: translateX(-120px); opacity: 0; }
    60% { transform: translateX(15px); opacity: 1; }
    80% { transform: translateX(-8px); }
    100% { transform: translateX(0); }
}

/* Fade */
.jcb-anim-fade .jcb-button-wrapper {
    animation: jcb-fadeIn 0.8s ease;
}

@keyframes jcb-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide */
.jcb-anim-slide .jcb-call-wrapper {
    animation: jcb-slideRight 0.6s ease;
}

.jcb-anim-slide .jcb-wa-wrapper {
    animation: jcb-slideLeft 0.6s ease;
}

@keyframes jcb-slideRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes jcb-slideLeft {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scale */
.jcb-anim-scale .jcb-button-wrapper {
    animation: jcb-scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes jcb-scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    .jcb-call-wrapper {
        right: 15px;
    }

    .jcb-wa-wrapper {
        left: 15px;
    }

    .jcb-button {
        width: calc(var(--jcb-button-size, 60px) - 6px);
        height: calc(var(--jcb-button-size, 60px) - 6px);
    }

    .jcb-icon {
        width: 24px;
        height: 24px;
    }

    .jcb-button-label {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* ===== Print: Hide buttons ===== */
@media print {
    .jcb-floating-buttons {
        display: none !important;
    }
}

/* ===== Accessibility ===== */
.jcb-button:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

/* ===== RTL Support ===== */
[dir="rtl"] .jcb-badge {
    right: auto;
    left: -4px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .jcb-button,
    .jcb-button-label,
    .jcb-badge,
    .jcb-button-wrapper {
        animation: none !important;
        transition: none !important;
    }

    .jcb-button.jcb-pulse::before {
        animation: none !important;
    }
}