:root {
    --primary-gradient: linear-gradient(135deg, #2b63db 0%, #1a3a8f 100%);
    --accent-color: #00D4FF;
    --secondary-accent: #62d2a2;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
    --nav-footer-bg: #111827;
}

/* Dark Mode Variables - Soft Slate Theme (Muted & Professional) */
[data-theme="dark"] {
    --bg-light: #2e3440;
    /* لون رمادي مزرق هادئ (Nord Theme Style) */
    --text-dark: #eceff4;
    --glass-bg: rgba(59, 66, 82, 0.8);
    --glass-border: rgba(216, 222, 233, 0.1);
    --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.5);
    --nav-footer-bg: #1e293b;
    background-color: #2e3440;
}

[data-theme="dark"] body {
    background-color: #2e3440;
    color: #eceff4;
}

[data-theme="dark"] .Unit_section,
[data-theme="dark"] .about_section,
[data-theme="dark"] .doctor_section,
[data-theme="dark"] .contact_section,
[data-theme="dark"] .footer_section,
[data-theme="dark"] .stats_section {
    background-color: #2e3440 !important;
}

[data-theme="dark"] .form_container input,
[data-theme="dark"] .form_container .message-box {
    background-color: #3b4252 !important;
    color: #eceff4 !important;
    border: 1px solid #434c5e !important;
}

/* Stats Cards - Day Mode: Black text */
.stat-box {
    color: #1a202c !important;
}

.stat-box h2,
.stat-box p {
    color: #1a202c !important;
}

[data-theme="dark"] .Unit_section .box,
[data-theme="dark"] .stat-box {
    background-color: #3b4252 !important;
    color: #eceff4 !important;
    border: 2px solid var(--accent-color) !important;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.25) !important;
}

/* Stats Cards - Dark Mode: White text */
[data-theme="dark"] .stat-box h2,
[data-theme="dark"] .stat-box p {
    color: #eceff4 !important;
}

[data-theme="dark"] .doctor_section .box {
    background-color: #3b4252 !important;
    color: #eceff4 !important;
    border: 3px solid rgba(0, 212, 255, 0.4) !important;
    /* Cyan border in dark mode */
}

/* ===================== NAVBAR ENHANCEMENTS ===================== */

/* Force Logo: white color + cyan glow by default */
.header_section .navbar-brand .nav-logo {
    filter: brightness(0) invert(1) drop-shadow(0 0 10px #00D4FF) drop-shadow(0 0 20px rgba(0, 212, 255, 0.6)) !important;
    transform: scale(1) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-block !important;
}

.header_section .navbar-brand:hover .nav-logo {
    filter: brightness(0) invert(1) drop-shadow(0 0 20px #00D4FF) drop-shadow(0 0 40px rgba(0, 212, 255, 0.8)) drop-shadow(0 0 60px rgba(0, 212, 255, 0.4)) !important;
    transform: scale(1.07) !important;
}

/* Navbar brand text (if any) hover color */
.navbar-brand:hover {
    color: #00D4FF !important;
}

/* Reduce spacing between nav links */
.custom_nav-container .navbar-nav .nav-item {
    margin: 0 2px;
}

.custom_nav-container .navbar-nav .nav-link {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 0.95rem !important;
    /* Slightly smaller to fit */
}

/* Ensure header container is wider */
.header_section .container {
    max-width: 1400px !important;
    width: 95% !important;
}

/* Move actions wrapper to the far corner */
.nav-actions-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 15px;
    margin-inline-start: 3rem !important;
    /* About 1.5cm / 50px distance to prevent menu wrapping */
    margin-inline-end: 10px !important;
}

/* Global Section Headings */
.heading_container h2,
.Unit_section h2,
.about_section h2,
.doctor_section h2,
.contact_section h2 {
    color: #1a3a8f !important;
    font-weight: 900 !important;
    font-size: 3rem !important;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: default;
}

.heading_container h2:hover {
    color: var(--accent-color) !important;
    transform: scale(1.05);
    text-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.heading_container p {
    font-weight: 700;
    font-size: 1.5rem;
    /* Noticeably larger */
    color: #2d3748;
    line-height: 1.75;
    margin-bottom: 30px;
    letter-spacing: 0.01em;
}

/* Radiant White styling for Hero Description */
.slider_section .detail-box p strong {
    color: #ffffff !important;
    font-weight: 800;
    display: inline-block;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(0, 212, 255, 0.3);
    /* Subtle cyan tint for "radiance" */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

[data-theme="dark"] .slider_section .detail-box p strong {
    color: #ffffff !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9),
        0 0 25px rgba(0, 212, 255, 0.5);
}

[data-theme="dark"] .heading_container h2,
[data-theme="dark"] .Unit_section h2,
[data-theme="dark"] .about_section h2,
[data-theme="dark"] .doctor_section h2,
[data-theme="dark"] .contact_section h2 {
    color: #ffffff !important;
}

[data-theme="dark"] .heading_container p {
    color: #eceff4 !important;
}

[data-theme="dark"] .contact_section .form_container input:focus~label,
[data-theme="dark"] .contact_section .form_container input:not(:placeholder-shown)~label,
[data-theme="dark"] .contact_section .form_container .message-box:focus~label,
[data-theme="dark"] .contact_section .form_container .message-box:not(:placeholder-shown)~label {
    background-color: #3b4252 !important;
}

/* Global Styles */
body {
    scroll-behavior: smooth;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--accent-color);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Glassmorphism Effect */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
}

/* Navbar Enhancements */
.header_section {
    background: var(--nav-footer-bg) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
    /* جعل الخط خفيف جداً وشفاف */
    padding: 5px 0;
}

/* إضافة حشو للهيرو لتعويض مساحة الناف بار المثبت */
.hero_area {
    padding-top: 80px;
    /* موازنة الإزاحة مع الحجم الجديد */
}

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 2px 0;
    /* تقليل الحشو الداخلي */
    margin-inline-start: -20px;
}

@media (max-width: 991px) {
    .header_section .custom_nav-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .custom_nav-container .navbar-toggler {
        display: block !important;
        position: relative;
        z-index: 1000;
        margin-top: 15px;
    }
}

.nav-logo {
    height: 75px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    /* Styles are handled above to avoid duplication */
}


/* تم حذف تعديل الشعار في الوضع الليلي ليبقى أبيض دائماً */

.theme-toggle-btn {
    font-size: 1.2rem;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    width: 90px;
    /* جعل المستطيل أطول */
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-inline-start: 40px;
    /* إبعاد الأيقونة عن العناصر بشكل أوضح */
    transition: var(--transition-smooth);
    cursor: pointer;
}

.theme-toggle-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.05);
    /* إزالة الدوران لتناسب الشكل المستطيل */
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* Modern Language Dropdown */
.modern-dropdown {
    position: relative;
    display: inline-block;
}

.modern-dropbtn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    min-width: 100px;
    justify-content: space-between;
}

.modern-dropbtn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.modern-dropbtn .globe-icon {
    font-size: 1rem;
    color: var(--accent-color);
}

.modern-dropbtn .chevron-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.modern-dropdown.active .modern-dropbtn .chevron-icon {
    transform: rotate(180deg);
}

.modern-dropdown-content {
    display: none;
    position: absolute;
    inset-block-start: calc(100% + 10px);
    inset-inline-end: 0;
    background-color: #ffffff;
    min-width: 100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 10000;
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-dropdown-content.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-item-custom {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: #2d3748;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 12px;
    border: none;
    width: 100%;
    text-align: inherit;
}

/* Specific Option Backgrounds as Requested */
.ar-option {
    background-color: #f1fcf1;
    /* Very light success/green */
}

.en-option {
    background-color: #f1f7ff;
    /* Very light info/blue */
}

.ar-option:hover {
    background-color: #e2f7e2;
}

.en-option:hover {
    background-color: #e3f0ff;
}

.dropdown-item-custom.active {
    font-weight: 700;
    color: #1a3a8f;
}

.dropdown-item-custom .flag-icon {
    font-size: 1.2rem;
}

.dropdown-item-custom .check-icon {
    margin-inline-start: auto;
    font-size: 0.8rem;
    color: #2b63db;
}

/* RTL Support is now partially handled by logical properties, 
   but we'll keep the specific blocks for complex overrides */
[dir="rtl"] .modern-dropdown-content {
    inset-inline-end: auto;
    inset-inline-start: 0;
}

[dir="rtl"] .dropdown-item-custom .check-icon {
    margin-inline-start: 0;
    margin-inline-end: auto;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .nav-actions-wrapper {
        margin-top: 15px;
        margin-bottom: 10px;
        margin-inline-start: 0 !important;
        /* Reset the 4cm margin on mobile */
        justify-content: center;
    }

    .modern-dropdown-content {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 10px;
        display: none;
    }

    .modern-dropdown-content.show {
        display: block;
    }

    .dropdown-item-custom {
        color: #fff;
    }

    .ar-option,
    .en-option {
        background: transparent;
    }

    .ar-option:hover,
    .en-option:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

.custom_nav-container .navbar-nav .nav-item {
    padding: 0 12px;
    /* Reduced padding to prevent line breaks */
    display: flex;
    justify-content: center;
}

.custom_nav-container .navbar-nav {
    margin-inline-start: 0;
}

.navbar-nav {
    position: relative;
    padding-bottom: 5px;
}

.nav-indicator {
    position: absolute;
    bottom: -2px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
    width: 0;
    left: 0;
}

[dir="rtl"] .nav-indicator {
    left: auto;
    right: 0;
}

.custom_nav-container .navbar-nav .nav-item .nav-link {
    transition: var(--transition-smooth);
    padding: 10px 15px;
    position: relative;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* إزالة الحشو الجانبي ليكون الخط بقد النص */
    display: inline-block;
}

/* Remove legacy hover styles that might conflict */
.custom_nav-container .navbar-nav .nav-item .nav-link:hover {
    color: var(--accent-color) !important;
}

.custom_nav-container .navbar-nav .nav-item.active .nav-link {
    color: var(--accent-color) !important;
    font-weight: 700;
}

/* Hero Section Enhancements */
.hero_area .hero_bg_box {
    z-index: 0 !important;
    /* رفعه فوق خلفية الجسم body */
}

.slider_section {
    position: relative;
    z-index: 10;
}

.hero_bg_box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    z-index: 1;
    transition: var(--transition-smooth);
}

.hero_bg_box img {
    filter: brightness(0.85);
}

[data-theme="dark"] .hero_bg_box::before {
    background: transparent !important;
    /* مسح الطبقة اللونية تماماً في الوضع الداكن */
}

[data-theme="dark"] .hero_bg_box img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    filter: brightness(0.85);
    /* تقليل السطوع قليلاً فقط لراحة العين */
}

.slider_section .detail-box h1 {
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.4);
}

/* RTL Hero Text Adjustments */
[dir="rtl"] .slider_section .detail-box {
    text-align: right !important;
}

[dir="rtl"] .slider_section .detail-box h1,
[dir="rtl"] .slider_section .detail-box p {
    text-align: right !important;
    margin-inline-start: 2cm !important;
    /* Move text 2cm away from right edge for a wider text box */
    margin-inline-end: 0 !important;
    max-width: 95%;
    /* Increased from 85% to make the text box wider */
}

@media (max-width: 768px) {

    [dir="rtl"] .slider_section .detail-box h1,
    [dir="rtl"] .slider_section .detail-box p {
        margin-inline-start: 0 !important;
        text-align: center !important;
        max-width: 100%;
    }

    [dir="rtl"] .slider_section .detail-box {
        text-align: center !important;
    }
}

/* Typing Effect Placeholder */
.typewrite>.wrap {
    border-right: 0.08em solid #fff;
    font-family: 'Cairo', sans-serif;
    font-weight: 900 !important;
}

.type-color-1 {
    color: var(--accent-color, #00eaff);
}

.type-color-2 {
    color: #ffffff;
}

html[dir="rtl"] .typewrite>.wrap,
[dir="rtl"] .typewrite>.wrap {
    border-right: none;
    border-left: 0.08em solid #fff;
}

html[dir="rtl"] .typewriter,
[dir="rtl"] .typewriter {
    border-right: none;
    border-left: .12em solid rgba(255, 255, 255, 0.6);
}

/* Service Card Enhancements */
.Unit_section .container {
    perspective: 1000px;
    /* Adds depth for 3D effects */
}

.Unit_section .box {
    padding: 20px 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    transition: all 0.15s ease-out;
    /* Much faster and snappy */
    box-shadow: var(--shadow-subtle);
    height: auto;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.Unit_section .box:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(2deg) scale(1.03);
    box-shadow: 0 20px 40px rgba(26, 58, 143, 0.15), 0 0 25px rgba(0, 212, 255, 0.3);
    border-color: var(--accent-color);
    z-index: 10;
}

[data-theme="dark"] .Unit_section .box {
    background: #3b4252;
    border-color: rgba(0, 212, 255, 0.2);
}

[data-theme="dark"] .Unit_section .box:hover {
    border-color: var(--accent-color) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.5) !important;
    background: #434c5e;
}

.Unit_section .box .img-box {
    background-color: var(--accent-color) !important;
    /* اللون الفسفوري للأيقونات في الوضع العادي */
    transition: all 0.1s ease-out !important;
    position: relative;
    overflow: hidden;
}

.Unit_section .box:hover .img-box {
    background-color: #1a3a8f !important;
    transform: translateY(-5px);
}

/* استثناء بطائق الفريق من الحدود الفسفورية */
.doctor_section .box {
    border: none !important;
    box-shadow: var(--shadow-subtle);
}

.Unit_section .box .img-box img {
    z-index: 2;
    transition: var(--transition-smooth);
}

/* Team Section Enhancements */
.doctor_section {
    background: var(--bg-light) !important;
    color: var(--text-dark);
    padding-top: 60px !important;
    /* زيادة المسافة العلوية لضمان ظهور العنوان */
    margin-top: 0;
    /* إزالة الرفع لتجنب تداخل العناصر */
}

.doctor_section .heading_container {
    color: var(--text-dark) !important;
}

.doctor_section .box {
    margin-top: 60px;
    /* زيادة المسافة عن النص العلوي بمقدار 2 سم تقريباً */
    border: none;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-smooth);
}

.doctor_section .box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.doctor_section .box .img-box img {
    transition: var(--transition-smooth);
}

.doctor_section .box:hover .img-box img {
    transform: scale(1.1);
}

.doctor_section .box .detail-box .social_box {
    bottom: -20px;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 30px;
    padding: 10px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.doctor_section .box:hover .social_box {
    bottom: 20px;
    opacity: 1;
}

/* Contact Form Enhancements */
.contact-form .form-group {
    position: relative;
    margin-bottom: 25px;
}

.contact_section .form_container {
    background: #ffffff;
    padding: 45px;
    /* Increased from 35px */
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(26, 58, 143, 0.12), 0 0 15px rgba(0, 212, 255, 0.08);
    border: 2px solid rgba(0, 212, 255, 0.4);
    margin-inline-end: 30px;
    /* Use logical property for RTL/LTR support */
    position: relative;
    z-index: 2;
}

.contact_info_box {
    padding-inline-start: 20px;
    /* Use logical property for RTL/LTR support */
    position: relative;
    z-index: 1;
}

/* === Contact Detail Cards === */
.contact_detail_card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #ffffff;
    border: 2px solid rgba(43, 99, 219, 0.3);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 5px 15px rgba(26, 58, 143, 0.08);
    transition: all 0.25s ease;
}

.contact_detail_card:hover {
    border-color: #2b63db;
    box-shadow: 0 10px 25px rgba(26, 58, 143, 0.15), 0 0 10px rgba(0, 212, 255, 0.15);
    transform: translateY(-4px);
}

.contact_detail_card .icon_wrapper {
    width: 46px;
    height: 46px;
    min-width: 46px;
    background: linear-gradient(135deg, #2b63db, #00D4FF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(43, 99, 219, 0.35);
}

.contact_detail_card .text_content {
    flex: 1;
    min-width: 0;
}

.contact_detail_card .text_content h5 {
    font-weight: 700;
    color: #1a3a8f;
    margin-bottom: 4px;
    font-size: 1rem;
}

.contact_detail_card .text_content p {
    color: #4a5568;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    word-break: break-word;
}

[data-theme="dark"] .contact_detail_card {
    background: #3b4252;
    border-color: rgba(0, 212, 255, 0.3);
}

[data-theme="dark"] .contact_detail_card .text_content h5 {
    color: #00D4FF;
}

[data-theme="dark"] .contact_detail_card .text_content p {
    color: #cbd5e0;
}

.contact_section .form_container input,
.contact_section .form_container .message-box {
    width: 100%;
    border: 1.5px solid rgba(43, 99, 219, 0.4);
    background: #f8fafc;
    border-radius: 10px;
    padding: 22px 20px 10px 20px;
    /* More top padding to prevent overlap with label */
    outline: none;
    font-size: 0.95rem;
    color: #2d3748;
    transition: all 0.3s ease;
    height: 58px;
    /* Fixed height for consistency */
}

.contact_section .form_container .message-box {
    height: 225px;
    /* Reduced by ~2cm (from 300px) */
    resize: none;
    padding-top: 22px;
    /* Keep consistent top padding */
}

.contact-form label {
    position: absolute;
    inset-inline-start: 25px;
    inset-block-start: 18px;
    color: #a0aec0;
    pointer-events: none;
    transition: var(--transition-smooth);
    font-weight: 500;
}

/* حالة التركيز (Focus) مع حدود وألوان احترافية */
.contact_section .form_container input:focus,
.contact_section .form_container .message-box:focus {
    background: #ffffff;
    border-color: transparent;
    border-image: var(--primary-gradient) 1;
    /* حدود ملونة بتدرج */
    border-style: solid;
    border-width: 2px;
    box-shadow: 0 10px 25px rgba(43, 99, 219, 0.15),
        0 0 10px rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

/* تحريك النص (Label) عند الكتابة أو التركيز */
.contact_section .form_container input:focus~label,
.contact_section .form_container input:not(:placeholder-shown)~label,
.contact_section .form_container .message-box:focus~label,
.contact_section .form_container .message-box:not(:placeholder-shown)~label {
    inset-block-start: -10px;
    inset-inline-start: 12px;
    font-size: 0.65rem;
    /* تصغير حجم العنوان التوضيحي */
    color: #2b63db;
    background: #ffffff;
    padding: 0 5px;
    font-weight: 700;
}

[data-theme="dark"] .contact_section .form_container {
    background: #2e3440;
    border: 2px solid var(--accent-color) !important;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.2) !important;
    /* الحفاظ على الحدود الفسفورية في الوضع الليلي */
}

[data-theme="dark"] .contact_section .form_container input,
[data-theme="dark"] .contact_section .form_container .message-box {
    background: #3b4252;
    border-color: rgba(0, 212, 255, 0.4) !important;
    /* حدود زرقاء فسفورية خفيفة */
    color: #eceff4;
}

[data-theme="dark"] .contact_section .form_container input:focus,
[data-theme="dark"] .contact_section .form_container .message-box:focus {
    background: #3b4252;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .contact_section .form_container input:focus~label,
[data-theme="dark"] .contact_section .form_container input:not(:placeholder-shown)~label,
[data-theme="dark"] .contact_section .form_container .message-box:focus~label,
[data-theme="dark"] .contact_section .form_container .message-box:not(:placeholder-shown)~label {
    background: #2e3440;
    color: var(--accent-color);
}

.contact_section .btn_box button {
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 1px;
    overflow: hidden;
    position: relative;
    background: var(--primary-gradient);
    border: none;
    padding: 12px 60px;
    color: #fff;
    transition: var(--transition-smooth);
}

.contact_section .btn_box button:hover {
    transform: translateY(-3px);
    background: var(--accent-color) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

.contact_section .btn_box button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.contact_section .btn_box button:hover::before {
    left: 100%;
}

.contact_section .btn_box button i {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact_section .btn_box button:hover i {
    color: #ffffff !important;
    transform: translateX(3px) scale(1.1);
}

.contact_section .btn_box button:active {
    transform: translateY(1px);
    background: #00b8e6 !important;
    /* Slightly darker cyan for click feedback */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.contact_section .btn_box button:active i {
    color: #ffffff !important;
    transform: scale(1.3) rotate(-15deg);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* Specific text color for active state to ensure visibility */
.contact_section .btn_box button:active {
    color: #f8fafc !important;
}

[data-theme="dark"] .contact_section .btn_box button:active {
    color: #ffffff !important;
}

/* Typography & Global RTL Overrides */
[dir="rtl"] body {
    font-family: 'Tajawal', 'Cairo', sans-serif !important;
    text-align: right;
    direction: rtl;
}

/* Global Font Overrides for RTL */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] p,
[dir="rtl"] a,
[dir="rtl"] span,
[dir="rtl"] input,
[dir="rtl"] button {
    font-family: 'Tajawal', 'Cairo', sans-serif !important;
    letter-spacing: normal !important;
}

/* Bootstrap 4 RTL Fixes (Flipped Grids/Flex) */
[dir="rtl"] .row {
    flex-direction: row-reverse;
}

[dir="rtl"] .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

[dir="rtl"] .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .text-md-start,
[dir="rtl"] .text-start,
[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-md-end,
[dir="rtl"] .text-end,
[dir="rtl"] .text-right {
    text-align: left !important;
}

[dir="rtl"] .heading_container {
    align-items: flex-start;
    /* Reset to start which is right in RTL since row is reversed */
}

[dir="rtl"] .heading_container.heading_center {
    align-items: center;
    text-align: center !important;
}

[dir="rtl"] .heading_container.heading_center h2,
[dir="rtl"] .heading_container.heading_center p {
    text-align: center !important;
}

/* Input & Form RTL Fixes */
[dir="rtl"] .contact_section .form_container input,
[dir="rtl"] .contact_section .form_container .message-box {
    padding: 12px 20px;
    text-align: right;
}

/* Icon Flipping */
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .link-icon {
    transform: scaleX(-1);
}

[dir="rtl"] .footer_social a {
    margin-right: 0 !important;
    margin-left: 10px;
}

[dir="rtl"] .footer_links a {
    margin-right: 0 !important;
    margin-left: 15px;
}

/* Fixing Logo margin in RTL */
[dir="rtl"] .navbar-brand {
    margin-left: 0 !important;
    margin-right: -20px !important;
}

/* Footer Modernization */
.modern-footer {
    background: var(--nav-footer-bg) !important;
    /* Consistent color with navbar */
    color: #f3f4f6 !important;
    padding: 30px 0 15px !important;
    /* Reduced from 80/40 for a more compact look */
    position: relative;
    border-top: 4px solid var(--accent-color);
}

.footer_heading {
    color: #ffffff !important;
    font-size: 1.15rem;
    /* Slightly smaller heading */
    font-weight: 800;
    margin-bottom: 20px;
    /* Reduced from 25 */
    position: relative;
    padding-bottom: 8px;
    /* Reduced from 10 */
}

.footer_heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

[dir="rtl"] .footer_heading::after {
    left: auto;
    right: 0;
}

.footer_desc_text {
    line-height: 1.6;
    /* Reduced from 1.8 */
    color: #9ca3af;
    font-size: 0.9rem;
    /* Slightly smaller text */
    margin-bottom: 20px;
    /* Reduced from 25 */
}

.footer_social {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    /* Reduced from 15px */
}

.footer_links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Tightened from 8px */
}

.footer_links a {
    color: #9ca3af !important;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    margin-bottom: 0 !important;
    /* Override legacy 15px margin */
    line-height: 1.4;
}

.footer_links a .link-icon {
    font-size: 0.8rem;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

[dir="rtl"] .footer_links a .link-icon {
    transform: none;
}

.footer_links a:hover {
    color: var(--accent-color) !important;
    transform: translateX(5px);
}

[dir="rtl"] .footer_links a:hover {
    transform: translateX(-5px);
}

.footer_links a.active {
    color: #ffffff !important;
    font-weight: 700;
}

.contact_link_box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Tightened from 12px */
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-decoration: none;
    color: #9ca3af !important;
    transition: var(--transition-smooth);
    margin: 0 !important;
    /* Override legacy 5px vertical margin */
}

.contact-item i {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-top: 3px;
}

.contact-item span {
    line-height: 1.3;
    /* Reduced from 1.4 */
    font-size: 0.9rem;
    /* Slightly smaller text */
}

.contact-item:hover {
    color: #ffffff !important;
}

.footer_social {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    /* Reduced from 15px */
}

.footer_social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff !important;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer_social a:hover {
    background: var(--accent-color);
    color: #111827 !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.3);
}

.footer_divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 15px 0 10px;
    /* Reduced from 25/15 to 15/10 */
}

.footer-bottom {
    padding-bottom: 20px;
}

.copyright_text {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.footer-logo {
    height: 90px !important;
    width: auto !important;
    max-width: 250px;
    filter: brightness(0) invert(1) drop-shadow(0 0 10px #00D4FF) drop-shadow(0 0 20px rgba(0, 212, 255, 0.6)) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.footer_logo a:hover .footer-logo {
    filter: brightness(0) invert(1) drop-shadow(0 0 20px #00D4FF) drop-shadow(0 0 40px rgba(0, 212, 255, 0.8)) drop-shadow(0 0 60px rgba(0, 212, 255, 0.4)) !important;
    transform: scale(1.07) !important;
}

/* Header/Nav logical fixes for RTL */
[dir="rtl"] .navbar-brand {
    margin-left: 0;
    margin-right: -20px;
}

[dir="rtl"] .theme-toggle-btn {
    margin-left: 0;
    margin-right: 40px;
}

[dir="rtl"] .contact-form label {
    left: auto;
    right: 25px;
}

[dir="rtl"] .contact_section .form_container input:focus~label,
[dir="rtl"] .contact_section .form_container input:not(:placeholder-shown)~label,
[dir="rtl"] .contact_section .form_container .message-box:focus~label,
[dir="rtl"] .contact_section .form_container .message-box:not(:placeholder-shown)~label {
    left: auto;
    right: 12px;
}


/* Stats Section */
.stats_section {
    background: var(--bg-light);
    padding-top: 0 !important;
    margin-top: 50px;
    /* مسافة متوازنة بمقدار 2 سم تقريباً */
    position: relative;
    z-index: 20;
}

.contact_info_box {
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: auto;
    padding-top: 80px;
    margin-left: -60px !important;
    /* Pulls info item closer to the form across all modes */
    /* Raised slightly to center better with the message box */
    /* Aligns with the middle area next to message box */
}

.contact_detail_card {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    box-shadow: none;
    border: none;
    transition: var(--transition-smooth);
}

[data-theme="dark"] .contact_detail_card {
    background: transparent;
}

.contact_detail_card:hover {
    transform: translateY(-5px);
}

.contact_detail_card .icon_wrapper {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: var(--accent-color);
    font-size: 1.4rem;
    box-shadow: none;
}

.contact_detail_card .text_content h5 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a3a8f;
    /* Dark blue for light mode visibility */
}

[data-theme="dark"] .contact_detail_card .text_content h5 {
    color: #ffffff;
}

.contact_detail_card .text_content p {
    margin: 5px 0 0;
    font-size: 0.95rem;
    color: #6c757d;
    /* Muted gray for light mode */
}

[data-theme="dark"] .contact_detail_card .text_content p {
    color: rgba(255, 255, 255, 0.7);
}

/* RTL Adjustments for vertical alignment */
[dir="rtl"] .contact_section .row {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .contact_detail_card {
    align-items: flex-start !important;
    /* This is Right side in RTL */
    text-align: right !important;
}

[dir="rtl"] .contact_detail_card .icon_wrapper {
    justify-content: flex-start !important;
}

[dir="rtl"] .contact_detail_card p {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
}

/* Specifically for address which should stay RTL but aligned right */
[dir="rtl"] .contact_detail_card:first-child p {
    direction: rtl;
}

.stat-box {
    padding: 30px 20px;
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(43, 99, 219, 0.08);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stat-box:hover {
    transform: translateY(-10px) scale(1.03);
    background: linear-gradient(135deg, #e8f0fe 0%, #f0faff 100%);
    border-color: #2b63db;
    box-shadow: 0 20px 45px rgba(43, 99, 219, 0.2), 0 0 15px rgba(0, 212, 255, 0.15);
}

.stat-box h2 {
    font-size: 3rem;
    font-weight: 900;
    color: #00D4FF;
    /* Phosphorescent Blue */
    margin-bottom: 5px;
    transition: var(--transition-smooth);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
    /* Neon blue glow */
}

.stat-box:hover h2 {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
}

.stat-box p {
    color: #6c757d;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
}

.stat-box:hover p {
    color: #1a3a8f;
}

[data-theme="dark"] .stat-box:hover {
    background: linear-gradient(135deg, #3b4252 0%, #434c5e 100%) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.35) !important;
    transform: translateY(-10px) scale(1.03);
}

[data-theme="dark"] .stat-box h2 {
    color: #00D4FF !important;
    /* Keep neon blue in dark mode */
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.5) !important;
}

[data-theme="dark"] .stat-box:hover h2 {
    color: #ffffff !important;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.8) !important;
}

/* Floating Buttons Container */
.floating-buttons-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.floating-whatsapp-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}

/* RTL for floating containers */
[dir="rtl"] .floating-buttons-container {
    right: auto;
    left: 30px;
}

[dir="rtl"] .floating-whatsapp-container {
    left: auto;
    right: 30px;
}

.floating-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Hover Effect for Floating Buttons */
.floating-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(0, 212, 255, 0.4);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.floating-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.6s;
}

.floating-btn:hover::after {
    left: 100%;
}

/* Theme Toggle Button Specifics */
.theme-toggle-btn {
    background: #1a3a8f;
    /* Default dark background for the icon */
}

/* WhatsApp Floating Button Specifics */
.whatsapp-btn {
    background: #25D366 !important;
    color: #fff !important;
    border-color: #128C7E !important;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3) !important;
}

.whatsapp-btn:hover {
    background: #128C7E !important;
    box-shadow: 0 0 20px #25D366, 0 0 40px rgba(37, 211, 102, 0.6) !important;
    transform: translateY(-5px) scale(1.1) !important;
}

/* Navbar WhatsApp Link */
.nav-whatsapp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none !important;
    transition: var(--transition-smooth);
    margin-inline-start: 2.5cm;
    /* Specific 2.5cm spacing from language icon */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.nav-whatsapp-link i {
    font-size: 1.6rem;
    /* Larger icon since text is removed */
    color: #25D366;
    filter: drop-shadow(0 0 5px rgba(37, 211, 102, 0.5));
}

.nav-whatsapp-link:hover {
    background: rgba(37, 211, 102, 0.3);
    border-color: #25D366;
    transform: scale(1.15);
}

.nav-whatsapp-link:hover i {
    filter: drop-shadow(0 0 10px #25D366);
}

/* Responsive adjustment for navbar whatsapp */
@media (max-width: 991px) {
    .nav-whatsapp-link {
        margin-inline-end: 0;
        margin-bottom: 10px;
        justify-content: center;
    }
}

/* Scroll to Top Button Specifics */
.scroll-to-top-btn {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dark Mode Adjustments for Floating Buttons */
[data-theme="dark"] .floating-btn {
    background: #3b4252;
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .floating-btn:hover {
    background: var(--accent-color);
    color: #1a3a8f;
}

/* Responsive Scaling for Mobile */
@media (max-width: 576px) {
    .floating-buttons-container {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .hero_area {
        min-height: auto;
    }

    .slider_section .detail-box h1 {
        font-size: 2rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 5 Columns Layout for Team */
.col-lg-5-cols {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 10px;
}

@media (min-width: 992px) {
    .col-lg-5-cols {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

.doctor_section .box {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
    /* High-contrast white border on cyan bg */
    background: #ffffff;
    border-radius: 20px !important;
    box-shadow: 0 4px 20px rgba(26, 58, 143, 0.25), 0 0 10px rgba(255, 255, 255, 0.5);
}

.doctor_section .box:hover {
    transform: translateY(-10px);
    background: #fdfdfd;
    border-color: #2b63db;
    box-shadow: 0 15px 35px rgba(26, 58, 143, 0.2), 0 0 15px rgba(0, 212, 255, 0.2);
}

[data-theme="dark"] .doctor_section .box {
    background: #3b4252 !important;
    border: 2px solid rgba(0, 212, 255, 0.2) !important;
    /* Same as Our Services in dark mode */
}

[data-theme="dark"] .doctor_section .box:hover {
    background: #434c5e !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.3) !important;
}

/* Section Spacing Refinements */
.stats_section.layout_padding {
    padding-bottom: 40px !important;
}

.Unit_section.layout_padding {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

.doctor_section.layout_padding {
    padding-top: 40px !important;
}