/* --- إعدادات عامة --- */
body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* --- الهيدر وشريط التنقل --- */
header {
    background-color: #ffffff;
    padding: 1rem 5%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    text-decoration: none;
    color: #005a87;
    font-weight: 700;
    font-size: 1.8rem;
}

.logo img {
    max-height: 50px;
    width: auto;
    vertical-align: middle;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-right: 25px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #d9534f;
}

/* --- المحتوى الرئيسي والأقسام --- */
main {
    padding-bottom: 80px;
}

.container {
    padding: 2rem 5%;
    text-align: center;
}

.container h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #005a87;
}

/* --- سلايدر الهيرو --- */
.hero-slider {
    position: relative;
    width: 100%;
    height: 80vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease-in-out;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 3;
}

.prev { left: 10px; }
.next { right: 10px; border-radius: 3px 0 0 3px; }
.prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); }

.dots-container {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    z-index: 3;
}

.dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active, .dot:hover { background-color: #d9534f; }

/* --- بطاقات الخدمات والشبكات --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
    text-align: center;
}

.card {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card h3 {
    color: #d9534f;
    margin-top: 0;
}

/* --- صفحة الخدمات --- */
.service-card { padding: 35px 25px; }
.service-icon { font-size: 3rem; color: #005a87; margin-bottom: 20px; }
.service-card h3 { margin-bottom: 15px; font-size: 1.5rem; }
.services-grid p { font-size: 1rem; color: #555; line-height: 1.7; }

/* --- صفحة المشاريع --- */
.projects-grid { margin-top: 3rem; }
.project-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 90, 135, 0.8);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-item:hover .project-overlay { opacity: 1; }
.project-item:hover img { transform: scale(1.1); }
.project-overlay h3 { margin: 0; font-size: 1.5rem; }
.project-overlay p { margin: 0.5rem 0 0 0; font-size: 1rem; }

/* --- النافذة المنبثقة (Modal) --- */
.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.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 700px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

.modal-content img { max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 20px; }
.modal-content h3 { color: #005a87; font-size: 2rem; margin-bottom: 10px; }
.modal-content p { color: #555; font-size: 1.1rem; margin-bottom: 5px; }
.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
.close-button:hover, .close-button:focus { color: #d9534f; }

/* --- صفحة اتصل بنا --- */
.contact-wrapper {
    display: flex;
    gap: 40px;
    margin-top: 3rem;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: right;
}

.contact-form, .contact-info { flex: 1; }
.contact-form h3, .contact-info h3 { color: #005a87; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    box-sizing: border-box;
}

.btn {
    display: inline-block;
    background-color: #d9534f;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover { background-color: #c9302c; }
.contact-info p { font-size: 1.1rem; margin-bottom: 15px; }
.contact-info i { color: #005a87; margin-left: 10px; }
.map { margin-top: 30px; border-radius: 10px; overflow: hidden; }

/* --- تنسيقات الحركة عند التمرير (النسخة النهائية) --- */
.about-page-section {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 5rem;
    padding: 1rem 0;
    text-align: right;
}
.about-image { flex: 1; }
.about-text { flex: 1; }
.about-image img { width: 100%; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.about-text h2 { text-align: right; }
.about-page-section.mission-section { flex-direction: row-reverse; }
.animated-item {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.slide-from-left { transform: translateX(-100px); }
.slide-from-right { transform: translateX(100px); }
.animated-item.show { opacity: 1; transform: translateX(0); }

/* --- الفوتر --- */
footer {
    background-color: #222;
    color: #fff;
    text-align: center;
    padding: 1.5rem;
}

/* --- التجاوب وقائمة الجوال --- */
.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 3px; background-color: #333; margin: 5px; transition: all 0.3s ease; }

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0;
        padding-top: 10vh;
        background-color: #ffffff;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    .nav-links li { opacity: 0; margin: 20px 0; }
    .burger { display: block; z-index: 1001; }
    .nav-active { transform: translateX(0%); }
    @keyframes navLinkFade { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0px); } }
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }

    .hero-content h1 { font-size: 2.2rem; }
    .container h2 { font-size: 2rem; }
    .contact-wrapper { flex-direction: column; }
    .about-page-section, .about-page-section.mission-section { flex-direction: column; }
    .slide-from-left, .slide-from-right { transform: translateY(50px); }
    .animated-item.show { transform: translateY(0); }
}