/* Language Support CSS */

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .timeline::before {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

[dir="rtl"] .timeline-item:nth-child(odd) .timeline-content {
    margin-right: 0;
    margin-left: 55%;
}

[dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
    margin-right: 55%;
    margin-left: 0;
}

[dir="rtl"] .timeline-item:nth-child(odd) .timeline-content::before {
    left: -20px;
    right: auto;
    border-right-color: #f8f9fa;
    border-left-color: transparent;
}

[dir="rtl"] .timeline-item:nth-child(even) .timeline-content::before {
    right: -20px;
    left: auto;
    border-left-color: #f8f9fa;
    border-right-color: transparent;
}

[dir="rtl"] .timeline-item:nth-child(odd) .timeline-date {
    left: -120px;
    right: auto;
}

[dir="rtl"] .timeline-item:nth-child(even) .timeline-date {
    right: -120px;
    left: auto;
}

/* LTR Support for English */
[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .navbar-nav {
    flex-direction: row;
}

/* Language Switcher Enhancements */
.language-switcher {
    position: fixed;
    top: 20px;
    z-index: 1000;
    background: rgba(67, 180, 231, 0.9);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

[dir="ltr"] .language-switcher {
    left: 20px;
}

.language-switcher a {
    color: white;
    text-decoration: none;
    margin: 0 8px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.language-switcher a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
}

.language-switcher a.active {
    background: rgba(255,255,255,0.3);
    font-weight: 600;
}

/* Responsive Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        padding: 8px 12px;
    }

    [dir="rtl"] .language-switcher {
        right: 10px;
    }

    [dir="ltr"] .language-switcher {
        left: 10px;
    }

    .language-switcher a {
        margin: 0 4px;
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* Form Direction Support */
[dir="rtl"] .form-control {
    text-align: right;
}

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

/* Button Direction Support */
[dir="rtl"] .btn-group .btn:not(:last-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

[dir="rtl"] .btn-group .btn:not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

/* Navigation Direction Support */
[dir="rtl"] .navbar-nav .nav-link {
    padding-right: 0;
    padding-left: 1rem;
}

[dir="ltr"] .navbar-nav .nav-link {
    padding-left: 0;
    padding-right: 1rem;
}

/* Footer Direction Support */
[dir="rtl"] .footer-menu ul {
    padding-right: 0;
}

[dir="ltr"] .footer-menu ul {
    padding-left: 0;
}

/* Service Box Direction Support */
[dir="rtl"] .ts-service-box {
    flex-direction: row-reverse;
}

[dir="ltr"] .ts-service-box {
    flex-direction: row;
}

/* Certificate Item Direction Support */
[dir="rtl"] .certificate-item {
    text-align: center;
}

[dir="ltr"] .certificate-item {
    text-align: center;
}

/* Animation for Language Switch */
.language-transition {
    transition: all 0.3s ease;
}

/* Loading State for Language Switch */
.language-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Enhanced Typography for Different Languages */
[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[dir="ltr"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Number Direction Support */
[dir="rtl"] .numbers {
    direction: ltr;
    unicode-bidi: bidi-override;
}

[dir="ltr"] .numbers {
    direction: ltr;
}

/* Date Format Support */
[dir="rtl"] .date-format {
    direction: ltr;
    unicode-bidi: bidi-override;
}

[dir="ltr"] .date-format {
    direction: ltr;
}
