/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a3b52;
    --text-color: #333;
    --light-bg: #f4f4f4;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--white);
    transition: color 0.3s;
}

.nav-link:hover {
    color: #ddd;
    border-bottom: 2px solid #ddd;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--white);
    transition: all 0.3s ease-in-out;
}

/* Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
    background: linear-gradient(rgba(26, 59, 82, 0.7), rgba(26, 59, 82, 0.7)), url('/images/783caee0-6c68-41a4-86e4-ffda819ff6e8.jpg') no-repeat center center/cover fixed;
}

/* باقي التنسيقات داخل الهيرو كما هي */
.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    /* اللون أبيض تلقائياً من الأب */
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #f4f4f4;
}

/* تنسيق الزر داخل الهيرو */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    text-decoration: none;
}

.btn:hover {
    background-color: transparent;
    border-color: var(--white);
}

/* Responsive Fix */
@media (max-width: 768px) {
    .hero {
        height: 60vh;
        background-attachment: scroll;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
}

/* Services Section */
.services {
    padding: 4rem 0;
}

.services h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px; /* Adjust based on navbar height */
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 16px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* Features Section Styles */
.features-section {
    padding: 5rem 0;
    background-color: #ffffff; /* خلفية بيضاء لتمييز القسم */
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-item {
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* ضروري جداً لتحديد مكان الأيقونة */
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-image {
    width: 100%;
    height: 200px;
    overflow: hidden; /* هذا ما كان يسبب المشكلة سابقاً */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.feature-item:hover .feature-image img {
    transform: scale(1.05);
}

/* Icon Styling */
.feature-icon {
    position: absolute;
    /* حساب الموقع: ارتفاع الصورة (200) - نصف ارتفاع الأيقونة (25) = 175 */
    top: 175px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px solid #ffffff; /* الإطار الأبيض */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10; /* لضمان ظهورها فوق كل شيء */
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
}

/* Text Content Styling */
.feature-item h3 {
    margin-top: 35px; /* مسافة كافية لكي لا يصطدم العنوان بالأيقونة */
    margin-bottom: 15px;
    padding: 0 20px;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.feature-item p {
    padding: 0 20px 25px 20px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}