.btn i {
    margin-left: 8px;
}

:root {
    --primary-color: #082a55;
    --secondary-color: #1a73e8;
    --accent-color: #d9262d;
    --light-color: #ffffff;
    --dark-color: #2c3e50;
    --text-grey: #6c7a89;
    --grey-bg: #f8f9fa;
    --hero-overlay-color: rgba(8, 42, 85, 0.85);
    --white-fixed: #ffffff;
    /* Slightly darker for better text contrast */
    --font-family: 'Cairo', sans-serif;
    --section-padding: 100px 0;
    /* Increased padding for more breathing room */
    --border-radius: 16px;
    /* More rounded corners */
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Softer, larger shadow */
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --gradient-primary: linear-gradient(135deg, #082a55 0%, #0a3d7c 100%);
    --gradient-secondary: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    --body-bg: #ffffff;
    --card-bg: #ffffff;
    --heading-color: #082a55;
    --text-color: #6c7a89;
}

body.dark-mode {
    --primary-color: #4da3ff;
    /* Lighter blue for dark mode */
    --secondary-color: #64b5f6;
    --light-color: #1e293b;
    /* Darker background for "light" areas */
    --dark-color: #e2e8f0;
    --text-grey: #94a3b8;
    --grey-bg: #0f172a;
    /* Very dark blue/grey for backgrounds */
    --hero-overlay-color: rgba(2, 6, 23, 0.9);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --body-bg: #0b1120;
    --card-bg: #1e293b;
    --heading-color: #f1f5f9;
    --text-color: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== Preloader ==================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--body-bg);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, visibility;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-logo {
    width: 120px;
    margin-bottom: 20px;
    animation: pulse 2s infinite ease-in-out;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(8, 42, 85, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.preloader-hidden,
html.fast-load #preloader {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--body-bg);
    font-family: var(--font-family);
    line-height: 1.85;
    color: var(--text-color);
    direction: rtl;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font-size: 1.1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    margin-bottom: 22px;
    color: var(--heading-color);
}

h1 {
    font-size: 3.2em;
    line-height: 1.2;
}

h2 {
    font-size: 2.6em;
    line-height: 1.25;
}

h3 {
    font-size: 2em;
    line-height: 1.3;
}

h4 {
    font-size: 1.6em;
    line-height: 1.4;
}

h5 {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--secondary-color);
    margin-top: 18px;
    margin-bottom: 8px;
}


p {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1em;
    line-height: 1.9;
}

.category-description {
    font-size: 1.05em;
    padding: 0px 0px 18px 0px;
    color: var(--text-grey);
    margin-bottom: 30px;
    line-height: 1.9;
    text-align: center;
}


.sub-category-title {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}


a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

main.page-container,
.page-container {
    padding-top: 120px;
    padding-bottom: 60px;
    flex-grow: 1;
}


.section-padding {
    padding: var(--section-padding);
}

.section-title,
.page-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after,
.page-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

.page-title {
    font-size: 2.8em;
    margin-top: 20px;
}


.section-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: #777;
    margin-top: -35px;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    /* Changed from inline-block for better icon alignment */
    align-items: center;
    justify-content: center;
    padding: 14px 35px;
    border-radius: 50px;
    font-size: 1.05em;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    border: none;
    /* Reset border */
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-width: 200px;
    /* Ensure uniform width if desired, or just consistent height */
    height: 54px;
    /* Fixed height for perfect alignment */
    text-decoration: none;
    /* Ensure links have no underline */
    line-height: normal;
    /* Reset line-height to let flexbox handle vertical align */
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn-primary {
    background: var(--white-fixed);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--white-fixed);
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--light-color);
    border-color: var(--secondary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: var(--light-color);
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.grey-bg {
    background-color: var(--grey-bg);
}

.whatsapp-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #25D366;
    color: var(--light-color) !important;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.whatsapp-link:hover {
    background-color: #1DAE50;
    color: var(--light-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.whatsapp-link i {
    margin-right: 8px;
}

.whatsapp-action-link {
    display: block;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: var(--secondary-color);
    color: var(--light-color) !important;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.whatsapp-action-link:hover {
    background-color: var(--primary-color);
    color: var(--light-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.whatsapp-action-link i {
    margin-right: 8px;
}


.map-link {
    display: inline-block;
    margin-top: 5px;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.2s ease;
}

.map-link:hover {
    transform: translateY(-2px);
}

.map-link i {
    margin-left: 5px;
}

/* ==================== Header / Navbar ==================== */
.main-header {
    background-color: transparent;
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s ease;
}

.main-header.scrolled {
    background-color: rgba(8, 42, 85, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-height: 80px;
    transition: max-height 0.3s ease;
}

.main-header.scrolled .logo img {
    max-height: 65px;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin: 0 12px;
    position: relative;
}

.nav-links li:last-child {
    margin-left: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05em;
    font-weight: 600;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s ease, transform 0.2s ease;
    display: block;
    /* Ensure links take full width for padding */
}

.nav-links a i {
    margin-right: 5px;
    font-size: 0.7em;
    /* Smaller size for the icon */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--light-color);
    transform: translateY(-2px);
}

/* Dropdown Styles */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: var(--primary-color);
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    border-radius: var(--border-radius);
    padding: 10px 0;
    top: 100%;
    /* Position below the parent link */
    right: 0;
    /* Align to the right for RTL */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    /* Reset margin for dropdown items */
}

.dropdown-menu li a {
    color: var(--light-color);
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 500;
    white-space: nowrap;
    /* Prevent text wrapping */
}

.dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-color);
    transform: none;
    /* Reset transform for dropdown items */
}

.dropdown-menu li a::after {
    display: none;
    /* Hide underline for dropdown items */
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    /* Increased gap */
}

/* Mobile adjustments for toggle placement */
@media (max-width: 768px) {
    .header-controls {
        gap: 25px;
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
    }
}

.lang-switcher {
    margin-right: 20px;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-btn {
    background-color: transparent;
    color: var(--light-color);
    border: 1px solid var(--light-color);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.lang-btn:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.lang-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--light-color);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: var(--border-radius);
}

.lang-dropdown-content a {
    color: var(--dark-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.lang-dropdown-content a:hover {
    background-color: var(--grey-bg);
}

.lang-dropdown:hover .lang-dropdown-content {
    display: block;
}

/* ==================== Hero Section ==================== */
.hero-section {
    height: 100vh;
    min-height: 600px;
    background-image: url('images/istockphoto-1354171893-612x612.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-color);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(8, 42, 85, 0.9) 0%, rgba(8, 42, 85, 0.7) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 80px;
}

.hero-content h1 {
    font-size: 4em;
    margin-bottom: 25px;
    line-height: 1.2;
    color: var(--white-fixed);
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.5em;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

/* ==================== Content Item (Reusable) ==================== */
.content-item {
    display: flex;
    align-items: center;
    gap: 50px;
}

.content-item.reverse {
    flex-direction: row-reverse;
}

.content-image {
    flex: 1 1 45%;
    max-width: 45%;
}

.content-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.content-text {
    flex: 1 1 55%;
    max-width: 55%;
}

.content-text h3 {
    margin-bottom: 15px;
    font-size: 2em;
}

.content-text p {
    font-size: 1.05em;
    line-height: 1.9;
}

.content-text ul {
    padding-right: 20px;
}

.content-text ul li {
    margin-bottom: 12px;
}




/* ==================== Core Values Section ==================== */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.value-card {
    background-color: var(--light-color);
    padding: 30px 25px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.value-icon {
    font-size: 2.8em;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.value-card h4 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

/* ==================== Special Services Section (Cards Layout) ==================== */
.services-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    /* Increased gap */
}

.service-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--card-hover-shadow);
}

.service-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.service-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card-title {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.service-card-content p {
    font-size: 1em;
    line-height: 1.9;
    color: var(--text-grey);
    margin-bottom: 12px;
}

.service-card-content p:last-of-type {
    margin-bottom: 18px;
}

.service-card .whatsapp-link,
.service-card .whatsapp-action-link {
    margin-top: auto;
    align-self: center;
    width: fit-content;
    min-width: 180px;
}


/* ==================== Medical Tests Intro Section (on index.html) ==================== */
#medical-tests-intro .content-item .content-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#medical-tests-intro .content-item .section-title {
    text-align: right;
}

/* ==================== Why Choose Us Section ==================== */
.why-choose-us-section .content-text ul {
    padding-right: 0;
}

.why-choose-us-section .content-text li {
    font-size: 1.1em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.list-icon {
    color: var(--secondary-color);
    font-size: 1.5em;
    margin-left: 15px;
    width: 25px;
    text-align: center;
}

/* ==================== Contact Section ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.contact-info h4,
.working-hours h4 {
    font-size: 1.6em;
    margin-bottom: 20px;
}

.contact-info p,
.working-hours li {
    margin-bottom: 12px;
    font-size: 1.05em;
}

.contact-info p i,
.working-hours li strong {
    margin-left: 10px;
    color: var(--secondary-color);
    width: 20px;
}

.working-hours ul {
    padding-right: 0;
}

/* ==================== Contact Form Styles ==================== */
.contact-form h4 {
    font-size: 1.6em;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group textarea {
    resize: vertical;
}

.contact-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
}

.map-embed-container {
    width: 100%;
    min-height: 350px;
    height: 450px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-top: 30px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-embed-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==================== Testimonials Section ==================== */
.testimonials-section {
    background-color: var(--grey-bg);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--light-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.testimonial-text {
    font-size: 1.05em;
    line-height: 1.9;
    color: var(--text-grey);
    margin-bottom: 25px;
    font-style: italic;
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
    margin-top: auto;
}


/* ==================== Footer Section ==================== */
.main-footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    padding-top: 50px;
    padding-top: 50px;
    flex-shrink: 0;
}

body.dark-mode .main-footer {
    background-color: #0b1120;
    /* Very dark background for footer in dark mode */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 40px;
}

.footer-logo {
    max-height: 120px;
    margin: 0 auto 15px auto;
}

.footer-about p {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.7);
}

.footer-links h5,
.footer-contact h5 {
    font-size: 1.3em;
    color: var(--light-color);
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a,
.footer-contact p a {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .footer-links ul li a {
    color: rgba(255, 255, 255, 0.9);
    /* Force white in dark mode */
}

.footer-links ul li a:hover,
body.dark-mode .footer-links ul li a:hover {
    color: var(--light-color);
    padding-right: 5px;
}

.footer-contact p {
    margin-bottom: 10px;
    font-size: 0.95em;
}

.contact-info p i.fab.fa-whatsapp,
.contact-info p i.fas.fa-envelope {
    margin-left: 8px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.social-link:hover {
    color: var(--light-color);
}

.social-link i.fab.fa-facebook-f {
    color: var(--light-color);
    font-size: 1.2em;
    margin-left: 8px;
    transition: color 0.3s ease;
}

.social-link:hover i.fab.fa-facebook-f {
    color: #1877F2;
}


.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== Mobile Menu Toggle Icon ==================== */
.menu-toggle {
    display: none;
    font-size: 1.8em;
    color: var(--light-color);
    cursor: pointer;
}


/* ==================== Test Category Cards (tests.html index page) ==================== */
.test-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}




.category-card {
    display: flex;
    flex-direction: column;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.category-card .card-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    margin: 0 auto 25px auto;
    border-radius: var(--border-radius);
    border: 2px solid var(--grey-bg);
}

.card-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.category-card:hover .card-title {
    color: var(--secondary-color);
}

.card-description {
    font-size: 0.95em;
    color: var(--text-grey);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 0;
}


/* ==================== Test Detail Item Styles (for sub-pages - Direct Display with TOC) ==================== */
.test-details-direct-container {
    margin-top: 30px;
}

.test-entry-direct {
    background-color: var(--light-color);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.test-entry-direct h4 {
    font-size: 1.8em;
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.test-entry-direct h5 {
    font-size: 1.25em;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
}

.test-entry-direct p {
    font-size: 1.05em;
    line-height: 1.8;
    padding-right: 15px;
    color: var(--text-grey);
    margin-bottom: 15px;
}

.test-separator {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: 40px 0;
}

/* Search Container Styling */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 40px auto;
}

.search-container input {
    width: 100%;
    padding: 15px 20px;
    padding-left: 50px;
    /* Space for icon */
    border: 2px solid #ddd;
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-icon {
    position: absolute;
    left: 20px;
    /* Positioning on left for RTL */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-grey);
    font-size: 1.2em;
    /* Thicker/larger */
    pointer-events: none;
}

/* Dark Mode for Search */
body.dark-mode .search-container input {
    background-color: #1e293b;
    border-color: #334155;
    color: var(--light-color);
}

body.dark-mode .search-icon {
    color: rgba(255, 255, 255, 0.7);
}

/* Dark Mode for Main Sections Text */
body.dark-mode .section-subtitle,
body.dark-mode .faq-answer p,
body.dark-mode .testimonial-text,
body.dark-mode .card-description,
body.dark-mode p {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5 {
    color: var(--light-color);
}

body.dark-mode .test-entry-direct p {
    color: rgba(255, 255, 255, 0.85);
}

.page-toc {
    background-color: var(--grey-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
    box-shadow: var(--box-shadow);
}

.page-toc h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.6em;
    color: var(--primary-color);
    text-align: center;
}

.page-toc ul {
    list-style: decimal;
    padding-right: 30px;
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
    gap: 20px;
}

.page-toc ul li {
    margin-bottom: 10px;
}

.page-toc ul li a {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.1em;
    display: block;
    padding: 3px 0;
}

.page-toc ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ==================== Animation Classes ==================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
}

/* ==================== Packages Page Card Styles (packages.html) ==================== */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.package-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.package-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.package-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid var(--secondary-color);
}

.package-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.package-card-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
    min-height: 2.4em;
}

.package-description-detail {
    font-size: 0.95em;
    color: var(--text-grey);
    line-height: 1.9;
    /* Adjusted line height for better readability */
    margin-bottom: 25px;
    /* Increased margin for better separation */
}

.package-spacer {
    flex-grow: 1;
    min-height: 15px;
}

.package-cta-button {
    margin-top: 0;
    align-self: center;
    width: 100%;
    padding: 12px 20px;
    font-size: 1em;
}

/* ==================== Dark Mode FAQ Overrides ==================== */
body.dark-mode .faq-item {
    background-color: transparent !important;
    /* Fix for white on white issue */
    border: none !important;
}

body.dark-mode .faq-question {
    background-color: transparent !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    /* Subtle separator instead */
}

body.dark-mode .faq-question:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--secondary-color) !important;
}

body.dark-mode .faq-question.active {
    background-color: transparent !important;
    color: var(--secondary-color) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .faq-answer {
    background-color: transparent !important;
    color: var(--text-color) !important;
    border-top: none;
    padding-left: 0;
}

body.dark-mode .faq-answer p {
    color: rgba(255, 255, 255, 0.9) !important;
}


/* ==================== Back to Top Button ==================== */
#backToTopBtn {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* Changed from right to left for RTL sites */
    z-index: 999;
    border: none;
    outline: none;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-size: 18px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    /* Enhanced shadow */
    transition: background-color 0.3s, opacity 0.3s, transform 0.2s;
    /* Added transform */
}

#backToTopBtn:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}


/* ==================== Responsive Design ==================== */
@media (max-width: 992px) {

    .content-item,
    .content-item.reverse {
        flex-direction: column;
        text-align: center;
    }

    .content-image,
    .content-text {
        max-width: 100%;
    }

    .content-image {
        margin-bottom: 30px;
    }

    .content-text h3 {
        font-size: 1.8em;
    }

    .content-text ul {
        padding-right: 0;
        text-align: right;
    }

    .hero-content h1 {
        font-size: 3em;
    }

    .hero-content p {
        font-size: 1.2em;
    }

    #medical-tests-intro .content-item .content-text,
    #medical-tests-intro .content-item .section-title {
        align-items: center;
        text-align: center;
    }

    .test-category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .page-toc ul {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
    }

    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--primary-color);
        width: 100%;
        padding: 15px 0;
        text-align: center;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin-right: 0;
        margin-bottom: 12px;
        width: 100%;
    }

    .nav-links li:last-child {
        margin-bottom: 0;
    }

    .nav-links a {
        display: block;
        padding: 12px;
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }

    .page-title {
        font-size: 2.2em;
    }

    h1 {
        font-size: 2.5em;
    }

    h2 {
        font-size: 2em;
    }

    .hero-content h1 {
        font-size: 2.8em;
    }

    .hero-content p {
        font-size: 1.1em;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .services-card-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-about,
    .footer-links,
    .footer-contact {
        margin-bottom: 20px;
    }

    .footer-links ul,
    .footer-contact p {
        text-align: center;
    }

    .test-category-grid {
        grid-template-columns: 1fr;
    }

    .card-image {
        width: 120px;
        height: 120px;
    }

    .card-title {
        font-size: 1.3em;
    }

    .card-description {
        font-size: 0.85em;
    }

    .test-entry-direct h4 {
        font-size: 1.5em;
    }

    .test-entry-direct h5 {
        font-size: 1.1em;
    }

    .test-entry-direct p {
        padding-right: 5px;
        font-size: 1em;
    }

    .page-toc h4 {
        font-size: 1.3em;
    }

    .page-toc ul li a {
        font-size: 1em;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

    .package-card-title {
        font-size: 1.5em;
    }

    #backToTopBtn {
        bottom: 20px;
        padding: 8px 10px;
        font-size: 14px;
    }

    html[dir="rtl"] #backToTopBtn {
        left: 15px;
    }

    html[dir="ltr"] #backToTopBtn {
        left: 20px;
    }

    /* Mobile Dropdown Styles */
    .nav-links .dropdown {
        width: 100%;
    }

    .nav-links .dropdown>a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: none;
        background-color: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border-radius: 0;
        padding: 10px 20px 10px 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    .dropdown.open>.dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        padding: 10px 30px 10px 0;
        font-size: 0.9em;
    }

    .dropdown.open>a i.fa-chevron-down {
        transform: rotate(180deg);
    }

    .dropdown:hover .dropdown-menu {
        display: none;
    }

    .dropdown.open:hover .dropdown-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 1em;
    }

    .hero-content h1 {
        font-size: 2.2em;
    }

    .hero-content p {
        font-size: 1em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .section-padding {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2em;
    }

    .page-title {
        font-size: 1.8em;
    }

    .logo img {
        max-height: 60px;
    }

    .main-header.scrolled .logo img {
        max-height: 50px;
    }
}





/* ==================== FAQ Page Styles ==================== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    background-color: var(--light-color);
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-color);
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: var(--grey-bg);
}

.faq-question::after {
    content: '\f078';
    /* Font Awesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background-color: var(--light-color);
}

.faq-answer p {
    padding: 25px;
    margin: 0;
    font-size: 1.05em;
    line-height: 1.8;
    border-top: 1px solid #e0e0e0;
}

/* ==================== WhatsApp Floating Button ==================== */
.whatsapp-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    animation: pulse-animation 2s infinite;
    text-decoration: none;
}

.whatsapp-floating-btn:hover {
    background-color: #1DAE50;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    animation: none;
}

.whatsapp-floating-btn i {
    font-size: 32px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (max-width: 768px) {
    .whatsapp-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .whatsapp-floating-btn i {
        font-size: 28px;
    }
}

.facebook-floating-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #1877F2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
    text-decoration: none;
}

.facebook-floating-btn:hover {
    background-color: #0a5dd8;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.6);
}

.facebook-floating-btn i {
    font-size: 32px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .facebook-floating-btn {
        bottom: 90px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .facebook-floating-btn i {
        font-size: 28px;
    }
}

/* ==================== Booking Modal ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--light-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 2em;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-color);
}

/* Redesigned Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--secondary-color);
    color: var(--light-color);
    transform: rotate(15deg);
}

body.dark-mode .theme-toggle {
    border-color: var(--light-color);
    color: var(--light-color);
}

body.dark-mode .theme-toggle:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* ==================== FINAL DARK MODE TEXT OVERRIDES ==================== */
/* High specificity to ensure text visibility in all contexts */

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .card-title,
body.dark-mode .section-title,
body.dark-mode .page-title,
body.dark-mode .sub-category-title,
body.dark-mode .test-entry-direct h4,
body.dark-mode .test-entry-direct h5,
body.dark-mode .content-text h3,
body.dark-mode .faq-question,
body.dark-mode .package-card-title,
body.dark-mode .testimonial-author {
    color: #ffffff !important;
}

body.dark-mode .section-subtitle,
body.dark-mode p,
body.dark-mode li,
body.dark-mode .card-description,
body.dark-mode .testimonial-text,
body.dark-mode .test-entry-direct p,
body.dark-mode .package-description-detail {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.dark-mode .package-card,
body.dark-mode .category-card,
body.dark-mode .testimonial-card,
body.dark-mode .test-entry-direct,
body.dark-mode .page-toc,
body.dark-mode .faq-item,
body.dark-mode .faq-question,
body.dark-mode .faq-answer {
    background-color: #1e293b !important;
    /* Ensure card background is dark */
    border-color: #334155 !important;
}

body.dark-mode .section-title::after,
body.dark-mode .page-title::after {
    background-color: var(--secondary-color) !important;
}

/* Fix Hero Text specifically */
body.dark-mode .hero-content h1 {
    color: #ffffff !important;
}

body.dark-mode .hero-content p {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Hover states fix */
body.dark-mode .category-card:hover .card-title,
body.dark-mode a:hover {
    color: var(--secondary-color) !important;
}

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: right;
    direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.booking-submit-btn {
    margin-top: 10px;
    padding: 14px 30px;
    font-size: 1.1em;
    width: 100%;
    background-color: #25D366 !important;
    color: white !important;
    border-color: #25D366 !important;
    cursor: pointer;
    font-weight: 700;
}

.booking-submit-btn:hover {
    background-color: #1DAE50 !important;
    border-color: #1DAE50 !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
        max-width: 95%;
    }

    .modal-close {
        top: 10px;
        left: 15px;
    }

    .modal-content h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
}

/* ==================== EMERGENCY FIXES (HIGHEST SPECIFICITY) ==================== */
html body.dark-mode #about h2,
html body.dark-mode #about h3,
html body.dark-mode #about p,
html body.dark-mode .footer-links h5,
html body.dark-mode .footer-contact h5,
html body.dark-mode .footer-links ul li a,
html body.dark-mode .footer-contact p,
html body.dark-mode .footer-contact p a,
html body.dark-mode .social-link {
    color: #ffffff !important;
}

/* Toggle Button Colors */
html body.dark-mode .theme-toggle {
    border-color: #fbbf24 !important;
    /* Amber/Yellow border */
    color: #fbbf24 !important;
    /* Amber/Yellow icon */
}

/* ==================== EMERGENCY FIXES (NAVBAR & COUNTERS) ==================== */

/* Specific Navbar Links Fix - Ensure they stay white in Dark Mode */
html body.dark-mode .nav-links a,
html body.dark-mode .nav-links li a,
html body.dark-mode .dropdown-menu li a {
    color: #ffffff !important;
}

html body.dark-mode .nav-links a:hover,
html body.dark-mode .dropdown-menu li a:hover {
    color: var(--secondary-color) !important;
}


/* ==================== UNIVERSAL HEADING FIX (FINAL) ==================== */
/* Targets ALL sections (About, Vision, Values, Services, etc.) */
html body.dark-mode section h1,
html body.dark-mode section h2,
html body.dark-mode section h3,
html body.dark-mode section h4,
html body.dark-mode section h5,
html body.dark-mode section h6,
html body.dark-mode h1,
/* Include generic H1 (Page Titles) */
html body.dark-mode h2,
html body.dark-mode .page-title,
/* Explicitly target Page Titles */
html body.dark-mode .section-title,
html body.dark-mode .content-text h3,
html body.dark-mode .value-card h4,
html body.dark-mode .service-card h4,
html body.dark-mode .package-card h4 {
    color: #ffffff !important;
}

html body.dark-mode p,
html body.dark-mode span,
html body.dark-mode li {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Re-assert button text color if overwritten by p/span rule */
html body.dark-mode .btn,
html body.dark-mode button {
    color: inherit;
}

html body.dark-mode .btn-primary {
    color: var(--primary-color) !important;
    /* Keep primary buttons dark text on light bg if needed */
}

html body.dark-mode .btn-primary:hover {
    color: var(--secondary-color) !important;
}

html body.dark-mode .btn-secondary {
    color: #ffffff !important;
}

/* ==================== TEST DETAILS SPECIFIC FIX ==================== */
html body.dark-mode .test-entry-direct h4,
html body.dark-mode .test-entry-direct h5 {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
    /* Make separators visible but subtle */
}

/* Fix Category Description on Test Pages */
html body.dark-mode .category-description {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Fix Table of Contents Links */
html body.dark-mode .page-toc {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

html body.dark-mode .page-toc h4 {
    color: #ffffff !important;
}

html body.dark-mode .page-toc ul li a {
    color: #64b5f6 !important;
    /* Light Blue for links to stand out */
}

/* ==================== ALWAYS DARK HEADER FIX ==================== */
html body .main-header,
html body.dark-mode .main-header {
    background-color: rgba(8, 42, 85, 0.95) !important;
    /* Always Dark Blue */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Ensure Nav Links are WHITE in all modes on the header */
html body .nav-links a,
html body.dark-mode .nav-links a,
html body .nav-links li a,
html body.dark-mode .nav-links li a {
    color: #ffffff !important;
}

html body .nav-links a:hover,
html body.dark-mode .nav-links a:hover {
    color: var(--secondary-color) !important;
    /* Blue on hover */
}

/* Ensure mobile menu icon is white */
html body .menu-toggle,
html body.dark-mode .menu-toggle {
    color: #ffffff !important;
}

/* Ensure mobile menu background is dark */
@media (max-width: 768px) {

    html body.dark-mode .nav-links {
        background-color: rgba(8, 42, 85, 0.98) !important;
    }
}

/* Closing brace for media query */

/* ==================== SCROLL ANIMATION CLASSES ==================== */
.fade-up,
.fade-in,
.service-card,
.value-card,
.package-card,
.test-category-card,
.section-title,
.content-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grids/cards - pure CSS method */
.service-card:nth-child(2),
.value-card:nth-child(2),
.package-card:nth-child(2) {
    transition-delay: 0.2s;
}

.service-card:nth-child(3),
.value-card:nth-child(3),
.package-card:nth-child(3) {
    transition-delay: 0.4s;
}

.service-card:nth-child(4),
.value-card:nth-child(4),
.package-card:nth-child(4) {
    transition-delay: 0.6s;
}

/* ==================== TESTIMONIALS SLIDER ==================== */
.testimonial-slider-container {
    position: relative;
    overflow: hidden;
    padding: 20px 0 60px;
    /* Space for dots */
    max-width: 800px;
    /* Clean slider width */
    margin: 0 auto;
}

.testimonial-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.testimonial-slide {
    min-width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.testimonial-card {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Soft premium shadow */
    text-align: center;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

html body.dark-mode .testimonial-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

.testimonial-card .rating {
    color: #ffc107;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.testimonial-card .review-text {
    font-size: 1.25em;
    font-style: italic;
    color: #444;
    line-height: 1.8;
    margin-bottom: 25px;
}

html body.dark-mode .testimonial-card .review-text {
    color: rgba(255, 255, 255, 0.9) !important;
}

.testimonial-card .client-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Avatar Images */
.testimonial-card .client-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
}

html body.dark-mode .testimonial-card .client-info h5 {
    color: #fff !important;
}

/* Slider Controls */
.slider-controls button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    z-index: 10;
}

html body.dark-mode .slider-controls button {
    background: #1e293b;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.slider-controls button:hover {
    background: var(--secondary-color);
    color: #fff;
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

.slider-dots {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: var(--secondary-color);
    transform: scale(1.2);
}

/* Media Query */
@media (max-width: 768px) {
    .testimonial-card {
        padding: 30px 20px;
    }

    .slider-controls button {
        width: 40px;
        height: 40px;
    }

    .testimonial-card .review-text {
        font-size: 1.1em;
    }
}

/* Ensure content is visible if JS fails or for SEO/Accessibility preference */
/* ==================== MOBILE STICKY BAR ==================== */
.mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    /* Hidden by default */
    justify-content: space-around;
    padding: 10px 5px;
    z-index: 9999;
}

html body.dark-mode .mobile-sticky-bar {
    background: #1e293b;
    border-top: 1px solid #334155;
}

.sticky-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.85em;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.sticky-btn i {
    font-size: 1.4em;
    margin-bottom: 2px;
}

.call-btn {
    color: var(--secondary-color);
}

.whatsapp-btn {
    color: #25D366;
}

.book-btn {
    color: var(--primary-color);
}

html body.dark-mode .sticky-btn {
    color: #e2e8f0;
}

html body.dark-mode .call-btn {
    color: #64b5f6;
}

html body.dark-mode .whatsapp-btn {
    color: #25D366;
}

html body.dark-mode .book-btn {
    color: #fbbf24;
}

@media (max-width: 768px) {
    .mobile-sticky-bar {
        display: flex;
    }

    /* Add padding to body so sticky bar doesn't cover footer content */
    body {
        padding-bottom: 60px;
    }

    /* Move whatsapp floating button up */
    .whatsapp-floating-btn {
        bottom: 80px !important;
    }

    .facebook-floating-btn {
        bottom: 140px !important;
    }

    #backToTopBtn {
        bottom: 200px !important;
    }
}

/* ==================== DOWNLOAD APP SECTION ==================== */
.download-app-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d47a1 100%);
    color: #fff;
    padding: 60px 0;
    overflow: hidden;
    position: relative;
}

.download-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.download-text h2.section-title {
    color: #fff !important;
    text-align: right;
    margin-bottom: 20px;
}

.download-text p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.download-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.android-btn {
    background: #fff;
    color: var(--primary-color);
}

.ios-btn {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.ios-btn.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.download-btn i {
    font-size: 2rem;
}

.download-btn span {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2px;
}

.download-btn:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.download-image img {
    max-width: 300px;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    transform: rotate(-5deg);
    transition: transform 0.5s ease;
}

.download-image img:hover {
    transform: rotate(0deg) scale(1.05);
}

@media (max-width: 768px) {
    .download-content {
        flex-direction: column;
        text-align: center;
    }

    .download-text h2.section-title {
        text-align: center;
    }

    .download-buttons {
        justify-content: center;
    }

    .download-image img {
        max-width: 250px;
        margin-top: 30px;
    }
}

/* ==================== DARK MODE: BLOG & INNER PAGES ==================== */
/* (Consolidated from inline styles previously repeated in every page) */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .page-title,
body.dark-mode .section-title,
body.dark-mode .test-entry-direct h4,
body.dark-mode .test-entry-direct h5,
body.dark-mode .category-description {
    color: #ffffff !important;
}

/* Dark Mode: Category & Service Cards */
body.dark-mode .category-card .card-title,
body.dark-mode .category-card h3,
body.dark-mode a.category-card h3,
body.dark-mode .test-category-grid h3,
body.dark-mode .service-card h4,
body.dark-mode .value-card h4,
body.dark-mode .package-card-title {
    color: #ffffff !important;
}

body.dark-mode .category-card:hover .card-title {
    color: var(--secondary-color) !important;
}

/* Dark Mode: Social Icons */
body.dark-mode .social-link,
body.dark-mode .social-link a,
body.dark-mode .social-link i {
    color: #1877F2 !important;
    font-weight: bold !important;
}

body.dark-mode .social-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(24, 119, 242, 0.8);
}

/* Dark Mode: WhatsApp Links in Footer */
body.dark-mode .footer-contact a[href*="wa.me"],
body.dark-mode .footer-contact .fa-whatsapp {
    color: #25D366 !important;
    font-weight: bold !important;
}

body.dark-mode .footer-contact a[href*="wa.me"]:hover {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(37, 211, 102, 0.8);
}

/* =====================================================
   PWA Install Button
   ===================================================== */
.pwa-install-btn {
    position: fixed;
    bottom: 90px;
    left: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--primary-color), #0a4a9c);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(8, 42, 85, 0.4);
    transition: all 0.3s ease;
    animation: pwa-bounce 2s ease-in-out 1s 3;
    direction: rtl;
}

.pwa-install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(8, 42, 85, 0.5);
    background: linear-gradient(135deg, #0a4a9c, var(--primary-color));
}

.pwa-install-btn i {
    font-size: 1.1em;
    animation: download-anim 1.5s ease-in-out infinite;
}

@keyframes pwa-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes download-anim {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(3px); opacity: 0.7; }
}

/* =====================================================
   iOS Install Popup
   ===================================================== */
.ios-install-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ios-popup-content {
    background: var(--card-bg, #ffffff);
    border-radius: 20px 20px 0 0;
    padding: 30px 25px 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    text-align: center;
    direction: rtl;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.ios-popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.08);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--dark-color, #333);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-family: var(--font-family);
}

.ios-popup-close:hover {
    background: rgba(0,0,0,0.15);
}

.ios-popup-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), #0a4a9c);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(8, 42, 85, 0.3);
}

.ios-popup-icon i {
    font-size: 2em;
    color: #ffffff;
}

.ios-popup-content h3 {
    font-size: 1.4em;
    color: var(--heading-color, #082a55);
    margin-bottom: 12px;
}

.ios-popup-content p {
    font-size: 0.95em;
    color: var(--text-color, #666);
    margin-bottom: 15px;
}

.ios-popup-content ol {
    text-align: right;
    padding-right: 20px;
    margin-bottom: 20px;
}

.ios-popup-content ol li {
    margin-bottom: 10px;
    font-size: 0.95em;
    color: var(--text-color, #555);
    line-height: 1.6;
    list-style: decimal;
}

.ios-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #007aff;
    color: white;
    border-radius: 6px;
    font-size: 0.85em;
    vertical-align: middle;
    margin: 0 3px;
}

.ios-popup-arrow {
    font-size: 1.5em;
    color: var(--primary-color, #082a55);
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Dark mode للـ popup */
body.dark-mode .ios-popup-content {
    background: #1e293b;
}

body.dark-mode .ios-popup-content h3 {
    color: #f1f5f9;
}

body.dark-mode .ios-popup-content p,
body.dark-mode .ios-popup-content ol li {
    color: #cbd5e1;
}

/* =====================================================
   تحسينات CSS Variables للتباين العالي (High Contrast)
   ===================================================== */
:root {
    /* تحسين التباين للوضع النهاري */
    --text-primary: #0a1628;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: rgba(8, 42, 85, 0.12);
    --focus-ring: 0 0 0 3px rgba(26, 115, 232, 0.3);
}

/* تركيز الوصول - لمحركات القراءة والـ SEO */
*:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 3px;
    border-radius: 4px;
}

/* تحسين Dark Mode Variables للتباين */
body.dark-mode {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --focus-ring: 0 0 0 3px rgba(100, 181, 246, 0.4);
}

/* تحسين قراءة النص في الوضع الليلي */
body.dark-mode p {
    color: var(--text-secondary);
}

body.dark-mode .section-subtitle {
    color: var(--text-muted);
}