/* =================================================================== */
/* ======================= ملف الأنماط الرئيسي ======================= */
/* =================================================================== */

/* ======================= المتغيرات والإعدادات العامة ======================== */
:root {
    /* !! هام: يمكنك تعديل لوحة الألوان بسهولة من هنا !! */
    /* الألوان الأساسية المستوحاة من الهوية */
    --primary-color: #F58634; /* برتقالي */
    --secondary-color: #55C5D4; /* تركواز */
    --dark-blue-color: #0d2c4a; /* أزرق داكن */

    /* الألوان المساعدة */
    --white-color: #FFFFFF;
    --light-gray-bg: #F5F7FA;
    --text-color: #333333;
    --text-color-light: #666666;
    --border-color: #e0e0e0;

    /* تدرج قسم الـ Hero */
    --hero-gradient: linear-gradient(to right, rgba(13, 44, 74, 0.85), rgba(13, 44, 74, 0.7));

    /* الخطوط */
    --font-family: 'Tajawal', sans-serif;

    /* الظلال والانتقالات */
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s ease;
}

/* إعادة تعيين الأنماط الافتراضية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white-color);
    direction: rtl;
    text-align: right;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ======================= مكونات وعناصر مشتركة ======================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--light-gray-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-blue-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-color-light);
    max-width: 600px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    transition: var(--transition-speed);
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #e57624;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 134, 52, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white-color);
    border-color: var(--white-color);
}

.btn-secondary:hover {
    background-color: var(--white-color);
    color: var(--dark-blue-color);
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* ======================= الهيدر والـ Navbar ======================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--white-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed);
    padding: 15px 0;
}

.header.scrolled {
    padding: 10px 0;
    box-shadow: var(--box-shadow);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px; /* !! يمكنك تعديل ارتفاع الشعار من هنا */
    transition: var(--transition-speed);
}
.header.scrolled .logo img {
    height: 40px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--dark-blue-color);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.emergency-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    font-weight: 700;
}
.emergency-link i {
    font-size: 1.2rem;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-blue-color);
    transition: all 0.3s ease-in-out;
}

/* ======================= قسم Hero ======================== */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    color: var(--white-color);
    /* !! هام: استبدل رابط الصورة بصورة عالية الجودة للمستشفى */
    background: url('https://placehold.co/1920x1080/cccccc/cccccc?text=Hero+Background') no-repeat center center/cover;
    background-attachment: fixed; /* Parallax effect */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-gradient);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* ======================= قسم "عن المستشفى" ======================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    color: var(--dark-blue-color);
    margin-bottom: 20px;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed);
}

.image-grid img:hover {
    transform: scale(1.05);
}

/* =================================================================== */
/* ============ تصميم قسم التخصصات (مع تحسينات الأداء) =========== */
/* =================================================================== */

.specialties-slider-container {
    position: relative;
    overflow: hidden;
}

.specialties-grid-slider {
    display: flex;
    gap: 25px;
    padding: 10px 0;
    /* !! تحسين الأداء: إخبار المتصفح بتسريع هذه الخاصية !! */
    will-change: transform;
    transition: transform 0.5s ease-in-out;
}

/* --- تصميم "التراكب العصري" للبطاقة --- */
.specialty-card {
    flex: 0 0 calc(25% - 19px);
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 350px;
}

.specialty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.specialty-card .card-image-wrapper {
    width: 100%;
    height: 100%;
}

.specialty-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.specialty-card:hover .card-image {
    transform: scale(1.08);
}

.specialty-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(to top, rgba(13, 44, 74, 0.9) 0%, rgba(13, 44, 74, 0) 100%);
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 60%;
    text-align: right;
}

.specialty-card h3 {
    font-size: 1.6rem;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: var(--white-color);
}

.specialty-card p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    opacity: 0;
    max-height: 0;
    transition: opacity 0.3s, max-height 0.4s;
    color: #e0e0e0;
}

.specialty-card:hover p {
    opacity: 1;
    max-height: 100px;
}

.specialty-card .card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

/* --- التجاوب مع الشاشات --- */
@media (max-width: 1200px) {
    .specialty-card { flex: 0 0 calc(33.33% - 17px); }
}
@media (max-width: 992px) {
    .specialty-card { flex: 0 0 calc(50% - 13px); }
}
@media (max-width: 768px) {
    .specialty-card { flex: 0 0 85%; }
    .specialties-grid-slider {
        padding-right: 20px;
        padding-left: 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .specialties-grid-slider::-webkit-scrollbar { display: none; }
    .specialty-card { scroll-snap-align: start; }
}


/* =================================================================== */
/* ============ أكواد التصميم لقسم الأطباء (النسخة النهائية) =========== */
/* =================================================================== */

.doctors-container {
    position: relative;
    overflow: hidden; /* هذا سيخفي شريط التمرير الزائد */
}

#doctors-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* For Firefox */
    /* !! التعديل هنا: إضافة مساحة سفلية كافية للظل ومنع القطع !! */
    padding: 10px 10px 20px 10px; 
}

#doctors-grid::-webkit-scrollbar {
    display: none; /* For Chrome, Safari */
}

.doctor-card {
    flex-shrink: 0; 
    width: calc(33.33% - 14px); 
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    text-align: center;
    border: 1px solid #eef2f6;
    scroll-snap-align: start;
}

.doctor-card-inner {
    padding: 25px;
}

.doctor-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
    border: 4px solid var(--light-gray-bg);
    transition: var(--transition-speed);
}

.doctor-card:hover .doctor-photo {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.doctor-card h3 {
    font-size: 1.3rem;
    color: var(--dark-blue-color);
    margin-bottom: 5px;
}

.doctor-card .title {
    font-size: 1rem;
    color: var(--text-color-light);
    margin-bottom: 20px;
}

.doctor-card .profile-link {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s;
}

.doctor-card .profile-link:hover {
    background-color: var(--dark-blue-color);
}

.slider-controls {
    display: none;
}

@media (max-width: 992px) {
    .doctor-card { width: calc(50% - 10px); }
}

@media (max-width: 768px) {
    .doctor-card { width: 85%; }
}

/* =================================================================== */
/* ============ أكواد التصميم الجديدة لقسم التأمين (شريط أفقي) =========== */
/* =================================================================== */

.insurance-carousel {
    position: relative;
}

.insurance-logos {
    display: flex; /* عرض الشعارات في صف واحد */
    gap: 25px; /* المسافة بين الشعارات */
    overflow-x: auto; /* !! تفعيل التمرير الأفقي !! */
    padding: 10px 0;
    /* إخفاء شريط التمرير نفسه لمظهر أنظف */
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-snap-type: x mandatory; /* لجعل التمرير يتوقف عند كل شعار */
}

.insurance-logos::-webkit-scrollbar {
    display: none;
}

/* تصميم المربع الخاص بكل شعار */
.insurance-logo {
    /* تحديد حجم مربع ثابت */
    height: 130px; 
    width: 130px;
    flex-shrink: 0; /* منع المربع من الانكماش */
    background-color: var(--white-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eef2f6;
    transition: var(--transition-speed);
    scroll-snap-align: start; /* لجعل التمرير يتوقف عند كل شعار */
}

/* تصميم الصورة داخل المربع */
.insurance-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.insurance-logo:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

/* --- تصميم نقاط التنقل --- */
.slider-pagination {
    text-align: center;
    margin-top: 25px;
}
.slider-pagination .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dbe4f0;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}
.slider-pagination .dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}


/* ======================= قسم الإحصائيات ======================== */
.stats-section {
    position: relative;
    padding: 100px 0;
    background: url('https://placehold.co/1920x1080/cccccc/cccccc?text=Stats+Background') no-repeat center center/cover;
    background-attachment: fixed;
    color: var(--white-color);
}

.stats-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-gradient);
}

.stats-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item .icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-item .counter {
    font-size: 3.5rem;
    font-weight: 800;
}

.stat-item p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ======================= قسم تحميل التطبيق ======================== */
.app-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.app-text ul {
    margin: 20px 0;
    padding-right: 20px;
}

.app-text ul li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-text ul li i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.app-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.app-store-btn img {
    height: 60px;
    transition: transform var(--transition-speed);
}
.app-store-btn img:hover {
    transform: scale(1.05);
}

.app-image {
    text-align: center;
}

.app-image img {
    max-height: 600px;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.1));
}

/* ======================= قسم اتصل بنا ======================== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    background-color: var(--white-color);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.contact-form-container h3, .contact-info-container h3 {
    font-size: 1.8rem;
    color: var(--dark-blue-color);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-family);
    transition: border-color var(--transition-speed);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-status {
    margin-top: 15px;
    font-weight: 500;
}
.form-status.success { color: green; }
.form-status.error { color: red; }


.info-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.info-item h4 {
    font-size: 1.1rem;
    color: var(--dark-blue-color);
    margin-bottom: 5px;
}

.info-item p, .info-item a {
    color: var(--text-color-light);
}
.info-item a:hover {
    color: var(--primary-color);
}

.map-container {
    margin-top: 30px;
    border-radius: 10px;
    overflow: hidden;
}

/* ======================= الفوتر ======================== */
.footer {
    background-color: var(--dark-blue-color);
    color: var(--white-color);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col p {
    color: #ccc;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    color: #ccc;
    transition: var(--transition-speed);
}

.footer-col ul a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

.social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
    transition: var(--transition-speed);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
}

/* ======================= نوافذ Modal ======================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    left: 15px; /* RTL */
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.modal-content h3 {
    color: var(--dark-blue-color);
    margin-bottom: 15px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Modal الطبيب */
.doctor-modal {
    max-width: 800px;
}

.doctor-modal-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    align-items: flex-start;
}

.doctor-modal-photo {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    object-fit: cover;
}

.doctor-modal-details h2 {
    color: var(--dark-blue-color);
    font-size: 2rem;
}
.doctor-modal-details .title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.doctor-modal-details .specialty {
    font-weight: 500;
    color: var(--text-color-light);
    margin-bottom: 20px;
}
.doctor-modal-details .bio {
    margin-top: 20px;
}

/* ======================= تأثيرات الحركة والظهور ======================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======================= هياكل التحميل (Skeletons) ======================== */
.skeleton-card, .skeleton-card-doctor {
    background: #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
}
.skeleton-card { height: 250px; }
.skeleton-card-doctor { height: 350px; }

.skeleton-card::after, .skeleton-card-doctor::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    height: 100%;
    width: 150%;
    background: linear-gradient(to right, transparent 0%, #e8e8e8 50%, transparent 100%);
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { left: -150%; }
    100% { left: 150%; }
}

/* ======================= التجاوب مع الشاشات (Responsive) ======================== */

@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 85px;
        flex-direction: column;
        background-color: var(--white-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        gap: 0;
    }
    .nav-menu.active {
        right: 0;
    }
    .nav-menu li {
        width: 100%;
    }
    .nav-link {
        padding: 20px;
        display: block;
        width: 100%;
    }
    .hamburger {
        display: block;
    }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .header-actions .btn { display: none; }

    .hero-title { font-size: 2.8rem; }
    .about-content, .app-content { grid-template-columns: 1fr; }
    .about-images { margin-top: 40px; }
    .app-image { 
    order: -1; 
    /* تقليل المسافة السفلية للصورة على الموبايل */
    margin-bottom: 0px; 
}
/* تحديد أقصى ارتفاع للصورة على الموبايل */
.app-image img {
    max-height: 500px;
    margin: 0 auto;
}
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .contact-wrapper { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .doctor-modal-body { grid-template-columns: 1fr; text-align: center; }
    .doctor-modal-photo { margin: 0 auto; }
}

@media (max-width: 768px) {
    html { font-size: 15px; }
    .section-padding { padding: 60px 0; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-buttons { flex-direction: column; align-items: flex-start; }
    .section-title { font-size: 2rem; }
    
    /* Doctor Slider for Mobile */
    .doctor-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
    #doctors-grid {
        scroll-snap-type: x mandatory;
        overflow-x: auto;
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }
    #doctors-grid::-webkit-scrollbar {
        display: none;
    }
    .slider-controls { display: none; } /* Hide buttons on mobile, rely on swipe */
}

@media (max-width: 576px) {
.emergency-link {
    flex-direction: column;
    align-items: center;
    gap: 4px;  /* زدنا المسافة قليلاً */
    line-height: 1.2;
}

.emergency-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem; /* تكبير حجم كلمة الطوارئ */
}

/* كود جديد للتحكم في حجم الأيقونة بشكل مستقل */
.emergency-title i {
    font-size: 1rem;  /* تعديل حجم الأيقونة لتناسب النص */
}

.emergency-number {
    font-size: 1rem;       /* تكبير حجم الرقم */
    font-weight: 700;
    color: var(--secondary-color);
}
    .stats-grid { grid-template-columns: 1fr; }
    .contact-wrapper { padding: 20px; }
    .modal-content { width: 95%; }
}
/* =================================================================== */
/* ============ المقترح الثاني: تصميم "التراكب العصري" =========== */
/* =================================================================== */

.specialties-slider-container {
    position: relative;
    overflow: hidden;
    padding-bottom: 20px; /* مساحة للنقاط */
}

.specialties-grid-slider {
    display: flex;
    gap: 25px;
    transition: transform 0.5s ease-in-out;
    padding: 10px 0; /* مساحة للظل العلوي والسفلي */
}

/* --- تصميم "التراكب العصري" للبطاقة --- */
.specialty-card {
    flex: 0 0 calc(25% - 19px); /* عرض 4 بطاقات */
    position: relative; /* مهم جداً للتراكب */
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 350px; /* ارتفاع ثابت للبطاقة بالكامل */
}

.specialty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.specialty-card .card-image-wrapper {
    width: 100%;
    height: 100%;
}

.specialty-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.specialty-card:hover .card-image {
    transform: scale(1.08);
}

/* --- طبقة التراكب والتدرج اللوني --- */
.specialty-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(to top, rgba(13, 44, 74, 0.9) 0%, rgba(13, 44, 74, 0) 100%);
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 60%; /* ارتفاع التدرج اللوني */
    text-align: right;
}

.specialty-card h3 {
    font-size: 1.6rem;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: var(--white-color);
}

.specialty-card p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    opacity: 0; /* إخفاء الوصف بشكل افتراضي */
    max-height: 0; /* إخفاء الوصف بشكل افتراضي */
    transition: opacity 0.3s, max-height 0.4s;
    color: #e0e0e0;
}

.specialty-card:hover p {
    opacity: 1; /* إظهار الوصف عند المرور بالماوس */
    max-height: 100px; /* إظهار الوصف عند المرور بالماوس */
}

.specialty-card .card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}
.specialty-card .card-link:hover {
    color: var(--white-color);
}

.specialty-card .card-link i {
    transition: transform 0.3s;
}
.specialty-card:hover .card-link i {
    transform: translateX(-4px);
}

/* --- تصميم نقاط التنقل --- */
.slider-pagination {
    text-align: center;
    margin-top: 25px;
}
.slider-pagination .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dbe4f0;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}
.slider-pagination .dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* --- التجاوب مع الشاشات --- */
@media (max-width: 1200px) {
    .specialty-card { flex: 0 0 calc(33.33% - 17px); } /* 3 بطاقات */
}
@media (max-width: 992px) {
    .specialty-card { flex: 0 0 calc(50% - 13px); } /* 2 بطاقة */
}
@media (max-width: 768px) {
    .specialty-card { flex: 0 0 85%; } /* بطاقة واحدة تقريباً */
    .specialties-grid-slider {
        padding-right: 20px;
        padding-left: 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .specialties-grid-slider::-webkit-scrollbar { display: none; }
    .specialty-card { scroll-snap-align: start; }
}
/* ======================= تصميم رابط عرض الكل (النهائي - العنوان بالمنتصف والزر يسارًا) ======================== */

/* 1. استعادة تنسيق العنوان ليكون في المنتصف */
#specialties .section-header {
    text-align: center;
    display: block;
    justify-content: initial;
    align-items: initial;
    margin-bottom: 20px;
}

/* 2. إنشاء الحاوية المرجعية للمحتوى والزر */
.specialties-content-wrapper {
    position: relative;
    padding-top: 35px;
}

/* 3. تحديد موضع وتصميم الزر في الزاوية العلوية اليسرى */
.view-all-link-top-right { /* يمكنك ترك اسم الكلاس كما هو أو تغييره */
    position: absolute;
    top: 0;
    left: 0; /* << التعديل هنا */
    z-index: 10;

    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.view-all-link-top-right:hover {
    color: var(--dark-blue-color);
}

/* تعديل للشاشات الصغيرة */
@media (max-width: 576px) {
    .view-all-link-top-right {
        left: 15px; /* لضمان عدم التصاقه بحافة الشاشة */
    }
}
/* ======================= تصميم شريط التصفح (Breadcrumbs) - نسخة محسنة ======================== */
.breadcrumb-nav {
    /* إضافة خلفية وحواف دائرية للحاوية */
    background-color: var(--light-gray-bg);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.breadcrumb-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb-nav li {
    font-size: 0.95rem;
    /* تمييز الصفحة الحالية بلون أغمق وخط أعرض */
    color: var(--text-color);
    font-weight: 700;
}

.breadcrumb-nav li a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
    /* جعل الروابط أقل سماكة من الصفحة الحالية */
    font-weight: 500;
}

.breadcrumb-nav li a:hover {
    color: var(--dark-blue-color);
    text-decoration: underline;
}

/* استخدام أيقونة السهم كفاصل (أفضل للمواقع العربية) */
.breadcrumb-nav li:not(:last-child)::after {
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    content: '\f053'; /* كود أيقونة fa-chevron-left */
    font-weight: 900; /* مطلوب للأيقونات الصلبة */
    margin: 0 10px;
    color: var(--border-color);
    font-size: 0.8em;
}
/* ======================= تصميم صفحة التخصص الاحترافية ======================== */

/* 1. القسم العلوي (Hero Section) */
.page-hero-section {
    position: relative;
    padding: 100px 0;
    background-size: cover;
    background-position: center;
    color: var(--white-color);
    text-align: center;
}

.page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-gradient); /* استخدام نفس تدرج الصفحة الرئيسية */
    z-index: 1;
}

.page-hero-content {
    position: relative;
    z-index: 2;
}

.page-hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
}

/* تعديل تصميم شريط التصفح ليتناسب مع الخلفية الداكنة */
.hero-breadcrumb {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block; /* ليأخذ عرض المحتوى فقط */
    padding: 10px 20px;
}
.hero-breadcrumb li, .hero-breadcrumb li:not(:last-child)::after {
    color: rgba(255, 255, 255, 0.8);
}
.hero-breadcrumb li a {
    color: var(--white-color);
    font-weight: 700;
}
.hero-breadcrumb li a:hover {
    text-decoration: none;
    color: var(--secondary-color);
}

/* 2. قسم المحتوى الرئيسي */
.page-main-content {
    padding: 60px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px; /* العمود الأيسر 300px والباقي للأيمن */
    gap: 40px;
}

.content-main h2 {
    font-size: 2.2rem;
    color: var(--dark-blue-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.content-text {
    line-height: 1.9;
    color: var(--text-color-light);
    font-size: 1.1rem;
}
.content-text p {
    margin-bottom: 1.5em;
}

/* 3. الشريط الجانبي */
.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--light-gray-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sidebar-widget h3 {
    font-size: 1.5rem;
    color: var(--dark-blue-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.sidebar-widget p {
    color: var(--text-color-light);
    line-height: 1.7;
    margin-bottom: 20px;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.sidebar-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--dark-blue-color);
    border-radius: 5px;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.sidebar-links-list li a:hover {
    background-color: #e9ecef;
    border-right-color: var(--primary-color);
    transform: translateX(-5px);
}

.sidebar-links-list li a.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: 700;
}

/* 4. التجاوب مع الشاشات الصغيرة */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr; /* جعل العمودين فوق بعضهما */
    }
}

@media (max-width: 768px) {
    .page-hero-content h1 {
        font-size: 2.2rem;
    }
}
/* ======================= تنسيقات المحتوى التلقائي لصفحة التخصص ======================== */

/* 1. إضافة مسافات بين أقسام المحتوى */
.content-section {
    margin-bottom: 40px;
}

/* 2. تنسيق العناوين الفرعية داخل المحتوى */
.content-main h3 {
    font-size: 1.8rem;
    color: var(--dark-blue-color);
    margin-bottom: 20px;
}

/* 3. تصميم القائمة النقطية الأنيقة */
.styled-list {
    list-style: none;
    padding-right: 0;
    margin: 0;
}

.styled-list li {
    position: relative;
    padding-right: 30px; /* مساحة للأيقونة */
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.7;
}

/* إضافة أيقونة علامة الصح كـ "نقطة" للقائمة */
.styled-list li::before {
    content: '\f00c'; /* كود أيقونة fa-check */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    right: 0;
    top: 5px;
    font-size: 1rem;
}
/* ======================= تعديل قسم اتصل بنا ======================== */

/* نجعل الحاوية الرئيسية تتوسط العنصر المتبقي */
#contact .contact-wrapper {
    justify-content: center;
}

/* نزيد عرض حاوية معلومات الاتصال */
#contact .contact-info-container {
    width: 100%;
    max-width: 700px; /* يمكنك تعديل هذا الرقم حسب ما تراه مناسبًا */
}
/* ======================= تصميم رابط عرض كل الأطباء ======================== */

/* 1. إنشاء الحاوية المرجعية لقسم الأطباء */
.doctors-content-wrapper {
    position: relative;
    padding-top: 35px; /* مساحة كافية للزر فوق المحتوى */
}

/* 2. استخدام نفس تنسيق رابط التخصصات لضمان التناسق */
/* ملاحظة: view-all-link-top-right تم تعريفه سابقاً، وسيعمل هنا تلقائياً */
/* إذا لم يعمل، يمكنك إضافة left: 0; هنا */
.doctors-content-wrapper .view-all-link-top-right {
    left: 0;
    right: auto;
}
/* ======================= تصميم صفحة الطبيب الاحترافية ======================== */

/* 1. القسم العلوي (Hero) */
.doctor-hero-section {
    padding-top: 100px;
    background-color: var(--light-gray-bg);
    padding-bottom: 20px;
}

.doctor-hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-bottom: 30px;
}

.doctor-hero-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--white-color);
    box-shadow: var(--box-shadow);
}

.doctor-hero-info h1 {
    font-size: 2.8rem;
    color: var(--dark-blue-color);
    margin: 0 0 5px 0;
}

.doctor-hero-info .title {
    font-size: 1.3rem;
    color: var(--text-color-light);
    margin: 0 0 15px 0;
}

/* تعديل شريط التصفح الخاص بالطبيب */
.doctor-breadcrumb {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* 2. قسم التفاصيل والتبويبات */
.doctor-details-section {
    padding: 60px 0;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 15px 25px;
    border: none;
    background-color: transparent;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-color-light);
    position: relative;
    transition: color 0.3s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.tab-btn.active {
    color: var(--dark-blue-color);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-pane {
    display: none;
    line-height: 1.9;
    font-size: 1.1rem;
    color: var(--text-color);
}

.tab-pane.active {
    display: block;
}

.schedule-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--light-gray-bg);
    padding: 20px;
    border-radius: 8px;
    font-weight: 700;
}
.schedule-info i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .doctor-hero-content {
        flex-direction: column;
        text-align: center;
    }
    .doctor-hero-info h1 {
        font-size: 2.2rem;
    }
    .tab-buttons {
        flex-wrap: wrap;
    }
    .tab-btn {
        flex-grow: 1;
    }
}
/* ======================= تصميم رابط عرض كل شركات التأمين ======================== */
.insurance-content-wrapper {
    position: relative;
    padding-top: 35px;
}

.insurance-content-wrapper .view-all-link-top-right {
    position: absolute;
    top: 0;
    left: 0; /* To match the other sections */
    right: auto;
    z-index: 10;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.insurance-content-wrapper .view-all-link-top-right:hover {
    color: var(--dark-blue-color);
}