/* RTL Support and Language Switching Styles */

/* Language Toggle Button */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #006cde 0%, #00e1d5 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 108, 222, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 225, 213, 0.6);
    background: linear-gradient(135deg, #f02356 0%, #901534 100%);
}

.language-toggle i {
    font-size: 16px;
}

/* RTL Adjustments */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .language-toggle {
    right: auto;
    left: 20px;
}

/* Navigation RTL */
[dir="rtl"] #sidebar {
    left: auto;
    right: -280px;
}

[dir="rtl"] #sidebar.active {
    right: 0;
    left: auto;
}

[dir="rtl"] #dismiss i {
    transform: rotate(180deg);
}

/* Header RTL */
[dir="rtl"] .header .btn {
    text-align: left;
}

[dir="rtl"] .logo {
    text-align: right;
}

/* Banner RTL */
[dir="rtl"] .text-bg {
    text-align: right;
}

[dir="rtl"] .carousel-control-prev {
    right: 0;
    left: auto;
}

[dir="rtl"] .carousel-control-next {
    left: 0;
    right: auto;
}

[dir="rtl"] .carousel-control-prev i {
    transform: rotate(180deg);
}

[dir="rtl"] .carousel-control-next i {
    transform: rotate(180deg);
}

/* About Section RTL */
[dir="rtl"] .about .row.d_flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .titlepage {
    text-align: right;
}

/* Choose Section RTL */
[dir="rtl"] .easy {
    text-align: right;
}

[dir="rtl"] .choose_box {
    text-align: right;
}

/* Footer RTL */
[dir="rtl"] .address {
    text-align: right;
}

[dir="rtl"] .location_icon,
[dir="rtl"] .Menu_footer,
[dir="rtl"] .social_icon {
    text-align: right;
}

[dir="rtl"] .social_icon li a i {
    margin-left: 10px;
    margin-right: 0;
}

/* Form RTL */
[dir="rtl"] .contactus,
[dir="rtl"] .textarea,
[dir="rtl"] .enter {
    text-align: right;
    direction: rtl;
}

/* LTR Specific Adjustments */
[dir="ltr"] .text-bg {
    text-align: left;
}

[dir="ltr"] .titlepage {
    text-align: left;
}

[dir="ltr"] .address {
    text-align: left;
}

/* Smooth Language Transition */
* {
    transition: text-align 0.3s ease;
}

/* Improved Button Styles */
.read_more,
.send_btn,
.sub_btn,
.down_btn a {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.read_more:hover,
.send_btn:hover,
.sub_btn:hover,
.down_btn a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Form Validation Styles */
.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Loading Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.send_btn.loading .spinner {
    display: inline-block;
    margin-left: 10px;
}

/* Responsive Language Toggle */
@media (max-width: 768px) {
    .language-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 12px;
    }
    
    [dir="rtl"] .language-toggle {
        right: auto;
        left: 10px;
    }
}

/* Improved Typography for Arabic */
[dir="rtl"] body {
    font-family: 'Cairo', 'Tajawal', 'Poppins', sans-serif;
}

/* استثناء الأيقونات من تطبيق الخط العربي */
[dir="rtl"] i[class*="fa-"],
[dir="rtl"] i[class*="icon-"],
[dir="rtl"] .fa,
[dir="rtl"] .fas,
[dir="rtl"] .far,
[dir="rtl"] .fal,
[dir="rtl"] .fab {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-weight: 700;
}

/* Better spacing for Arabic text */
[dir="rtl"] p {
    line-height: 2;
    letter-spacing: 0;
}

/* Carousel Indicators RTL */
[dir="rtl"] .carousel-indicators {
    direction: ltr;
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    .language-toggle,
    #sidebar,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
}
