/* Modern Footer Styles */
.modern-footer {
    margin-top: auto;
    background: linear-gradient(135deg, #0f172a, #1e293b, #334155) !important;
    border-top: 3px solid #3498db;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100; /* Reduced from 1000 to allow reCAPTCHA on top */
}

/* reCAPTCHA z-index fix - ensure it appears above footer */
.grecaptcha-badge {
    z-index: 9999 !important;
}

/* General reCAPTCHA container fix */
iframe[src*="recaptcha"] {
    z-index: 9999 !important;
}

/* reCAPTCHA popup/modal fix */
div[style*="z-index: 2147483647"] {
    z-index: 9999 !important;
}

/* Ensure body uses flex layout for sticky footer */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Content wrapper to push footer down */
.content {
    flex: 1;
}

/* Footer Links Styling */
.footer-link {
    color: #ecf0f1 !important;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #3498db !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.footer-link i {
    color: #3498db;
    transition: color 0.3s ease;
}

.footer-link:hover i {
    color: #2980b9;
}

/* Social Media Icons */
.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: #ecf0f1 !important;
    text-decoration: none !important;
}

.footer-social:hover {
    background: #3498db;
    color: #fff !important;
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* Specific social media colors on hover */
.footer-social[title="WhatsApp"]:hover {
    background: #25d366;
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.footer-social[title="Facebook"]:hover {
    background: #1877f2;
    box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
}

.footer-social[title="LinkedIn"]:hover {
    background: #0a66c2;
    box-shadow: 0 4px 8px rgba(10, 102, 194, 0.3);
}

.footer-social[title="Google Business"]:hover {
    background: #ea4335;
    box-shadow: 0 4px 8px rgba(234, 67, 53, 0.3);
}

/* Copyright text styling */
.modern-footer .small {
    color: #bdc3c7;
    font-size: 0.85rem;
}

.modern-footer .small a {
    color: #ecf0f1;
    font-weight: 600;
    transition: color 0.3s ease;
}

.modern-footer .small a:hover {
    color: #3498db;
}

/* ================================
   RTL (Right-to-Left) Support
   ================================ */

/* RTL Layout Fixes for Arabic */
[dir="rtl"] .modern-footer .row {
    direction: rtl;
}

[dir="rtl"] .modern-footer .col-lg-4:first-child {
    order: 3; /* Move contact info to right */
    text-align: right;
}

[dir="rtl"] .modern-footer .col-lg-4:nth-child(2) {
    order: 2; /* Keep social links in center */
    text-align: center;
}

[dir="rtl"] .modern-footer .col-lg-4:last-child {
    order: 1; /* Move copyright to left */
    text-align: left;
}

/* RTL Text Direction but keep numbers LTR */
[dir="rtl"] .footer-link {
    direction: rtl;
    text-align: right;
}

/* Fix phone number and email to display LTR in RTL mode */
[dir="rtl"] .footer-link[href^="tel:"],
[dir="rtl"] .footer-link[href^="mailto:"] {
    direction: ltr;
    text-align: right;
    unicode-bidi: embed;
}

[dir="rtl"] .footer-link i {
    margin-left: 8px;
    margin-right: 0;
}

/* Specific fix for phone numbers - always LTR */
[dir="rtl"] .footer-link[href^="tel:"] {
    display: inline-flex;
    align-items: center;
}

/* RTL Gap fixes */
[dir="rtl"] .modern-footer .d-flex.gap-3 {
    flex-direction: row-reverse;
}

/* RTL Copyright alignment */
[dir="rtl"] .modern-footer .small {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .modern-footer .small .me-3 {
    margin-left: 1rem;
    margin-right: 0;
}

/* RTL Responsive adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .modern-footer .col-lg-4 {
        text-align: center !important;
        order: unset !important;
    }

    [dir="rtl"] .footer-link {
        text-align: center;
    }

    [dir="rtl"] .footer-link[href^="tel:"],
    [dir="rtl"] .footer-link[href^="mailto:"] {
        justify-content: center;
        text-align: center;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .modern-footer {
        text-align: center;
    }

    .modern-footer .col-lg-4 {
        text-align: center !important;
        margin-bottom: 1rem;
    }

    .footer-link {
        font-size: 0.8rem;
        display: block;
        margin-bottom: 0.5rem;
    }

    .footer-social {
        margin: 0 5px;
    }
}

/* Dark theme compatibility */
body.dark-theme .modern-footer {
    background: linear-gradient(135deg, #1a1a1a, #2d2d30) !important;
    border-top-color: #007acc;
}

/* Animation for footer appearance */
.modern-footer {
    animation: footerSlideUp 0.5s ease-out;
}

@keyframes footerSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Print styles - hide footer when printing */
@media print {
    .modern-footer {
        display: none;
    }
}