:root {
    --primary-color: #3182ce; /* أزرق طبي حيوي */
    --primary-dark: #2b6cb0;
    --secondary-color: #1a202c; /* لون داكن جداً للنصوص */
    --accent-color: #38b2ac; /* لون تيل مميز للفت الانتباه */
    --light-bg: #f7fafc;
    --white: #ffffff;
    --gray-text: #718096;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--light-bg);
    color: var(--secondary-color);
    line-height: 1.7;
    overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.mt-3 { margin-top: 15px; }

/* شريط التنقل */
.navbar {
    background-color: var(--white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap; /* للسماح بالتفاف العناصر في الشاشات الصغيرة */
}

.navbar .logo { font-size: 1.4em; font-weight: 800; color: var(--secondary-color); display: flex; align-items: center; gap: 10px;}
.navbar .logo i { color: var(--primary-color); }

.nav-actions { display: flex; gap: 15px; align-items: center; }

.book-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}
.book-btn:hover { background-color: var(--primary-dark); }

.lang-btn {
    background: transparent;
    border: 2px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
}
.lang-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* الهيدر المنقسم */
.hero {
    padding: 60px 5%;
    background: linear-gradient(135deg, #ebf8ff 0%, #ffffff 100%);
    position: relative;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1300px;
    margin: 0 auto;
    gap: 50px;
}

.hero-text { flex: 1; }

.badge {
    background-color: #bee3f8;
    color: var(--primary-dark);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.hero h1 { font-size: 3.2em; font-weight: 800; line-height: 1.2; margin-bottom: 20px; color: var(--secondary-color); }
.hero p { font-size: 1.2em; color: var(--gray-text); margin-bottom: 30px; }

.features-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; font-weight: 600; font-size: 1.1em;}
.features-list i { color: var(--accent-color); }

.hero-buttons { display: flex; gap: 15px; }

.main-btn, .sec-btn {
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: 0.3s;
    text-align: center;
}
.main-btn { background-color: var(--primary-color); color: var(--white); box-shadow: 0 10px 20px rgba(49, 130, 206, 0.3); }
.main-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(49, 130, 206, 0.4); }

.sec-btn { background-color: var(--white); color: var(--secondary-color); border: 2px solid #e2e8f0; }
.sec-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

.location {
    display: inline-block;
    background: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    font-weight: bold;
    color: var(--gray-text);
}
.location i { color: #e53e3e; }

/* صورة العيادة / الطبيب */
.hero-image { flex: 1; position: relative; }
.hero-image img.main-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 8px solid var(--white);
}

.floating-card {
    position: absolute;
    bottom: 30px;
    right: -30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-right: 4px solid var(--primary-color);
}
.floating-card i { font-size: 2em; color: var(--primary-color); }
.floating-card strong { display: block; font-size: 1.1em; }
.floating-card span { color: var(--gray-text); font-size: 0.9em; }

/* العناوين العامة */
h2 { font-size: 2.5em; margin-bottom: 50px; position: relative; display: inline-block; }
h2::after { content: ''; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); width: 60px; height: 4px; background: var(--primary-color); border-radius: 2px; }

/* الأقسام العامة والتخطيط الشبكي */
.features-section, .services-section, .gallery-section, .contact-section { padding: 100px 0; }
.services-section { background-color: var(--white); }

/* تم تصحيح minmax هنا لمنع خروج المحتوى عن الشاشة */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }

/* صناديق المميزات */
.feature-box { background: var(--white); padding: 40px 20px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); transition: 0.3s; border: 1px solid #edf2f7; }
.feature-box:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }
.icon-wrapper { width: 70px; height: 70px; background: #ebf8ff; border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px; font-size: 2em; color: var(--primary-color); }
.feature-box h3 { margin-bottom: 15px; font-size: 1.4em; }
.feature-box p { color: var(--gray-text); }

/* البطاقات والخدمات */
.service-card { background: var(--light-bg); padding: 40px; border-radius: 20px; text-align: right; border-right: 5px solid var(--accent-color); transition: 0.3s; }
.service-card:hover { background: var(--white); box-shadow: 0 15px 30px rgba(0,0,0,0.05); }
.service-card i { font-size: 3em; color: var(--accent-color); margin-bottom: 20px; }

/* معرض الصور */
.gallery-card { border-radius: 20px; overflow: hidden; box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.gallery-card .image-wrapper img { width: 100%; display: block; transition: 0.5s; }
.gallery-card:hover .image-wrapper img { transform: scale(1.05); }
.card-label { background: var(--white); padding: 20px; font-weight: 700; font-size: 1.2em; border-top: 1px solid #edf2f7; }

/* قسم التواصل الفورم */
.contact-container { background: var(--secondary-color); border-radius: 30px; display: flex; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.15); color: var(--white); }
.contact-info { padding: 60px; flex: 1; background: url('https://www.transparenttextures.com/patterns/cubes.png'); }
.contact-info h2::after { background: var(--accent-color); left: 0; transform: none; }
.contact-info p { color: #a0aec0; margin-bottom: 40px; font-size: 1.1em; }
.info-item { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.info-item i { font-size: 2em; color: var(--accent-color); }
.info-item span { display: block; color: #cbd5e0; font-size: 0.9em; }
.info-item strong { font-size: 1.2em; }

.contact-form-wrapper { padding: 60px; flex: 1; background: var(--white); color: var(--secondary-color); }
.contact-form-wrapper h3 { font-size: 1.8em; margin-bottom: 30px; }
form input, form textarea { width: 100%; padding: 15px; margin-bottom: 20px; border: 2px solid #edf2f7; border-radius: 8px; font-family: inherit; font-size: 1em; transition: 0.3s; background: #f7fafc;}
form input:focus, form textarea:focus { outline: none; border-color: var(--primary-color); background: var(--white); }
.submit-btn { width: 100%; background: var(--primary-color); color: var(--white); border: none; padding: 15px; border-radius: 8px; font-size: 1.2em; font-weight: 700; cursor: pointer; transition: 0.3s; }
.submit-btn:hover { background: var(--primary-dark); }
.success-message { background: #c6f6d5; color: #276749; padding: 15px; border-radius: 8px; margin-top: 15px; text-align: center; font-weight: bold; }

/* الفوتر */
footer { background: #1a202c; color: #a0aec0; padding: 40px 0; border-top: 5px solid var(--primary-color); }
.footer-logo { font-size: 1.5em; font-weight: bold; color: var(--white); margin-bottom: 15px; }
.social-links { margin-top: 20px; display: flex; justify-content: center; gap: 15px; }
.social-links a { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; background: rgba(255,255,255,0.1); color: var(--white); border-radius: 50%; transition: 0.3s; text-decoration: none; }
.social-links a:hover { background: var(--primary-color); transform: translateY(-3px); }

/* حاوية أزرار الواتساب */
.whatsapp-floating-group {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* المسافة بين الزرين */
    z-index: 1000;
}

/* تنسيق الزر نفسه */
.whatsapp-btn {
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    position: relative; /* ضروري لضبط موقع النص الجانبي */
    animation: pulse 2s infinite;
    transition: transform 0.3s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.1); /* تكبير الزر قليلاً عند مرور الماوس */
}

/* النص التوضيحي بجانب الزر (Tooltip) */
.whatsapp-btn .wa-tooltip {
    position: absolute;
    right: 75px; /* إبعاد النص ليظهر على يسار الزر */
    background: var(--white);
    color: var(--secondary-color);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    pointer-events: none; /* لمنع النص من إعاقة الضغط على الزر */
    border: 1px solid #edf2f7;
}

/* حركة النبض */
@keyframes pulse { 
    0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.7); } 
    70% { box-shadow: 0 0 0 15px rgba(37,211,102,0); } 
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } 
}
/* حركات التمرير */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.animate-on-scroll.show { opacity: 1; transform: translateY(0); }

/* ========================================= */
/* إضافات السوشيال ميديا وحقوق شركة Codex  */
/* ========================================= */
.floating-social {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

.floating-social a {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    font-size: 1.3em;
    text-decoration: none;
    border-radius: 0 10px 10px 0;
    transition: 0.3s ease;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

.floating-social a.social-fb { background-color: #1877F2; }
.floating-social a.social-ig { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }

.floating-social a:hover { width: 55px; }

.codex-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 800;
    margin-right: 5px;
    border-bottom: 1px dashed var(--accent-color);
    transition: 0.3s;
}

.codex-link:hover {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}


/* ========================================= */
/* التجاوب مع الشاشات (Media Queries) المحدثة */
/* ========================================= */

/* شاشات التابلت */
@media (max-width: 992px) {
    .hero-container, .contact-container { flex-direction: column; }
    .hero-text { text-align: center; }
    .hero-buttons { justify-content: center; }
    .floating-card { right: 10px; bottom: -20px; padding: 10px 15px; } /* تصغير البطاقة العائمة */
    .contact-info h2::after { left: 50%; transform: translateX(-50%); }
    .contact-info { text-align: center; }
    .info-item { flex-direction: column; gap: 5px; }
}

/* شاشات الموبايل (الهواتف الذكية) */
@media (max-width: 768px) {
    .navbar { 
        flex-direction: column; /* ترتيب العناصر طولياً */
        gap: 15px; 
        padding: 15px; 
    }
    .hero { padding: 40px 5%; }
    .hero h1 { font-size: 2.2em; } /* تصغير العنوان لتجنب التداخل */
    .hero p { font-size: 1em; }
    
    .hero-buttons { 
        flex-direction: column; /* ترتيب أزرار البداية طولياً */
        width: 100%; 
    }
    .main-btn, .sec-btn { width: 100%; }
    
    /* إجبار الشبكات على عرض عمود واحد فقط في الموبايل */
    .grid-3, .grid-2 { grid-template-columns: 1fr; } 
    
    .service-card { 
        text-align: center; 
        border-right: none; 
        border-bottom: 5px solid var(--accent-color); 
        padding: 25px 15px; 
    }
    
    /* تقليل الهوامش الداخلية في جميع الأقسام */
    .features-section, .services-section, .gallery-section, .contact-section { padding: 60px 0; } 
    
    h2 { font-size: 2em; margin-bottom: 30px; }
    
    /* تقليل الهوامش داخل نموذج التواصل */
    .contact-info, .contact-form-wrapper { padding: 30px 20px; } 
    
    /* تصغير أيقونات السوشيال ميديا */
    .floating-social a { width: 35px; height: 35px; font-size: 1.1em; }

    /* تصغير أزرار الواتساب والنص التوضيحي في الموبايل */
    .whatsapp-floating-group { bottom: 20px; right: 20px; gap: 10px; }
    .whatsapp-btn { width: 50px; height: 50px; font-size: 25px; }
    .whatsapp-btn .wa-tooltip { right: 60px; font-size: 12px; padding: 4px 10px; }
}