/* 1. Reset and Global Rules */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.25;
    background-color: #f5f7fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 20px;
    position: relative;
}

/* Background logo watermark */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    width: 500px;
    height: 500px;
    background-image: url('logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

/* Ensure content appears above watermark */
.navbar,
.container,
.invisible-wrapper,
.footer {
    position: relative;
    z-index: 1;
}

/* 2. Desktop Navigation - White with Blue Bottom Line */
.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    color: #1e3a5f;
    width: 100%;
    height: 100px;
    min-height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: fixed;
    top: -50px;
    left: 0;
    z-index: 1000;
    opacity: 0.95;
    transition: all 0.3s ease;
    cursor: pointer;
    border-bottom: 4px solid #FDB515;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.navbar:hover { 
    top: 0; 
    opacity: 1; 
}

.logo, .nav-links {
    height: 100%;
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    height: 140px;
    width: auto;
    max-width: 350px;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li { 
    margin-left: 20px; 
}

.nav-links a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #FDB515;
    transform: translateY(-2px);
}

.lang-button {
    color: #FDB515;
    border: 2px solid #FDB515;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.lang-button:hover {
    background: #FDB515;
    color: white;
    border-color: #FDB515;
}

/* 3. Footer - Navy Blue Style */
.footer {
    background: #1e3a5f;
    color: white;
    min-height: 60px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: -50px;
    opacity: 0.9;
    transition: all 0.3s ease;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.2);
}

.footer:hover { 
    bottom: 0; 
    opacity: 1; 
}

/* 4. Containers */
.invisible-wrapper { 
    margin: 90px 30px 10px; 
    flex: 1 0 auto; 
}

.container { 
    max-width: 900px; 
    background: #fff; 
    margin: 90px auto 20px; 
    padding: 40px; 
    border-radius: 12px; 
    box-shadow: 0 5px 25px rgba(0,0,0,0.1); 
}

/* Improved Typography and Hierarchy */
h1 {
    font-size: 2.5rem;
    color: #1e3a5f;
    margin-bottom: 20px;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    color: #FDB515;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    color: #1e3a5f;
    margin-bottom: 15px;
    font-weight: 600;
}

h4 {
    font-size: 1.2rem;
    color: #34495e;
    margin-bottom: 10px;
}

p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* Cards styling */
.card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 58, 95, 0.1);
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(253, 181, 21, 0.25);
    border-color: rgba(253, 181, 21, 0.5);
}

.card h3 {
    margin-bottom: 15px;
}

.card p {
    flex-grow: 1;
}

/* Grid layout for cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
    align-items: stretch;
}

.grid .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Custom Grid Layout for About Page (2 columns + 1 full width) */
.grid-custom {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.grid-custom .card-full {
    grid-column: 1 / -1; /* Spans all columns */
}

/* 5. About Us Page - Centered Content */
.content-center {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.content-center h1, 
.content-center h2, 
.content-center p, 
.content-center li {
    text-align: center;
    width: 100%;
}

.content-center h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #1e3a5f;
}

.content-center h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #FDB515;
}

.content-center p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* About Page Image */
.about-image {
    width: 70%;
    max-width: 350px;
    height: auto;
    border-radius: 15px;
    display: block;
    margin: 20px auto;
    box-shadow: 0 8px 25px rgba(30, 58, 95, 0.3);
    border: 3px solid #FDB515;
}

/* Values List */
.values-list {
    list-style-type: disc;
    padding: 0;
    margin: 10px auto;
    display: inline-block;
    text-align: right;
}

.values-list li {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* 6. Arabic RTL Support */
[dir="rtl"] { 
    text-align: right; 
}

[dir="rtl"] .nav-links li { 
    margin-left: 0; 
    margin-right: 20px; 
}

/* 7. Mobile Navigation */
.menu-toggle { 
    display: none; 
}

@media (max-width: 700px) {
    body { 
        padding-top: 85px; 
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        min-height: 70px;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
        border-bottom: 3px solid #FDB515;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 5%;
        opacity: 1;
        z-index: 2000;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.4rem;
        white-space: nowrap;
        pointer-events: none; 
        z-index: 10;
        height: auto;
        color: #1e3a5f;
    }

    .logo-image {
        height: 65px;
        max-width: 160px;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        z-index: 2001;
        cursor: pointer;
        pointer-events: auto;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: #FDB515;
        border-radius: 3px;
    }

    [dir="rtl"] .menu-toggle { 
        order: 1; 
        margin-right: 0; 
        margin-left: auto; 
    }
    
    [dir="ltr"] .menu-toggle { 
        order: 2; 
        margin-left: auto; 
        margin-right: 0; 
    }

    .nav-links {
        display: none;
        width: 100%;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
        border-bottom: 2px solid rgba(253, 181, 21, 0.3);
        position: absolute;
        top: 70px;
        left: 0;
        flex-direction: column;
        padding: 20px 0;
        z-index: 1999;
        height: auto;
    }

    .nav-links.active { 
        display: flex; 
    }
    
    .nav-links li { 
        margin: 10px 0; 
        width: 100%; 
        text-align: center; 
        margin-left: 0; 
    }
    
    .nav-links a { 
        color: #1e3a5f; 
    }

    .invisible-wrapper, main { 
        margin: 10px 15px; 
    }
    
    .footer { 
        position: relative; 
        bottom: 0; 
        opacity: 1; 
        margin-top: 20px; 
        min-height: 70px; 
    }
    
    .about-image {
        width: 90%;
        max-width: 300px;
    }

    /* Mobile: Stack custom grid into single column */
    .grid-custom {
        grid-template-columns: 1fr;
    }

    .grid-custom .card-full {
        grid-column: 1;
    }
}