/**
 * Floating CTA Buttons
 * כפתורי קריאה לפעולה צפים
 */

/* ==========================================
   Floating Action Buttons Container
   ========================================== */

.floating-cta-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

[dir="rtl"] .floating-cta-container {
    right: auto;
    left: var(--space-6);
}

/* ==========================================
   Individual Floating Buttons
   ========================================== */

.floating-cta-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
    animation: floatBounce 3s ease-in-out infinite;
}

.floating-cta-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: var(--shadow-2xl);
}

/* WhatsApp Button */
.floating-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.floating-whatsapp:hover {
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

/* Phone Button */
.floating-phone {
    background: var(--gradient-primary);
    color: white;
}

.floating-phone:hover {
    box-shadow: var(--shadow-primary);
}

/* Icon */
.floating-cta-btn i {
    font-size: 26px;
}

/* ==========================================
   Label on Hover
   ========================================== */

.floating-cta-btn::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + var(--space-3));
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition-base);
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .floating-cta-btn::before {
    right: auto;
    left: calc(100% + var(--space-3));
    transform: translateX(-10px);
}

.floating-cta-btn:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Arrow for label */
.floating-cta-btn::after {
    content: '';
    position: absolute;
    right: calc(100% + var(--space-1));
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: var(--transition-base);
    pointer-events: none;
}

[dir="rtl"] .floating-cta-btn::after {
    right: auto;
    left: calc(100% + var(--space-1));
    border-left-color: transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
}

.floating-cta-btn:hover::after {
    opacity: 1;
}

/* ==========================================
   Pulse Animation
   ========================================== */

.floating-cta-btn .pulse-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: var(--radius-full);
    border: 2px solid currentColor;
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ==========================================
   Bounce Animation
   ========================================== */

@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================
   Badge Counter (for notifications)
   ========================================== */

.floating-cta-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    box-shadow: var(--shadow-md);
    animation: badgePulse 2s ease-in-out infinite;
}

[dir="rtl"] .floating-cta-badge {
    right: auto;
    left: -4px;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ==========================================
   Mobile Bottom Bar
   ========================================== */

.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    padding: var(--space-3);
    z-index: var(--z-sticky);
}

.mobile-cta-bar .cta-buttons {
    display: flex;
    gap: var(--space-3);
}

.mobile-cta-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
}

.mobile-cta-button.whatsapp {
    background: #25D366;
    color: white;
}

.mobile-cta-button.phone {
    background: var(--primary-600);
    color: white;
}

.mobile-cta-button:active {
    transform: scale(0.95);
}

/* ==========================================
   Click-to-Call Animation
   ========================================== */

.floating-cta-btn.ringing {
    animation: ring 1s ease-in-out infinite;
}

@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50% {
        transform: rotate(-10deg);
    }
    20%, 40%, 60% {
        transform: rotate(10deg);
    }
}

/* ==========================================
   Hide on Scroll Down, Show on Scroll Up
   ========================================== */

.floating-cta-container.hidden {
    transform: translateY(150%);
    transition: transform var(--duration-300) var(--ease-in-out);
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .floating-cta-container {
        bottom: var(--space-4);
        right: var(--space-4);
    }
    
    [dir="rtl"] .floating-cta-container {
        right: auto;
        left: var(--space-4);
    }
    
    .floating-cta-btn {
        width: 56px;
        height: 56px;
    }
    
    .floating-cta-btn i {
        font-size: 24px;
    }
    
    /* Show mobile bar on mobile */
    .mobile-cta-bar {
        display: block;
    }
    
    /* Hide floating buttons on mobile (or keep them) */
    /* .floating-cta-container {
        display: none;
    } */
}

@media (max-width: 576px) {
    .floating-cta-btn {
        width: 50px;
        height: 50px;
    }
    
    .floating-cta-btn i {
        font-size: 22px;
    }
}

/* ==========================================
   RTL Adjustments
   ========================================== */

[dir="rtl"] .mobile-cta-bar .cta-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-cta-button {
    flex-direction: row-reverse;
}

