/* Base Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #7f8c8d;
    --font-primary: 'Tajawal', sans-serif;
    --transition: all 0.3s ease;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --light-gray-bg: #f5f5f5;
    --footer-bg-dark: #222e3e; /* Darker background for merged footer */
    --footer-text-color: #c0c0c0; /* Lighter text for dark background */
    --footer-heading-color: #ffffff; /* White headings for contrast */
    --footer-accent-color: #3498db; /* Blue for highlights in footer */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl; /* Ensure global RTL direction */
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
}

h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

h2 span {
    color: var(--secondary-color);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header p {
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 15px 0;
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--secondary-color);
}

.org-logo {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    justify-content: center;
    flex-grow: 1;
    max-width: 500px;
}

.nav-menu li {
    margin-right: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0; /* Align underline to the right */
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
    left: 0; /* Expand from right to left */
}

.nav-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 180px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    flex: none;
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 100px;
}

.wave-divider .shape-fill {
    fill: #FFFFFF;
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    justify-content: center;
}

.about-text {
    flex: 1;
    width: 100%;
    max-width: 800px;
    text-align: right;
}

.about-text p {
    margin-bottom: 20px;
}

.mission-vision {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.mission-vision .card {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: right;
    transition: var(--transition);
}

.mission-vision .card:hover {
    transform: translateY(-10px);
}

.mission-vision .card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    float: right;
    margin-right: 0;
    margin-left: 15px;
}

.mission-vision .card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    text-align: right;
}

/* Values Section */
.values {
    background-color: #f9f9f9;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.value-card {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: right;
    transition: var(--transition);
}

.value-card:hover {
    transform: translateY(-10px);
}

.value-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 20px auto;
}

.value-icon i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.value-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* Activities Section */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.activity-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.activity-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.activity-image {
    height: 200px;
    overflow: hidden;
}

.activity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.activity-card:hover .activity-image img {
    transform: scale(1.1);
}

.activity-content {
    padding: 25px;
    text-align: right;
}

.activity-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.activity-content p.short-description {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 700px;
    width: 90%;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    text-align: right;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal-content p {
    color: var(--text-color);
    margin-bottom: 10px;
}

.close-button {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 15px;
    transform: scaleX(-1);
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-color);
    text-decoration: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.footer {
    background-color: var(--footer-bg-dark); /* Darker background */
    color: var(--footer-text-color); /* Lighter text color */
    padding: 80px 0 0;
    position: relative; /* For the pattern */
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/footer-pattern.png'); /* Assuming you'll add a pattern image */
    background-repeat: no-repeat;
    background-size: cover; /* Adjust as needed */
    background-position: center bottom;
    opacity: 0.1; /* Adjust transparency */
    z-index: 1;
}

.footer .container {
    position: relative;
    z-index: 2; /* Ensure content is above the pattern */
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Flexible columns */
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col {
    /* No text-align: right here, let children manage for finer control */
}

/* Footer About Section (Logo & Description) */
.footer-about {
    text-align: right; /* Default text alignment for its direct text content */
}

.footer-about .logo {
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start; /* Default: Align logo to the left (start in RTL) */
    white-space: nowrap; /* Prevent logo text from wrapping */
}

.footer-about p {
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: right; /* Explicitly ensure this paragraph aligns right */
}

/* Social Media Links */
.social-links-footer {
    display: flex; /* Keeps them in a row */
    gap: 10px;
    margin-top: 15px; /* Add some space above */
    justify-content: flex-start; /* Align social links to the left (start in RTL) */
    width: 100%; /* Ensure it spans the full width of its parent to align left */
}

.social-links-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: var(--secondary-color); /* Solid blue background */
    color: white; /* White icon color */
    border-radius: 50%;
    transition: var(--transition);
    font-size: 1.1rem;
    border: none; /* No border */
}

.social-links-footer a:hover {
    background-color: #2980b9; /* Slightly darker blue on hover */
    color: white;
    transform: translateY(-3px);
}

/* Quick Links Section */
.footer-links {
    text-align: right; /* Align all content within this column to the right */
}
.footer-links h3, .footer-contact-info h3 {
    font-size: 1.4rem;
    color: var(--footer-heading-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    display: inline-block; /* Allows text-align to position it, and allows ::after to be relative to it */
}

.footer-links h3::after, .footer-contact-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0; /* Align underline to the right */
    width: 50px;
    height: 2px;
    background-color: var(--footer-accent-color);
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
    text-align: right; /* Explicitly ensure each list item's text aligns right */
}

.footer-links a {
    color: var(--footer-text-color);
    text-decoration: none;
    transition: var(--transition);
    display: block; /* Make links block to take full width and respect text-align */
    text-align: right; /* Explicitly ensure link text aligns right */
}

.footer-links a:hover {
    color: var(--footer-accent-color);
    padding-right: 5px; /* Shift text slightly right for hover effect in RTL */
    padding-left: 0; /* Reset left padding */
}

/* Contact Info Section */
.footer-contact-info {
    text-align: right; /* Align all content within this column to the right */
}

.footer-contact-info .info-item-footer {
    display: flex;
    align-items: flex-start; /* Align items to the top if they have different heights */
    margin-bottom: 15px;
    justify-content: flex-end; /* Align the entire flex container content to the right */
    width: 100%; /* Ensure flex container takes full width to align against */
}

.footer-contact-info .info-item-footer i {
    order: 1; /* Icon comes first (on the right) */
    font-size: 1.3rem;
    color: var(--footer-accent-color);
    margin-right: 0; /* Reset default margins */
    margin-left: 15px; /* Space between icon and text */
    margin-top: 3px; /* Fine-tune vertical alignment with text */
}

.footer-contact-info .info-item-footer p {
    order: 2; /* Text comes after the icon (on the left) */
    color: var(--footer-text-color);
    opacity: 0.9;
    text-align: right; /* Explicitly ensure the text itself is right-aligned if it wraps */
    flex-grow: 1; /* Allow text to take up remaining space */
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 40px;
}

.footer-bottom p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        margin-bottom: 50px;
        max-width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-text {
        text-align: center;
    }

    .mission-vision .card {
        text-align: center;
    }

    .mission-vision .card i {
        float: none;
        margin: 0 auto 15px;
    }

    .value-card {
        text-align: center;
    }

    .value-icon {
        margin: 0 auto 20px;
    }

    .activity-content {
        text-align: center;
    }

    /* Footer adjustments for tablet and smaller */
    .footer-grid {
        grid-template-columns: 1fr; /* Stack columns */
    }

    .footer-col {
        padding-bottom: 30px;
    }

    /* Explicitly force right alignment for footer-about for the general column content */
    .footer-about {
        text-align: right;
    }

    /* Aligning the logo and general paragraph for footer-about for mobile */
    .footer-about .logo {
        justify-content: center; /* Center logo in mobile view */
    }
    .footer-about p {
        text-align: center; /* Center paragraph in mobile view */
    }

    /* Social links: Center them within the action links container for mobile */
    .social-links-footer {
        justify-content: center; /* Center social links in mobile view */
    }

    /* Other footer columns (quick links, contact info): remain right-aligned as before */
    .footer-links,
    .footer-contact-info {
        text-align: right;
    }
    
    .footer-contact-info .info-item-footer {
        justify-content: flex-end; /* Keep contact info aligned to the right */
    }

    /* Headings' underlines: ensure they stick to the right */
    .footer-links h3::after, 
    .footer-contact-info h3::after {
        left: auto; /* Reset any centering attempts */
        right: 0;  /* Anchor to the right */
        transform: none; /* Remove any translateX from centering */
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        background-color: white;
        width: 80%;
        height: calc(100vh - 80px);
        flex-direction: column;
        align-items: center;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        margin: 15px 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    section {
        padding: 60px 0;
    }
    
    .mission-vision {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    h2 {
        font-size: 2rem;
    }
}