/* Language and Direction Support CSS */

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

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

/* Navigation RTL Support */
[dir="rtl"] .navbar {
    direction: rtl;
}

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

[dir="rtl"] .navbar .nav-links li {
    margin-left: 2rem;
    margin-right: 0;
}

[dir="ltr"] .navbar .nav-links li {
    margin-right: 2rem;
    margin-left: 0;
}

/* Hero Section RTL */
[dir="rtl"] .hero-content {
    text-align: right;
}

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

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

[dir="rtl"] .hero-buttons .btn:first-child {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="ltr"] .hero-buttons .btn:first-child {
    margin-right: 1rem;
    margin-left: 0;
}

/* About Section RTL */
[dir="rtl"] .about-content {
    text-align: right;
}

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

[dir="rtl"] .stats-grid {
    direction: rtl;
}

[dir="rtl"] .skills-grid {
    direction: rtl;
}

/* Services Section RTL */
[dir="rtl"] .services-grid {
    direction: rtl;
}

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

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

/* Portfolio Section RTL */
[dir="rtl"] .portfolio-filters {
    direction: rtl;
}

[dir="rtl"] .portfolio-grid {
    direction: rtl;
}

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

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

/* Contact Section RTL */
[dir="rtl"] .contact-content {
    direction: rtl;
}

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

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

[dir="rtl"] .contact-form {
    direction: rtl;
}

[dir="rtl"] .contact-form input,
[dir="rtl"] .contact-form textarea {
    text-align: right;
}

[dir="ltr"] .contact-form input,
[dir="ltr"] .contact-form textarea {
    text-align: left;
}

/* Footer RTL */
[dir="rtl"] .footer {
    direction: rtl;
}

[dir="rtl"] .footer-content {
    direction: rtl;
}

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

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

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

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

/* Language Toggle Button */
.language-toggle {
    position: fixed;
    right: 1rem;
    z-index: 1000;
}

[dir="rtl"] .language-toggle {

    right: 72px;
  top: 0;
}

.language-toggle button {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.language-toggle button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dark .language-toggle button {
    background: rgba(31, 41, 55, 0.9);
    color: #f9fafb;
    border-color: rgba(31, 41, 55, 0.2);
}

.dark .language-toggle button:hover {
    background: rgba(31, 41, 55, 1);
}

/* Font Adjustments for Arabic */
[dir="rtl"] {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

/* Text Direction Animations */
.fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

[dir="rtl"] .fade-in-right {
    animation: fadeInLeft 0.6s ease-out;
}

[dir="rtl"] .fade-in-left {
    animation: fadeInRight 0.6s ease-out;
}

@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);
    }
}

/* Responsive RTL Adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .navbar .nav-links {
        text-align: right;
    }
    
    [dir="ltr"] .navbar .nav-links {
        text-align: left;
    }
    
    [dir="rtl"] .hero-buttons {
        justify-content: flex-end;
    }
    
    [dir="ltr"] .hero-buttons {
        justify-content: flex-start;
    }
    
    .language-toggle {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    [dir="rtl"] .language-toggle {

    }
}

/* Smooth transitions for language switching */
* {
    transition: text-align 0.3s ease, direction 0.3s ease;
}

/* Fix for icons and elements that shouldn't flip */
.no-flip {
    transform: none !important;
}

[dir="rtl"] .no-flip {
    transform: scaleX(-1) !important;
}

/* Ensure proper spacing for Arabic text */
[dir="rtl"] p,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    /* line-height: 0.5em;
    word-spacing: 0em; */
}

[dir="ltr"] p,
[dir="ltr"] h1,
[dir="ltr"] h2,
[dir="ltr"] h3,
[dir="ltr"] h4,
[dir="ltr"] h5,
[dir="ltr"] h6 {
    /* line-height: 0.5em;
    word-spacing: normal; */
}