/* Arabic Language Styles */

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

[dir="rtl"] body {
    font-family: 'Cairo', 'Inter', sans-serif;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
    font-variant-ligatures: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-family: 'Cairo', 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 0;
}

/* Ensure proper Arabic text rendering */
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] a,
[dir="rtl"] li,
[dir="rtl"] label,
[dir="rtl"] button {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

/* Avoid uppercase and spacing that can break Arabic shaping */
[dir="rtl"] .section-badge,
[dir="rtl"] .phone-label,
[dir="rtl"] .hero-badge,
[dir="rtl"] .logo-subtitle,
[dir="rtl"] .nav-link {
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* Ensure phone numbers in Arabic don't use monospace if it breaks glyph rendering */
[dir="rtl"] .phone-item a {
    font-family: 'Cairo', sans-serif;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999;
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 5px;
    display: flex;
    gap: 5px;
}

@media screen and (max-width: 768px) {
    .language-switcher {
        top: 100px;
    }
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #64748b;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: #f1f5f9;
}

.lang-btn.active {
    background: #2563eb;
    color: white;
}

.lang-btn i {
    margin-right: 5px;
}

[dir="rtl"] .lang-btn i {
    margin-right: 0;
    margin-left: 5px;
}

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

[dir="rtl"] .logo-img {
    margin-right: 0;
    margin-left: 10px;
}

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

[dir="rtl"] .nav-item {
    margin: 0 0 0 1rem;
}

/* RTL Footer */
[dir="rtl"] .footer-logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-logo-img {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .footer-org-name {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

[dir="rtl"] .footer-contact i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ===== Additional Global RTL Fixes ===== */

/* About cards accent border to the right in RTL */
[dir="rtl"] .about-mission,
[dir="rtl"] .about-vision,
[dir="rtl"] .about-values {
    border-left: none;
    border-right: 4px solid #2563eb;
}

/* News card accent border to the right in RTL */
[dir="rtl"] .news-card {
    border-left: none;
    border-right: 4px solid #2563eb;
}

/* Program features list aligns right and adjusts bullet spacing */
[dir="rtl"] .program-features {
    text-align: right;
}

[dir="rtl"] .program-features li:before {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Values list icon spacing in RTL */
[dir="rtl"] .values-list i {
    margin-right: 0;
    margin-left: 1rem;
}

/* Reverse hover nudge direction where applicable */
[dir="rtl"] .btn-submit:hover i {
    transform: translateX(-3px);
}

/* Contact phone hover already reversed; ensure consistency */
[dir="rtl"] .phone-item:hover {
    transform: translateX(-3px);
}

/* Mobile nav slide-in from right in RTL */
@media screen and (max-width: 768px) {
    [dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
    }
    [dir="rtl"] .nav-menu.active {
        right: 0;
    }
}

/* RTL Icons */
[dir="rtl"] .program-icon,
[dir="rtl"] .stat-icon,
[dir="rtl"] .contact-icon,
[dir="rtl"] .fact-icon {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .program-features li:before {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .timeline-date {
    text-align: left;
}

[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 3rem;
    border-left: none;
    border-right: 3px solid #e5e7eb;
}

[dir="rtl"] .timeline-date .date-circle {
    left: auto;
    right: -17px;
}

[dir="rtl"] .news-link i {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .news-link:hover i {
    transform: translateX(-3px);
}

/* RTL Hero */
[dir="rtl"] .hero-buttons {
    justify-content: center;
}

[dir="rtl"] .hero-title {
    font-family: 'Cairo', serif;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
}

[dir="rtl"] .hero-subtitle {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    line-height: 2;
    letter-spacing: 0;
}

[dir="rtl"] .hero-badge {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

[dir="rtl"] .hero-stat-item .stat-number {
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .hero-stat-item .stat-label {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

/* RTL Contact Section */
[dir="rtl"] .contact-item {
    flex-direction: row-reverse;
    text-align: right;
    border-left: none;
    border-right: 4px solid transparent;
}

[dir="rtl"] .contact-item:hover {
    border-right-color: #2563eb;
    transform: translateX(-5px);
}

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

[dir="rtl"] .contact-details {
    text-align: right !important;
    direction: rtl;
}

[dir="rtl"] .contact-details h4 {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
    text-align: right !important;
}

[dir="rtl"] .contact-details p {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
    text-align: right !important;
}

[dir="rtl"] .contact-details a {
    text-align: right !important;
    display: block;
}

[dir="rtl"] .org-full-name {
    font-family: 'Cairo', sans-serif !important;
    letter-spacing: 0 !important;
    text-align: right !important;
}

[dir="rtl"] .contact-sub {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
    text-align: right !important;
}

/* RTL Phone List */
[dir="rtl"] .phone-list {
    direction: rtl;
}

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

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

[dir="rtl"] .phone-item:hover {
    transform: translateX(-3px);
}


/* Ensure contact content grid aligns well in RTL */
[dir="rtl"] .contact-content {
    direction: rtl;
}

/* Fix icon spacing in RTL for contact cards */
[dir="rtl"] .contact-icon {
    margin-left: 0;
    margin-right: 0;
}

/* Adjust form footer alignment in RTL */
[dir="rtl"] .form-footer {
    flex-direction: row-reverse;
    text-align: right;
}

/* Ensure footer contact icons have spacing on the left in RTL */
[dir="rtl"] .footer-contact i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Align footer bottom links in RTL */
[dir="rtl"] .footer-bottom-content {
    direction: rtl;
}

/* Contact: ensure headings and body text are right-aligned in RTL */
[dir="rtl"] .contact-info-header,
[dir="rtl"] .contact-details {
    text-align: right;
}

/* Force right-align for all text elements inside contact cards */
[dir="rtl"] .contact-details h4,
[dir="rtl"] .contact-details p,
[dir="rtl"] .contact-details a,
[dir="rtl"] .contact-info-header h3,
[dir="rtl"] .contact-info-header p,
[dir="rtl"] .org-full-name,
[dir="rtl"] .contact-sub {
    text-align: right !important;
}

/* Form headers and labels */
[dir="rtl"] .form-header h3,
[dir="rtl"] .form-header p,
[dir="rtl"] .form-notice {
    text-align: right !important;
}

/* Contact: swap columns so the form appears on the right in RTL */
[dir="rtl"] .contact-info { order: 2; }
[dir="rtl"] .contact-form { order: 1; }

/* Form rows: start placement from the right in RTL */
[dir="rtl"] .form-row {
    direction: rtl;
}
[dir="rtl"] .phone-item i {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .phone-label {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

/* RTL Social Icons */
[dir="rtl"] .social-icons {
    flex-direction: row-reverse;
}

/* RTL Form */
[dir="rtl"] .form-group label {
    text-align: right;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

[dir="rtl"] .form-group input,
[dir="rtl"] .form-group select,
[dir="rtl"] .form-group textarea {
    text-align: right;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

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

[dir="rtl"] .form-notice {
    text-align: right;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

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

[dir="rtl"] .btn-submit:hover i {
    transform: translateX(-3px);
}

[dir="rtl"] .form-header h3,
[dir="rtl"] .form-header p,
[dir="rtl"] .contact-info-header h3,
[dir="rtl"] .contact-info-header p {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

/* Logo Subtitle */
.logo-text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

[dir="rtl"] .logo-text-container {
    align-items: flex-end;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 400;
    margin-top: -5px;
}

/* Hero Badge */
.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stat-item {
    text-align: center;
}

.hero-stat-item .stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-stat-item .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Crisis Context */
.crisis-context {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    padding: 5rem 0;
}

.section-badge {
    display: inline-block;
    background: #dbeafe;
    color: #2563eb;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crisis-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.crisis-map {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-img {
    max-width: 100%;
    height: auto;
}

/* Map Info Card */
.map-info-card {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 2px solid #e0e7ff;
}

.map-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e7ff;
}

.map-header i {
    font-size: 2rem;
    color: #2563eb;
}

.map-header h3 {
    color: #1e293b;
    margin: 0;
    font-size: 1.5rem;
}

.location-info {
    margin-bottom: 2rem;
}

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.location-item.conflict-zone {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #dc2626;
}

.location-item.safe-zone {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #059669;
}

[dir="rtl"] .location-item {
    border-left: none;
}

[dir="rtl"] .location-item.conflict-zone {
    border-right: 4px solid #dc2626;
}

[dir="rtl"] .location-item.safe-zone {
    border-right: 4px solid #059669;
}

.location-item i {
    font-size: 1.8rem;
    margin-top: 0.25rem;
}

.location-item.conflict-zone i {
    color: #dc2626;
}

.location-item.safe-zone i {
    color: #059669;
}

.location-item h4 {
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
}

.location-item p {
    color: #64748b;
    margin: 0;
    font-size: 0.95rem;
}

.location-arrow {
    text-align: center;
    margin: 1rem 0;
}

.location-arrow i {
    font-size: 2rem;
    color: #2563eb;
    animation: bounce-vertical 2s infinite;
}

@keyframes bounce-vertical {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

.region-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e7ff;
}

.region-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.region-stat .stat-icon {
    font-size: 1.5rem;
}


.crisis-info {
    display: grid;
    gap: 1.5rem;
}

.crisis-fact {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: transform 0.3s ease;
}

.crisis-fact:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .crisis-fact:hover {
    transform: translateX(5px);
}

.fact-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.fact-content h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.fact-content p {
    color: #64748b;
    line-height: 1.7;
    margin: 0;
}

/* Program Cards Enhanced */
.program-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
}

.program-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #059669;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

[dir="rtl"] .program-badge {
    right: auto;
    left: 1rem;
}

.program-image {
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
}

.program-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.program-content {
    display: flex;
    flex-direction: column;
}

.program-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    font-weight: 500;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-info h4 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.gallery-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-item {
    padding-left: 3rem;
    padding-bottom: 3rem;
    border-left: 3px solid #e5e7eb;
    position: relative;
}

.timeline-item:last-child {
    border-left: none;
}

.timeline-date {
    position: absolute;
    left: -17px;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 0.5rem 0;
}

.date-circle {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 3px #e5e7eb;
    margin-bottom: 0.5rem;
}

.timeline-date span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    transform: rotate(-90deg);
    margin-top: 2rem;
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.timeline-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    margin-bottom: 1rem;
    font-weight: 500;
}

.timeline-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: #dbeafe;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* About Section Enhanced */
.about-content-flex {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-badge-overlay {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #1e293b;
}

[dir="rtl"] .about-badge-overlay {
    left: auto;
    right: 2rem;
}

.about-badge-overlay i {
    color: #2563eb;
    font-size: 1.5rem;
}

.about-values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.value-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #2563eb;
}

[dir="rtl"] .value-item {
    border-left: none;
    border-right: 4px solid #2563eb;
}

.value-icon {
    color: #2563eb;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.value-item h4 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.value-item p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* Donation CTA */
.donate-cta {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.cta-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.cta-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cta-stat {
    text-align: center;
}

.cta-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Donation Modal Enhanced */
.donation-info {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

/* Mobile Responsive for New Sections */
@media screen and (max-width: 768px) {
    .language-switcher {
        top: 70px;
        right: 10px;
        padding: 3px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .program-card.featured {
        grid-template-columns: 1fr;
    }
    
    .about-content-flex {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-values-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 2rem;
    }
    
    .timeline-date span {
        font-size: 0.75rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
}