/* ====================================
   Heroes For Israel - RTL Support
   Hebrew Language & Right-to-Left
   ==================================== */

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

[dir="rtl"] body {
    direction: rtl;
    font-family: 'Heebo', 'Rubik', 'Assistant', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Better Hebrew Typography */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-family: 'Heebo', 'Rubik', 'Assistant', 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

[dir="rtl"] .nav-link,
[dir="rtl"] .btn,
[dir="rtl"] .nav-logo {
    font-family: 'Heebo', 'Rubik', 'Assistant', sans-serif;
    font-weight: 500;
}

[dir="rtl"] p,
[dir="rtl"] li,
[dir="rtl"] .section-subtitle {
    font-family: 'Assistant', 'Rubik', 'Heebo', 'Inter', sans-serif;
    line-height: 1.8;
}

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

[dir="rtl"] .nav-toggle {
    margin-left: 0;
    margin-right: auto;
}

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

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

[dir="rtl"] .mission-points,
[dir="rtl"] .timeline,
[dir="rtl"] .values-grid {
    direction: rtl;
}

[dir="rtl"] .mission-point {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .point-icon {
    margin-right: 0;
    margin-left: 1.5rem;
}

[dir="rtl"] .btn-icon {
    margin-left: 0;
    margin-right: 0.5rem;
    transform: rotate(180deg);
}

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

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

[dir="rtl"] .footer-links ul {
    padding-left: 0;
    padding-right: 0;
}

[dir="rtl"] .program-link svg,
[dir="rtl"] .timeline-icon {
    transform: rotate(180deg);
}

[dir="rtl"] .back-to-top {
    left: 2rem;
    right: auto;
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 1rem;
}

.language-switcher a {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.language-switcher a:hover {
    background: rgba(0, 56, 184, 0.1);
    transform: scale(1.1);
}

.language-switcher .flag-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* Better RTL Navigation Spacing */
[dir="rtl"] .nav-menu {
    gap: clamp(1rem, 2vw, 2rem);
}

[dir="rtl"] .nav-link {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    letter-spacing: 0;
}

[dir="rtl"] .nav-cta {
    margin-right: 0.5rem;
}
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.language-switcher a:hover {
    background: rgba(0, 56, 184, 0.05);
    border-color: rgba(0, 56, 184, 0.1);
}

.language-switcher a.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    border-color: var(--primary-blue);
}

.language-switcher a.active .flag-icon {
    transform: scale(1.1);
}

.flag-icon {
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* Mobile Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-right: 0;
        margin-top: 1rem;
        justify-content: center;
        order: 10;
    }
    
    [dir="rtl"] .language-switcher {
        margin-right: 0;
    }
    
    .nav-menu.active .language-switcher {
        display: flex;
        width: 100%;
        padding: 1rem 0;
        border-top: 1px solid rgba(0, 56, 184, 0.1);
    }
}

/* Navbar adjustments for language switcher */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

[dir="rtl"] .nav-menu-wrapper {
    margin-left: 0;
    margin-right: auto;
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .nav-menu-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Form RTL Adjustments */
[dir="rtl"] .form-group label {
    text-align: right;
}

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

[dir="rtl"] .checkbox-group {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .checkbox-group input[type="checkbox"] {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Timeline RTL */
[dir="rtl"] .timeline-item {
    direction: rtl;
}

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

/* Impact Cards RTL */
[dir="rtl"] .impact-card {
    text-align: right;
}

/* Gallery RTL */
[dir="rtl"] .gallery-grid {
    direction: rtl;
}

/* Testimonials RTL */
[dir="rtl"] .testimonial-author {
    flex-direction: row-reverse;
    text-align: right;
}

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

/* Admin RTL Adjustments */
[dir="rtl"] .admin-header {
    flex-direction: row-reverse;
}

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

[dir="rtl"] .gallery-item-actions {
    right: auto;
    left: 0.75rem;
}

/* Stats RTL */
[dir="rtl"] .admin-stats {
    direction: rtl;
}

[dir="rtl"] .stat-card {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .stat-icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* Modal RTL */
[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-header h3 {
    text-align: right;
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .close-modal {
    right: auto;
    left: 1.5rem;
}

/* Navigation improvements for language switcher */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-right-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

[dir="rtl"] .nav-right-section {
    margin-left: 0;
    margin-right: auto;
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-right-section {
        flex-direction: column;
        margin-left: 0;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    [dir="rtl"] .nav-right-section {
        margin-right: 0;
    }
}
