/* RTL Support for Arabic Language */

/* Global RTL styles */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body {
    text-align: right;
}

/* Navigation adjustments */

/* Spacing adjustments */
html[dir="rtl"] .space-x-8 > * + * {
    margin-left: 0;
    margin-right: 2rem;
}

html[dir="rtl"] .space-x-4 > * + * {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .space-x-2 > * + * {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .gap-4 {
    gap: 1rem;
}

html[dir="rtl"] .gap-2 {
    gap: 0.5rem;
}

/* Margin and padding adjustments */
html[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 0.75rem;
}

html[dir="rtl"] .ml-4 {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .pl-4 {
    padding-left: 0;
    padding-right: 1rem;
}

html[dir="rtl"] .pr-4 {
    padding-right: 0;
    padding-left: 1rem;
}

/* Text alignment */
html[dir="rtl"] .text-left {
    text-align: right;
}

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

html[dir="rtl"] .md\:text-left {
    text-align: right;
}

html[dir="rtl"] .md\:text-right {
    text-align: left;
}

/* Justify content */
html[dir="rtl"] .justify-start {
    justify-content: flex-end;
}

html[dir="rtl"] .justify-end {
    justify-content: flex-start;
}

html[dir="rtl"] .md\:justify-start {
    justify-content: flex-end;
}

html[dir="rtl"] .md\:justify-end {
    justify-content: flex-start;
}

/* Grid adjustments */
html[dir="rtl"] .grid-cols-2 > * {
    text-align: right;
}

/* Timeline adjustments */
html[dir="rtl"] .border-l-2 {
    border-left: none;
    border-right: 2px solid;
}

html[dir="rtl"] .-left-\[7px\] {
    left: auto;
    right: -7px;
}

/* Button and form adjustments */
html[dir="rtl"] .flex-wrap {
    flex-direction: row-reverse;
}

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

/* Icon adjustments */
html[dir="rtl"] .fa-envelope::before,
html[dir="rtl"] .fa-phone::before,
html[dir="rtl"] .fa-map-marker-alt::before {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Progress bar and skills section */
html[dir="rtl"] .justify-between {
    flex-direction: row-reverse;
}

/* Footer adjustments */
html[dir="rtl"] .justify-between {
    justify-content: space-between;
}

html[dir="rtl"] footer .flex {
    flex-direction: column-reverse;
}

html[dir="rtl"] footer .md\:flex-row {
    flex-direction: row-reverse;
}

/* Form adjustments */
html[dir="rtl"] input,
html[dir="rtl"] textarea {
    text-align: right;
}

html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder {
    text-align: right;
}

/* Language switcher */
html[dir="rtl"] .lang-btn {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[dir="rtl"] .lang-btn:first-child {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Achievement cards */
html[dir="rtl"] .grid-cols-1.sm\:grid-cols-2 {
    direction: rtl;
}

/* Project cards */
html[dir="rtl"] .hover\:underline {
    text-align: right;
}

/* Mobile menu */
html[dir="rtl"] .flex-col {
    text-align: right;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    html[dir="rtl"] .md\:w-1\/2 {
        text-align: right;
    }
    
    html[dir="rtl"] .text-center {
        text-align: center;
    }
    
    html[dir="rtl"] .md\:text-left {
        text-align: center;
    }
}

/* Animation adjustments for RTL */
html[dir="rtl"] [data-aos="fade-right"] {
    transform: translateX(100px);
}

html[dir="rtl"] [data-aos="fade-left"] {
    transform: translateX(-100px);
}

/* Mobile-specific animation adjustments for RTL */
@media (max-width: 768px) {
    html[dir="rtl"] [data-aos="fade-right"] {
        transform: translateX(20px);
    }

    html[dir="rtl"] [data-aos="fade-left"] {
        transform: translateX(-20px);
    }
}

/* Container adjustments */
html[dir="rtl"] .container {
    text-align: right;
}

html[dir="rtl"] .mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Typography adjustments for Arabic */
html[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Arabic UI Text', 'Al Bayan', sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-weight: 600;
    line-height: 1.4;
}

html[dir="rtl"] p {
    line-height: 1.6;
}

/* Improved text rendering for Arabic */
html[dir="rtl"] * {
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga' 1, 'calt' 1;
}

/* Fix for flex items in RTL */
html[dir="rtl"] .flex-wrap > * {
    margin-left: 0;
}

html[dir="rtl"] .flex-wrap.gap-4 > * {
    margin-right: 0;
    margin-left: 0;
}

/* Hero section specific adjustments */
html[dir="rtl"] .hero .flex {
    flex-direction: column-reverse;
}

@media (min-width: 768px) {
    html[dir="rtl"] .hero .md\:flex-row {
        flex-direction: row-reverse;
    }
}

/* Navigation specific adjustments */
html[dir="rtl"] nav .flex {
    flex-direction: row-reverse;
}

html[dir="rtl"] nav .justify-between {
    justify-content: space-between;
}

html[dir="rtl"] nav .items-center {
    align-items: center;
} 