:root {
    --primary-color: #0a2540;
    --secondary-color: #f6f9fc;
    --accent-color: #d4af37;
    --text-color: #333;
    --light-color: #fff;
    --font-family-ar: 'Cairo', sans-serif;
    --font-family-en: 'Poppins', sans-serif;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- General Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* يمنع التمرير الأفقي */
}

body {
    font-family: var(--font-family-ar);
    line-height: 1.7;
    background-color: var(--light-color);
    color: var(--text-color);
    transition: font-family 0.3s ease;
    width: 100%;
    overflow-x: hidden;
    /* يمنع التمرير الأفقي */
}

/* --- Navigation Bar --- */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

nav .logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    gap: 10px;
}

nav .logo img {
    width: 60px;
    height: 60px;
    display: block;
}

nav .logo a span {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li a {
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
    transition: color 0.3s;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a.active-link {
    color: var(--accent-color);
}

.nav-links li a:hover::after {
    width: 80%;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switcher a {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    transition: background-color 0.3s, transform 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.lang-switcher a:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(rgba(10, 37, 64, 0.8), rgba(10, 37, 64, 0.8)), url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    color: var(--light-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    max-width: 800px;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-color);
}

.btn:hover {
    background-color: transparent;
    color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* --- General Section Styling --- */
section {
    padding: 6rem 5%;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 1rem auto 3rem;
}

/* --- Services Section --- */
.services-section {
    background-color: var(--secondary-color);
}

.service-category {
    margin-bottom: 4rem;
}

.service-category:last-child {
    margin-bottom: 0;
}

.category-title {
    height: 400px;
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--light-color);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    padding: 1rem;
    text-align: center;
}

.cat-bg-1 {
    background-image: url('src/images/publicserv.jpg');
}

.cat-bg-2 {
    background-image: url('src/images/web3.png');
}

.cat-bg-3 {
    background-image: url('src/images/akar.jpeg');
}

.category-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 37, 64, 0.5);
    z-index: 1;
}

.category-title span[data-key] {
    position: relative;
    z-index: 2;
}

/* ========= (مهم) كود موحد ونظيف لبطاقات الخدمات ========= */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.service-card {
    background: var(--light-color);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.service-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    padding: 1rem;
}

.service-card .card-icon {
    font-size: 3rem;
    color: var(--accent-color);
    transition: transform 0.4s ease;
    padding-top: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.service-card:hover .card-icon {
    transform: scale(1.2) rotate(10deg);
}

.card-content-wrapper {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content-wrapper h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-content-wrapper p {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.6;
}

/* ======================================================= */

/* --- About & Contact Sections --- */
.about-section,
.contact-section {
    background: var(--light-color);
}

.about-container,
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-image img {
    width: 100%;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: block;
}

.about-content .section-title,
[dir="rtl"] .about-content .section-title,
.contact-info .section-title,
[dir="rtl"] .contact-info .section-title {
    text-align: start;
}

.about-content .section-title::after,
.contact-info .section-title::after {
    margin: 1rem 0 2rem;
}

.contact-section {
    background: linear-gradient(rgba(10, 37, 64, 0.95), rgba(10, 37, 64, 0.95)), url('https://www.toptal.com/designers/subtlepatterns/uploads/double-bubble-outline.png');
    color: var(--light-color);
}

.contact-section .section-title,
.contact-section p {
    color: var(--light-color);
}

.contact-info ul {
    list-style: none;
    margin-top: 2rem;
}

.contact-info li {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.contact-info li i {
    color: var(--accent-color);
    margin-inline-end: 1rem;
    width: 20px;
}

.contact-info a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-color);
}

.map-container,
.logo-container {
    /* دمج التنسيق */
    width: 100%;
    height: 450px;
    border-radius: 15px;
    overflow: hidden;
    /* box-shadow: var(--shadow); */
    /* background-color: #fff; */
}

.map-container iframe,
.logo-container img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
    padding: 2rem;
    /* مساحة حول الشعار */
}

/* --- Footer --- */
.site-footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 5% 2rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto 3rem;
}

.site-footer h3 {
    color: var(--light-color);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: 0.8rem;
    transition: color 0.3s, transform 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

[dir="rtl"] .footer-links a:hover {
    transform: translateX(-5px);
}

.footer-social a {
    color: var(--light-color);
    font-size: 1.5rem;
    margin-inline-end: 1rem;
    transition: color 0.3s, transform 0.3s;
}

.footer-social a:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

/* --- Animations --- */
.animate-up {
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- WhatsApp FAB --- */
.whatsapp-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.whatsapp-fab:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

[dir="rtl"] .whatsapp-fab {
    right: auto;
    left: 25px;
}

/*
========================================
--- RESPONSIVE DESIGN FOR MOBILE ---
========================================
*/
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--primary-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s ease-in-out;
    }

    .nav-links.nav-active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .nav-links li a {
        color: var(--light-color);
        font-size: 1.5rem;
    }

    .nav-links li a.active-link,
    .nav-links li a:hover {
        color: var(--accent-color);
    }

    section {
        padding: 4rem 5%;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .category-title {
        height: 200px;
        /* تقليل الارتفاع على الموبايل */
        font-size: 1.8rem;
    }

    .card-content-wrapper h3 {
        font-size: 1.2rem;
    }

    .about-container,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .about-image,
    .map-container,
    .logo-container {
        order: 1;
    }

    .about-content,
    .contact-info {
        order: 2;
        margin-top: 2rem;
    }

    .about-content .section-title,
    [dir="rtl"] .about-content .section-title,
    .contact-info .section-title,
    [dir="rtl"] .contact-info .section-title {
        text-align: center;
    }

    .about-content .section-title::after,
    .contact-info .section-title::after {
        margin: 1rem auto 2rem;
    }

    .contact-info {
        text-align: center;
    }

    .contact-info ul {
        align-items: center;
        justify-content: center;
        display: flex;
        flex-direction: column;
    }

    .footer-container {
        text-align: center;
        gap: 2rem;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links a:hover,
    [dir="rtl"] .footer-links a:hover {
        transform: none;
    }
}