/* CRITICAL: Force load Font Awesome - Multiple Fallbacks */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Font Awesome Emergency Fixes - Force Icons to Show */
.contact-btn i, 
.contact-btn .fa, 
.contact-btn .fab, 
.contact-btn .fas, 
.contact-btn .far {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome", sans-serif !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    line-height: 1 !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    width: auto !important;
    height: auto !important;
    text-transform: none !important;
    vertical-align: baseline !important;
}

/* Brand icons specific fix */
.contact-btn .fab {
    font-family: "Font Awesome 6 Brands", "FontAwesome", sans-serif !important;
    font-weight: 400 !important;
}

/* Fallback content for icons if font fails */
.whatsapp-btn i:before { content: "\f232" !important; }
.phone-btn i:before { content: "\f095" !important; }
.email-btn i:before { content: "\f0e0" !important; }

/* Floating Contact Buttons - Modern & Elegant */
.floating-contact-buttons {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    z-index: 99999 !important;
    direction: ltr !important;
    pointer-events: auto !important;
}

/* الموقع الأيسر */
.floating-contact-buttons-left {
    position: fixed !important;
    left: 20px !important;
    bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    z-index: 99999 !important;
    direction: ltr !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* الأزرار بجانب بعض أفقياً */
.floating-contact-buttons-horizontal {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    z-index: 99999 !important;
    direction: ltr !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* الأزرار بجانب بعض أفقياً - الجانب الأيسر */
.floating-contact-buttons-horizontal-left {
    position: fixed !important;
    left: 20px !important;
    bottom: 20px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    z-index: 99999 !important;
    direction: ltr !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.floating-contact-buttons .contact-btn,
.floating-contact-buttons-left .contact-btn,
.floating-contact-buttons-horizontal .contact-btn,
.floating-contact-buttons-horizontal-left .contact-btn {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: white !important;
    font-size: 24px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    overflow: hidden !important;
    pointer-events: auto !important;
}

.floating-contact-buttons .contact-btn::before,
.floating-contact-buttons-left .contact-btn::before,
.floating-contact-buttons-horizontal .contact-btn::before,
.floating-contact-buttons-horizontal-left .contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3));
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-contact-buttons .contact-btn:hover::before,
.floating-contact-buttons-left .contact-btn:hover::before,
.floating-contact-buttons-horizontal .contact-btn:hover::before,
.floating-contact-buttons-horizontal-left .contact-btn:hover::before {
    opacity: 1;
}

.floating-contact-buttons .contact-btn:hover,
.floating-contact-buttons-left .contact-btn:hover,
.floating-contact-buttons-horizontal .contact-btn:hover,
.floating-contact-buttons-horizontal-left .contact-btn:hover {
    transform: scale(1.1) translateY(-5px) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}

/* WhatsApp Button */
.floating-contact-buttons .whatsapp-btn,
.floating-contact-buttons-left .whatsapp-btn,
.floating-contact-buttons-horizontal .whatsapp-btn,
.floating-contact-buttons-horizontal-left .whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    animation: pulse-whatsapp 2s infinite;
}

.floating-contact-buttons .whatsapp-btn:hover,
.floating-contact-buttons-left .whatsapp-btn:hover,
.floating-contact-buttons-horizontal .whatsapp-btn:hover,
.floating-contact-buttons-horizontal-left .whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E, #25D366) !important;
}

/* Phone Button */
.floating-contact-buttons .phone-btn,
.floating-contact-buttons-left .phone-btn,
.floating-contact-buttons-horizontal .phone-btn,
.floating-contact-buttons-horizontal-left .phone-btn {
    background: linear-gradient(135deg, #007BFF, #0056B3) !important;
    animation: pulse-phone 2.5s infinite;
}

.floating-contact-buttons .phone-btn:hover,
.floating-contact-buttons-left .phone-btn:hover,
.floating-contact-buttons-horizontal .phone-btn:hover,
.floating-contact-buttons-horizontal-left .phone-btn:hover {
    background: linear-gradient(135deg, #0056B3, #007BFF) !important;
}

/* Email Button */
.floating-contact-buttons .email-btn,
.floating-contact-buttons-left .email-btn,
.floating-contact-buttons-horizontal .email-btn,
.floating-contact-buttons-horizontal-left .email-btn {
    background: linear-gradient(135deg, #DC3545, #A71E2A) !important;
    animation: pulse-email 3s infinite;
}

.floating-contact-buttons .email-btn:hover,
.floating-contact-buttons-left .email-btn:hover,
.floating-contact-buttons-horizontal .email-btn:hover,
.floating-contact-buttons-horizontal-left .email-btn:hover {
    background: linear-gradient(135deg, #A71E2A, #DC3545) !important;
}

/* Pulse Animations */
@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6);
    }
}

@keyframes pulse-phone {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(0, 123, 255, 0.6);
    }
}

@keyframes pulse-email {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(220, 53, 69, 0.6);
    }
}

/* Tooltip Styles */
.floating-contact-buttons .contact-btn .tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    direction: rtl;
}

.floating-contact-buttons-left .contact-btn .tooltip {
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    direction: rtl;
}

/* Tooltips للترتيب الأفقي */
.floating-contact-buttons-horizontal .contact-btn .tooltip,
.floating-contact-buttons-horizontal-left .contact-btn .tooltip {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    direction: rtl;
}

.floating-contact-buttons .contact-btn .tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.8);
}

.floating-contact-buttons-left .contact-btn .tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.floating-contact-buttons-horizontal .contact-btn .tooltip::after,
.floating-contact-buttons-horizontal-left .contact-btn .tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.floating-contact-buttons .contact-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-10px);
}

.floating-contact-buttons-left .contact-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(10px);
}

.floating-contact-buttons-horizontal .contact-btn:hover .tooltip,
.floating-contact-buttons-horizontal-left .contact-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* Icon Styles */
.floating-contact-buttons .contact-btn i,
.floating-contact-buttons-left .contact-btn i,
.floating-contact-buttons-horizontal .contact-btn i,
.floating-contact-buttons-horizontal-left .contact-btn i {
    font-size: 28px !important;
    transition: transform 0.3s ease;
    font-weight: normal !important;
}

.floating-contact-buttons .contact-btn:hover i,
.floating-contact-buttons-left .contact-btn:hover i,
.floating-contact-buttons-horizontal .contact-btn:hover i,
.floating-contact-buttons-horizontal-left .contact-btn:hover i {
    transform: rotate(10deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-contact-buttons,
    .floating-contact-buttons-horizontal {
        right: 15px !important;
        bottom: 15px !important;
        gap: 12px !important;
    }
    
    .floating-contact-buttons-left,
    .floating-contact-buttons-horizontal-left {
        left: 15px !important;
        bottom: 15px !important;
        gap: 12px !important;
    }
    
    .floating-contact-buttons .contact-btn,
    .floating-contact-buttons-left .contact-btn,
    .floating-contact-buttons-horizontal .contact-btn,
    .floating-contact-buttons-horizontal-left .contact-btn {
        width: 55px !important;
        height: 55px !important;
        font-size: 22px !important;
    }
    
    .floating-contact-buttons .contact-btn i,
    .floating-contact-buttons-left .contact-btn i,
    .floating-contact-buttons-horizontal .contact-btn i,
    .floating-contact-buttons-horizontal-left .contact-btn i {
        font-size: 24px !important;
    }
    
    .floating-contact-buttons .contact-btn .tooltip,
    .floating-contact-buttons-left .contact-btn .tooltip,
    .floating-contact-buttons-horizontal .contact-btn .tooltip,
    .floating-contact-buttons-horizontal-left .contact-btn .tooltip {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    .floating-contact-buttons .contact-btn .tooltip {
        right: 65px !important;
    }
    
    .floating-contact-buttons-left .contact-btn .tooltip {
        left: 65px !important;
    }
}

@media (max-width: 480px) {
    .floating-contact-buttons,
    .floating-contact-buttons-horizontal {
        right: 10px !important;
        bottom: 10px !important;
        gap: 10px !important;
    }
    
    .floating-contact-buttons-left,
    .floating-contact-buttons-horizontal-left {
        left: 10px !important;
        bottom: 10px !important;
        gap: 10px !important;
    }
    
    .floating-contact-buttons .contact-btn,
    .floating-contact-buttons-left .contact-btn,
    .floating-contact-buttons-horizontal .contact-btn,
    .floating-contact-buttons-horizontal-left .contact-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    .floating-contact-buttons .contact-btn i,
    .floating-contact-buttons-left .contact-btn i,
    .floating-contact-buttons-horizontal .contact-btn i,
    .floating-contact-buttons-horizontal-left .contact-btn i {
        font-size: 22px !important;
    }
    
    .floating-contact-buttons .contact-btn .tooltip,
    .floating-contact-buttons-left .contact-btn .tooltip,
    .floating-contact-buttons-horizontal .contact-btn .tooltip,
    .floating-contact-buttons-horizontal-left .contact-btn .tooltip {
        display: none !important; /* Hide tooltips on very small screens */
    }
}

/* Smooth entrance animation */
.floating-contact-buttons {
    animation: slideInUp 0.6s ease-out;
}

.floating-contact-buttons-left {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Individual button entrance animations with delay */
.floating-contact-buttons .contact-btn:nth-child(1) {
    animation: slideInButton 0.6s ease-out 0.1s both;
}

.floating-contact-buttons .contact-btn:nth-child(2) {
    animation: slideInButton 0.6s ease-out 0.2s both;
}

.floating-contact-buttons .contact-btn:nth-child(3) {
    animation: slideInButton 0.6s ease-out 0.3s both;
}

.floating-contact-buttons-left .contact-btn:nth-child(1) {
    animation: slideInButtonLeft 0.6s ease-out 0.1s both;
}

.floating-contact-buttons-left .contact-btn:nth-child(2) {
    animation: slideInButtonLeft 0.6s ease-out 0.2s both;
}

.floating-contact-buttons-left .contact-btn:nth-child(3) {
    animation: slideInButtonLeft 0.6s ease-out 0.3s both;
}

@keyframes slideInButton {
    from {
        transform: translateX(100px) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInButtonLeft {
    from {
        transform: translateX(-100px) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Special glow effect on hover */
.floating-contact-buttons .contact-btn:hover {
    filter: brightness(1.1);
}

.floating-contact-buttons-left .contact-btn:hover {
    filter: brightness(1.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .floating-contact-buttons .contact-btn .tooltip,
    .floating-contact-buttons-left .contact-btn .tooltip {
        background: rgba(255, 255, 255, 0.9);
        color: #333;
    }
    
    .floating-contact-buttons .contact-btn .tooltip::after {
        border-right-color: rgba(255, 255, 255, 0.9);
    }
    
    .floating-contact-buttons-left .contact-btn .tooltip::after {
        border-left-color: rgba(255, 255, 255, 0.9);
    }
}