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

[dir="rtl"] body {
    font-family: 'Poppins', 'Tajawal', 'Cairo', 'Arial', sans-serif;
}

/* Smooth transition when switching direction */
* {
    transition: margin 0.3s ease, padding 0.3s ease;
}

/* Header RTL */
[dir="rtl"] nav ul li {
    margin-left: 0;
    margin-right: 30px;
}

[dir="rtl"] .language-switch-wrapper {
    margin-left: 0;
    margin-right: 20px;
}

[dir="rtl"] .theme-switch-wrapper {
    margin-left: 0;
    margin-right: 20px;
}

/* Hero Section RTL */
[dir="rtl"] .hero-text {
    padding-right: 0;
    padding-left: 30px;
}

[dir="rtl"] .hero-btns .btn {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .social-icon {
    margin-right: 0;
    margin-left: 15px;
}

/* About Section RTL */
[dir="rtl"] .about-image {
    padding-right: 0;
    padding-left: 30px;
}

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

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

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

[dir="rtl"] .info-item span {
    text-align: right;
}

[dir="rtl"] .info-item p {
    text-align: right;
}

/* Footer RTL */
[dir="rtl"] .footer-content {
    flex-direction: column;
    text-align: center;
}

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

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

/* Portfolio RTL */
[dir="rtl"] .portfolio-info {
    text-align: right;
}

[dir="rtl"] .portfolio-info h3 {
    text-align: right;
}

[dir="rtl"] .portfolio-info p {
    text-align: right;
}

[dir="rtl"] .portfolio-links {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .portfolio-filter {
    justify-content: center;
}

/* Contact Cards RTL */
[dir="rtl"] .contact-card {
    text-align: right;
    flex-direction: row-reverse;
}

[dir="rtl"] .contact-card-icon {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .contact-card-content {
    text-align: right;
}

[dir="rtl"] .contact-card-content h3 {
    text-align: right;
}

[dir="rtl"] .contact-card-content p {
    text-align: right;
}

/* Buttons RTL */
[dir="rtl"] .btn {
    direction: rtl;
}

/* Skills Progress RTL */
[dir="rtl"] .skill-progress {
    right: 0;
    left: auto;
}

/* Animations for RTL */
[dir="rtl"] .hero-text {
    animation: fadeInRight 1s ease;
}

[dir="rtl"] .hero-image {
    animation: fadeInLeft 1s ease;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Typography improvements for Arabic */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
    font-weight: 700;
    letter-spacing: 0;
}

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

/* Language Switch in RTL */
[dir="rtl"] .language-switch {
    flex-direction: row-reverse;
}

/* Back to Top Button RTL */
[dir="rtl"] .back-to-top {
    left: 30px;
    right: auto;
}

/* Section Headers RTL */
[dir="rtl"] .section-header {
    text-align: center;
}

[dir="rtl"] .section-header h2 {
    text-align: center;
}

/* Mobile Menu RTL */
@media screen and (max-width: 768px) {
    [dir="rtl"] nav {
        right: auto;
        left: -100%;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    [dir="rtl"] nav.active {
        right: auto;
        left: 0;
    }
    
    [dir="rtl"] .close-menu {
        right: auto;
        left: 20px;
    }
    
    [dir="rtl"] nav ul li {
        margin-right: 0;
        text-align: right;
    }
    
    [dir="rtl"] .language-switch-wrapper {
        margin-right: 0;
    }
    
    [dir="rtl"] .theme-switch-wrapper {
        margin-right: 0;
    }
    
    [dir="rtl"] .hamburger-menu {
        left: 0;
        right: auto;
    }
    
    /* Hero Section Mobile RTL */
    [dir="rtl"] .hero-text {
        padding-left: 0;
        text-align: center;
    }
    
    [dir="rtl"] .hero-btns {
        justify-content: center;
        flex-direction: row-reverse;
    }
    
    [dir="rtl"] .hero-btns .btn {
        margin-left: 8px;
        margin-right: 8px;
    }
    
    [dir="rtl"] .social-icons {
        justify-content: center;
        flex-direction: row-reverse;
    }
    
    /* About Section Mobile RTL */
    [dir="rtl"] .about-image {
        padding-left: 0;
    }
    
    [dir="rtl"] .about-text {
        text-align: right;
    }
    
    [dir="rtl"] .about-info {
        text-align: right;
    }
    
    /* Skills Mobile RTL */
    [dir="rtl"] .skill-info {
        flex-direction: row-reverse;
    }
    
    /* Portfolio Mobile RTL */
    [dir="rtl"] .portfolio-filter {
        flex-direction: column;
    }
    
    [dir="rtl"] .filter-btn {
        text-align: center;
    }
    
    [dir="rtl"] .portfolio-info {
        text-align: right;
    }
    
    [dir="rtl"] .portfolio-links {
        flex-direction: row-reverse;
        justify-content: center;
    }
    
    /* Contact Mobile RTL */
    [dir="rtl"] .contact-card {
        text-align: right;
    }
    
    [dir="rtl"] .contact-card-content {
        text-align: right;
    }
    
    [dir="rtl"] .social-icons-large {
        justify-content: center;
        flex-direction: row-reverse;
    }
    
    /* Footer Mobile RTL */
    [dir="rtl"] .footer-content {
        text-align: center;
    }
    
    [dir="rtl"] .footer-links {
        flex-direction: row-reverse;
        justify-content: center;
    }
    
    [dir="rtl"] .footer-text {
        text-align: center;
    }
    
    /* Back to Top Button Mobile RTL */
    [dir="rtl"] .back-to-top {
        left: 20px;
        right: auto;
    }
}

/* Extra Small Devices RTL */
@media screen and (max-width: 576px) {
    [dir="rtl"] .hero-text h1 {
        text-align: center;
    }
    
    [dir="rtl"] .hero-text h2 {
        text-align: center;
    }
    
    [dir="rtl"] .hero-text p {
        text-align: center;
    }
    
    [dir="rtl"] .section-header {
        text-align: center;
    }
    
    [dir="rtl"] .about-text h3 {
        text-align: right;
    }
    
    [dir="rtl"] .about-text p {
        text-align: right;
    }
    
    [dir="rtl"] .footer-links {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    [dir="rtl"] .footer-links a {
        font-size: 14px;
    }
}
