@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

:root {
    --primary-color: #EA4335; /* Google Red */
    --secondary-color: #2B3990; /* Dark Blue */
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white-color: #fff;
    --medium-gray: #6c757d;
    --light-gray: #adb5bd;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* --- Header & Navigation --- */
.header {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 15px 0; /* Reduced padding */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 0; /* Remove default padding */
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--white-color) !important;
}

.nav-link {
    color: var(--white-color) !important;
    margin: 0 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 0.8rem !important; /* Consistent padding */
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: rgba(255,255,255,0.8) !important;
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.5);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Hero Section (#home) --- */
#home {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a237e 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    color: var(--white-color);
}

#home .animated-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCIgdmlld0JveD0iMCAwIDYwIDYwIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNmZmZmZmYiIGZpbGwtb3BhY2l0eT0iMC4xIj48cGF0aCBkPSJNMzYgMTRjMC0yLjIgMS44LTQgNC00czQgMS44IDQgNC0xLjggNC00IDQtNC0xLjgtNC00bTAtMTJjMC0yLjIgMS44LTQgNC00czQgMS44IDQgNC0xLjggNC00IDQtNC0xLjgtNC00bS0xMiAwYzAtMi4yIDEuOC00IDQtNHM0IDEuOCA0IDQtMS44IDQtNCA0LTQtMS44LTQtNG0tMTIgMGMwLTIuMiAxLjgtNCA0LTRzNCAxLjggNCA0LTEuOCA0LTQgNC00LTEuOC00LTRtLTEyIDBjMC0yLjIgMS44LTQgNC00czQgMS44IDQgNC0xLjggNC00IDQtNC0xLjgtNC00bTAgMTJjMC0yLjIgMS44LTQgNC00czQgMS44IDQgNC0xLjggNC00IDQtNC0xLjgtNC00bTEyIDBjMC0yLjIgMS44LTQgNC00czQgMS44IDQgNC0xLjggNC00IDQtNC0xLjgtNC00bTEyIDBjMC0yLjIgMS44LTQgNC00czQgMS44IDQgNC0xLjggNC00IDQtNC0xLjgtNC00Ij48L3BhdGg+PC9nPjwvZz48L3N2Zz4=');
    opacity: 0.3;
}

#home .animated-icon {
    position: absolute;
    font-size: 30px;
    color: rgba(255,255,255,0.2);
    animation: pulse 2s infinite;
}
#home .animated-icon.icon1 { top: 10%; left: 5%; }
#home .animated-icon.icon2 { top: 70%; left: 80%; font-size: 40px; color: rgba(255,255,255,0.15); animation-duration: 3s;}
#home .animated-icon.icon3 { top: 40%; left: 90%; font-size: 25px; color: rgba(255,255,255,0.1); animation-duration: 2.5s;}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#home h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}
#home h1 .title-underline {
    position: absolute;
    bottom: -5px;
    right: 0;
    left: 0;
    height: 4px;
    background-color: var(--primary-color);
}
#home h2 {
    font-size: 1.7rem;
    margin-bottom: 20px;
}
#home .tagline {
    color: rgba(255,255,255,0.95);
    font-size: 1.5rem;
    margin-bottom: 25px;
    line-height: 1.8;
    font-weight: 600;
}
#home .contact-details {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
}
#home .contact-details div {
    display: inline-block;
    margin-left: 25px;
}
#home .contact-details div i {
    margin-left: 8px;
}
#home .hero-buttons a {
    margin-left: 10px;
    padding: 12px 30px;
    border-radius: 30px;
    transition: all 0.3s ease;
}
#home .hero-buttons .btn-primary {
     box-shadow: 0 4px 15px rgba(234, 67, 53, 0.3);
}
#home .hero-buttons .btn-outline-light {
    padding: 12px 25px;
}
#home .hero-buttons i {
    margin-left: 8px;
}

#home .hero-image-box {
    position: relative;
    text-align: center;
    background-color: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 30px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
#home .hero-image-box .main-icon {
    font-size: 100px;
    color: var(--white-color);
    margin-bottom: 15px;
}
#home .hero-image-box .small-icons {
    font-size: 20px;
    color: var(--white-color);
    margin-bottom: 15px;
}
#home .hero-image-box .small-icons i {
    margin-left: 10px;
}
#home .hero-image-box .badge-overlay {
    position: absolute;
    bottom: -20px;
    right: 50%;
    transform: translateX(50%);
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}
#home .hero-image-box .badge-overlay i {
    margin-left: 10px;
}


/* --- General Section Styling --- */
.section {
    padding: 70px 0; /* Slightly reduced padding */
}
.section.bg-white {
    background-color: var(--white-color);
}
.section.bg-light {
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    color: var(--secondary-color);
    position: relative;
    font-weight: 700;
    font-size: 2.2rem;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0;
}
.section-title.text-white {
    color: var(--white-color);
}
.section-title.text-white:after {
    background-color: var(--white-color);
}


/* --- Cards --- */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* Softer shadow */
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.card-icon {
    font-size: 2.8rem; /* Slightly smaller */
    color: var(--primary-color);
    margin-bottom: 15px;
}
.card .card-body h4, .card .card-body h5 {
    color: var(--secondary-color);
    font-weight: 600;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--white-color) !important;
}

.btn-primary:hover {
    background-color: #d03126;
    border-color: #d03126;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}
.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-outline-light {
    color: var(--white-color);
    border-color: var(--white-color);
}
.btn-outline-light:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
}


/* --- Lists --- */
.list-styled-custom {
    padding-right: 0;
}
.list-styled-custom li {
    padding-right: 0;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: flex-start;
}
.list-styled-custom i {
    margin-left: 12px; /* Space between icon and text in RTL */
    margin-top: 5px; /* Align icon better with text */
    flex-shrink: 0; /* Prevent icon from shrinking */
}
.list-styled-custom li .text-success,
.list-styled-custom li .text-primary,
.list-styled-custom li .text-warning,
.list-styled-custom li .text-danger {
    font-size: 1.2em; /* Make icons slightly larger */
}


/* --- About Section --- */
#about .lead {
    line-height: 1.8;
    font-size: 1.1rem;
}
#about .doctor-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
#about .card h4, #about .card h5 {
    color: var(--secondary-color);
}
#about .card .font-italic {
    color: var(--medium-gray);
}

/* --- Services Section --- */
#services .card-body {
    padding: 25px;
}

/* --- When to Visit Section --- */
#when-to-visit .card {
    background-color: var(--light-bg);
}
#when-to-visit strong {
    color: var(--secondary-color);
}
#when-to-visit .font-weight-bold {
    font-size: 1.1rem;
}

/* --- Contact Section --- */
.contact-info, .appointment-form-container { /* New class for appointment page */
    background-color: var(--white-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    height: 100%;
}
.contact-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.contact-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-left: 15px;
    width: 30px; /* Fixed width for alignment */
    text-align: center;
}
.form-control {
    border-radius: 5px;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(234, 67, 53, 0.25);
}
.appointment-form-container h3, .contact-info h3 {
    color: var(--secondary-color);
    font-weight: 600;
}
.google-map iframe {
    border-radius: 10px;
    margin-top: 20px;
}


/* --- Articles Section --- */
#articles .lead {
    font-size: 1.1rem;
}
#articles .card h5 {
    font-weight: 600;
}
#articles .card p.text-muted {
    font-size: 0.9rem;
}
#articles .card-body {
    padding: 20px;
}
#articles .bg-light { /* Specific for the "Tazkir Ham" card */
    background-color: #e9ecef !important; /* Bootstrap light */
}

/* --- Testimonials Section --- */
#testimonials .card .font-italic {
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 1rem !important;
}
#testimonials .card .d-flex i {
    color: var(--medium-gray);
}
#testimonials .card h6 {
    font-weight: 600;
    color: var(--secondary-color);
}
#testimonials .text-warning i {
    font-size: 1.1rem;
}

/* --- FAQ Section --- */
#faq .card-header {
    background-color: var(--white-color);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,.05);
}
#faq .btn-link {
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
    display: block;
    text-align: right;
    width: 100%;
}
#faq .btn-link:hover {
    color: var(--primary-color);
}
#faq .btn-link.collapsed:after {
    content: '\f078'; /* FontAwesome Angle Down */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    float: left;
    transition: transform 0.2s ease-in-out;
}
#faq .btn-link:not(.collapsed):after {
    content: '\f077'; /* FontAwesome Angle Up */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    float: left;
    transform: rotate(-180deg);
    transition: transform 0.2s ease-in-out;
}
#faq .card-body {
    font-size: 0.95rem;
    line-height: 1.7;
}
#faq .card-body ul {
    margin-top: 10px;
}


/* --- Medical Reminder Section --- */
#medical-reminder {
    background-color: var(--primary-color);
    color: var(--white-color);
}
#medical-reminder .lead {
    font-size: 1.6rem; /* Adjusted size */
    font-weight: 600;
}
#medical-reminder .btn-light {
    color: var(--primary-color) !important;
    font-weight: bold;
}
@keyframes animated-pulse-reminder {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.animated-pulse-reminder { animation: animated-pulse-reminder 1.5s infinite; }

/* --- Emergency Section --- */
#emergency {
    background-color: #dc3545; /* Bootstrap danger */
    color: var(--white-color);
}
#emergency .card {
    background-color: rgba(255,255,255,0.1); /* Semi-transparent card */
    border: 1px solid rgba(255,255,255,0.3);
}
#emergency .card-body h4, #emergency .card-body h5 {
    color: var(--white-color);
}
#emergency .card-body .lead {
    font-size: 1.1rem;
}
#emergency .d-flex i {
    margin-left: 15px;
}
#emergency .alert-light {
    background-color: rgba(255,255,255,0.9);
    color: var(--text-color);
}
#emergency .alert-light h5 {
    color: #c82333; /* Darker red for heading inside alert */
}
#emergency .alert-light ul {
    padding-right: 0;
}


/* --- Footer --- */
footer {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 40px 0 20px; /* More top padding, less bottom */
    text-align: right; /* Ensure text aligns right globally in footer */
}
footer h5 {
    font-weight: 600;
    margin-bottom: 20px;
}
footer p, footer ul li {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}
footer ul {
    list-style: none;
    padding-right: 0;
}
footer ul li {
    margin-bottom: 0.5rem;
}
footer ul li a {
    color: rgba(255,255,255,0.7);
    transition: color 0.3s ease;
}
footer ul li a:hover {
    color: var(--white-color);
    text-decoration: none;
}
footer .contact-footer li i {
    margin-left: 10px;
    width: 20px; /* For alignment */
}
footer hr {
    background-color: rgba(255,255,255,0.2);
    margin-top: 30px;
    margin-bottom: 20px;
}
footer .copyright {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}
footer .social-icons a {
    color: rgba(255,255,255,0.7);
    font-size: 1.3rem;
    margin: 0 8px;
    transition: color 0.3s ease;
}
footer .social-icons a:hover {
    color: var(--white-color);
}

/* --- Responsive Adjustments --- */
@media (max-width: 991.98px) {
    .navbar-nav {
        margin-top: 15px;
        text-align: center;
    }
    .nav-link {
        margin: 5px 0;
        display: block; /* Make links take full width */
    }
    .header .btn-primary {
        display: block;
        width: fit-content;
        margin: 15px auto 0;
    }
    #home h1 { font-size: 2.4rem; }
    #home h2 { font-size: 1.5rem; }
    #home .tagline { font-size: 1.3rem; }
    .section { padding: 50px 0; }
    .section-title { font-size: 1.8rem; }
}

@media (max-width: 767.98px) {
    #home { padding: 60px 20px; }
    #home h1 { font-size: 2rem; }
    #home h2 { font-size: 1.3rem; }
    #home .tagline { font-size: 1.2rem; }
    #home .contact-details div { display: block; margin-left: 0; margin-bottom: 10px; }
    #home .hero-buttons a { display: block; margin-bottom: 10px; margin-left: 0;}
    #home .hero-image-box { margin-top: 30px; }

    .contact-info, .appointment-form-container {
        margin-bottom: 30px;
    }
    #contact .col-md-6:last-child .appointment-form-container {
        margin-bottom: 0;
    }

    footer .col-md-4 {
        text-align: center;
        margin-bottom: 30px;
    }
    footer ul {
        padding-right: 0;
    }
    footer .contact-footer li { text-align: center; }
    footer .contact-footer li i { margin-left: 5px; }
}

@media (max-width: 575.98px) {
    .section-title { font-size: 1.6rem; }
    #faq .btn-link { font-size: 0.9rem; }
    #medical-reminder .lead { font-size: 1.3rem;}
}

/* Accessibility: Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(234, 67, 53, 0.3);
}
.btn:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(43, 57, 144, 0.3);
}

/* Appointment Page Specific */
.appointment-page-title {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 30px;
}
.form-info-text {
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-bottom: 20px;
    text-align: center;
}
#successMessage, #errorMessage {
    display: none; /* Hidden by default */
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
}
#successMessage {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
#errorMessage {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


        /* تنسيق خاص لرقم الهاتف */
        .phone-number {
            direction: ltr; /* تحديد اتجاه النص من اليسار لليمين فقط لرقم الهاتف */
            unicode-bidi: bidi-override; /* التأكد من أن النص يعرض بالطريقة الصحيحة */
        }
        