﻿/* ============================================
   FLOATING BUTTONS CONTAINER
   ============================================ */

.floating-buttons {
    position: fixed;
    bottom: 25px;
    inset-inline-end: 25px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    z-index: 9999;
}

/* RTL Support for Container */
[dir="rtl"] .floating-buttons {
    inset-inline-end: auto;
    inset-inline-start: 25px;
}

/* ============================================
   WHATSAPP BUTTON
   ============================================ */

.whatsapp-float {
    width: 60px;
    height: 60px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    border-radius: 50%;
    font-size: 1.8rem;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: whatsappPulse 2s ease-in-out infinite;
    cursor: pointer;
    opacity: 1;
    visibility: visible;
}


    /* Hover Effect */
    .whatsapp-float:hover {
        transform: scale(1.15) rotate(5deg);
        background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
        box-shadow: 0 12px 35px rgba(37, 211, 102, 0.6), 0 6px 15px rgba(0, 0, 0, 0.4);
        color: #ffffff;
    }

    /* Active State */
    .whatsapp-float:active {
        transform: scale(0.95);
    }

/* Pulse Animation */
@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    50% {
        box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* Icon Animation */
.whatsapp-float i {
    transition: transform 0.3s ease;
}

.whatsapp-float:hover i {
    transform: scale(1.1) rotate(-10deg);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

.back-to-top {
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--satco-gold) 0%, var(--satco-gold-light) 100%);
    color: var(--satco-dark);
    border-radius: 50%;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4), 0 3px 8px rgba(0, 0, 0, 0.3), inset 0 2px 8px rgba(255, 255, 255, 0.3);
    z-index: 9997;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
}

    /* تمت إزالة: [dir="rtl"] .back-to-top { right: auto; left: 25px; } */

    /* Show State */
    .back-to-top.show {
        display: flex;
        opacity: 1;
        animation: slideInUp 0.5s ease-out;
    }

/* Slide In Animation */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hover Effect */
.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    background: linear-gradient(135deg, var(--satco-gold-light) 0%, var(--satco-gold) 100%);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.6), 0 5px 12px rgba(0, 0, 0, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.5);
    color: var(--satco-dark);
}

/* Active State */
.back-to-top:active {
    transform: translateY(-3px) scale(1.05);
}

/* Icon Animation */
.back-to-top i {
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-3px);
    animation: arrowBounce 0.6s ease-in-out infinite;
}

/* Arrow Bounce Animation */
@keyframes arrowBounce {
    0%, 100% {
        transform: translateY(-3px);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Progress Ring */
.back-to-top::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--satco-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.back-to-top:hover::after {
    opacity: 0.6;
    animation: rotateRing 1s linear infinite;
}

@keyframes rotateRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        inset-inline-end: 20px;
    }

    [dir="rtl"] .floating-buttons {
        inset-inline-end: auto;
        inset-inline-start: 20px;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .back-to-top {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .floating-buttons {
        bottom: 18px;
        inset-inline-end: 18px;
        gap: 10px;
    }

    [dir="rtl"] .floating-buttons {
        inset-inline-end: auto;
        inset-inline-start: 18px;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.whatsapp-float:focus,
.back-to-top:focus {
    outline: 2px solid var(--satco-gold);
    outline-offset: 3px;
}

/* ============================================
   PRINT - HIDE BUTTONS
   ============================================ */

@media print {
    .floating-buttons {
        display: none !important;
    }
}
