/* ============================================
   مجمع أوشن الطبي - Ocean Medical Complex
   التنسيقات الرئيسية - الإصدار المنظم
   ============================================ */

/* ---------- المتغيرات العامة (الألوان والظلال) ---------- */
:root {
    --primary-dark: #204289;      /* الأزرق الغامق للهيدر والفوتر والعناوين */
    --primary-light: #2b6cf5;     /* الأزرق الفاتح للأزرار والروابط */
    --green-whatsapp: #25D366;    /* أخضر واتساب */
    --gray-bg: #f3f4f6;           /* خلفية رمادية فاتحة للأقسام البديلة */
    --text-dark: #1f2937;         /* لون النص الأساسي */
    --text-light: #6b7280;        /* لون النص الثانوي */
    --white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ---------- إعادة تعيين الهوامش والمسافات ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Readex Pro', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.5;
    direction: rtl;
    /* خلفية العلامة المائية (شعار المجمع بشكل باهت جداً) */
    background-image: url('/assets/ocean_logo-removebg-preview.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 60% auto;
    background-attachment: fixed;
    position: relative;
}

/* طبقة شفافة فوق الخلفية لتخفيف العلامة المائية أكثر */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    pointer-events: none;
    z-index: -1;
}

/* ---------- الحاوية الرئيسية ---------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- الهيدر (Header) ---------- */
.header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 45px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

/* قائمة الروابط (ديسكتوب) */
.nav-links {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    padding: 0.4rem 0;
}

.nav-links a:hover {
    color: #a0c4ff;
    transform: translateY(-2px);
}

/* أيقونة الواتساب في الهيدر */
.whatsapp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.whatsapp-icon:hover {
    transform: scale(1.1);
}

.whatsapp-icon img {
    width: 50px;
    height: auto;
    display: block;
}

/* زر الهامبرغر (يظهر فقط في الموبايل) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

/* ---------- الفوتر (Footer) ---------- */
.footer {
    background: var(--primary-dark);
    color: #e2e8f0;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: right;
}

.footer-col h3,
.footer-col h4 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #e2e8f0;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.footer-col a:hover {
    color: #a0c4ff;
    text-decoration: underline;
}

/* أيقونات التواصل الاجتماعي في الفوتر */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
    margin: 0 4px;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.social-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #2d4a8a;
}

/* ---------- الأقسام العامة ---------- */
.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

/* الأزرار العامة */
.btn {
    display: inline-block;
    background: var(--primary-light);
    color: var(--white);
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ---------- بطاقات الأطباء والعيادات (عامة) ---------- */
.doctors-grid,
.clinics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;   /* جميع الكروت في الصف تأخذ نفس الارتفاع */
}

/* على الشاشات الكبيرة جداً، نحدد 3 أعمدة كحد أقصى */
@media (min-width: 1024px) {
    .doctors-grid,
    .clinics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* الكارت نفسه */
.doctor-card,
.clinic-card {
    background: var(--white);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.doctor-card:hover,
.clinic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
}

/* صورة الطبيب - دائرية مع ضبط نقطة التركيز على الوجه */
.doctor-img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    object-position: top center;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: #e2e8f0;
}

/* صورة العيادة - مربعة بزوايا دائرية */
.clinic-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.specialty {
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* قائمة الخدمات داخل الكارت */
.services-list {
    text-align: right;
    margin: 1rem 0;
    list-style: none;
    font-size: 0.9rem;
    flex-grow: 1;
}

.services-list li {
    margin: 0.5rem 0;
}

/* زر الحجز أو عرض التفاصيل في أسفل الكارت */
.doctor-card .btn,
.clinic-card .btn {
    margin-top: auto;
}

/* ---------- تنسيق خاص لكروت الأطباء في الصفحة الرئيسية (عمودين متساويين) ---------- */
.home .doctors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: stretch;
    justify-items: center;
}

.home .doctor-card {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ---------- قسم Hero (الصفحة الرئيسية) ---------- */
.hero {
    position: relative;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    width: 100%;
    min-height: 550px;
    border-radius: 1.5rem;
    margin: 1rem 0;
    overflow: hidden;
    background-color: transparent;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

/* الصور المتحركة (الدكتور والدكتورة) */
.moving-doctor {
    position: absolute;
    bottom: 0;
    height: auto;
    opacity: 0;
    transition-property: all;
    transition-timing-function: cubic-bezier(0.2, 0.9, 0.4, 1.1);
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

.doctor-left {
    width: 440px;
    transition-duration: 4s;
    transition-delay: 0.3s;
    left: -500px;
}

.doctor-right {
    width: 300px;
    transition-duration: 4s;
    transition-delay: 0.6s;
    right: -500px;
}

.doctor-left.visible {
    left: 200px;
    opacity: 1;
}

.doctor-right.visible {
    right: 230px;
    opacity: 1;
}

.hero-text {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 1.8rem;
    border-radius: 1.2rem;
    color: var(--white);
    text-align: center;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.hero-text h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.hero-text p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* ---------- تأثير ظهور البطاقات عند التمرير (Fade + Scale) ---------- */
.clinic-card,
.doctor-card {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.clinic-card.appear,
.doctor-card.appear {
    opacity: 1;
    transform: scale(1);
}

/* ---------- نماذج الحجز والتواصل ---------- */
.form-card {
    background: var(--white);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: var(--transition);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.8rem;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 245, 0.2);
}

/* أزرار اختيار الفترة (صباحي/مسائي) */
.time-options {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.time-btn {
    flex: 1;
    padding: 0.7rem;
    text-align: center;
    background: #f1f5f9;
    border-radius: 2rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.time-btn.selected {
    background: var(--primary-light);
    color: var(--white);
    border-color: var(--primary-light);
}

/* معلومات الاتصال والخريطة */
.contact-info-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.map-embed {
    width: 100%;
    height: 300px;
    border: 0;
    border-radius: 1rem;
}

/* ---------- صفحة حسابات التواصل ---------- */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

@media (min-width: 1024px) {
    .social-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.social-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: block;
}

.social-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.social-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 0.8rem;
}

.social-card span {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
}

/* ---------- صفحة من نحن (About) ---------- */
.about-heart {
    font-size: 2.5rem;
    color: #e74c3c;
    margin: 1rem 0;
}

.values-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.value-item {
    text-align: center;
    padding: 1rem;
}

/* ---------- تحسينات التركيز لضعاف البصر (Accessibility) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* تحسين تباين النص في الهيرو */
.hero-text {
    background: rgba(0, 0, 0, 0.75);
}

/* ============================================================
   ████████ تنسيقات الموبايل (جميع القواعد الخاصة بالشاشات الصغيرة) ████████
   ============================================================ */
@media (max-width: 768px) {

    /* --- تعديلات قسم Hero --- */
    .hero {
        margin: 0;
        border-radius: 0;
        min-height: auto;
        background-color: transparent !important;
    }
    .hero-bg,
    .hero {
        background-size: cover !important;
        background-position: center 30% !important;
        background-repeat: no-repeat;
        height: 50vh;
        width: 100%;
    }
    .hero-text {
        display: none;      /* إخفاء النص والزر فوق الصورة */
    }

    /* --- تعديلات الهيدر (ترتيب العناصر) --- */
    .header .container {
        justify-content: space-between;
        position: relative;
        flex-wrap: nowrap;
    }
    .hamburger {
        display: flex;
        order: 1;           /* أقصى اليمين في RTL */
    }
    .logo-area {
        order: 2;
        margin: 0 auto;
    }
    .whatsapp-icon {
        order: 3;           /* أقصى اليسار في RTL */
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--primary-dark);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 1rem;
        gap: 0.8rem;
        z-index: 999;
        box-shadow: var(--shadow-sm);
        order: 4;
    }
    .nav-links.open {
        display: flex;
    }
    .logo-img {
        height: 35px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
    .whatsapp-icon img {
        width: 25px;
        height: auto;
    }

    /* --- تعديل أحجام الصور المتحركة (الدكتور والدكتورة) --- */
    .doctor-left {
        width: 220px;
        left: -150px;
    }
    .doctor-right {
        width: 150px;
        right: -150px;
    }
    .doctor-left.visible {
        left: 10px;
    }
    .doctor-right.visible {
        right: 10px;
    }

    /* --- عناوين الأقسام --- */
    .section-title {
        font-size: 1.5rem;
    }

    /* --- شبكات الكروت: تصبح عموداً واحداً (باستثناء الصفحة الرئيسية) --- */
    .doctors-grid,
    .clinics-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- الصفحة الرئيسية: كروت الأطباء عمود واحد --- */
    .home .doctors-grid {
        grid-template-columns: 1fr !important;
    }
    .home .doctor-card {
        max-width: 100% !important;
    }

    /* --- الفوتر: عمود واحد ومركز --- */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* --- تصغير المسافات الداخلية للنموذج --- */
    .form-card {
        padding: 1.2rem;
    }

    /* --- صفحة حسابات التواصل: 2 أعمدة في الموبايل (أو عمود واحد حسب الرغبة) --- */
    .social-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* تعطيل تأثير الاختفاء للكروت في صفحات العيادات فقط (تظهر فوراً) */
.clinic-details-page .doctor-card {
    opacity: 1 !important;
    transform: scale(1) !important;
}
/* نهاية الملف */