/* style.css - New professional and modern design for the patient interface. */
/* Radical solution for full responsiveness and element sizing, ultimate mobile adjustments, and refined product card. */

html, body {
    box-sizing: border-box; /* CRITICAL FIX: Ensure padding and border are included in the element's total width and height */
    overflow-x: hidden; /* Ensure no horizontal scroll on the body and html */
    width: 100%; /* Ensure html and body take full available width */
}

*, *::before, *::after {
    box-sizing: border-box; /* Apply border-box globally */
}

:root {
    --primary-color: #0d6efd; /* أزرق بوتستراب الأساسي */
    --secondary-color: #6c757d; /* رمادي بوتستراب الثانوي */
    --light-bg: #f8f9fa; /* خلفية فاتحة */
    --white-bg: #ffffff; /* خلفية بيضاء */
    --text-color: #343a40; /* لون النص الأساسي */
    --success-color: #198754; /* لون النجاح (أخضر) */
    --warning-color: #ffc107; /* لون التحذير (أصفر) */
    --danger-color: #dc3545; /* لون الخطر (أحمر) */
    --border-color: #dee2e6; /* لون الحدود */
    --border-light-color: #e9ecef; /* لون حدود أفتح */
    --primary-color-light: #eef5ff; /* درجة فاتحة من اللون الأساسي */
    --success-color-light: #e8f5e9; /* درجة فاتحة من لون النجاح */
    --card-shadow: 0 4px 18px rgba(0, 0, 0, 0.07); /* ظل للبطاقات */
    --hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.12); /* ظل عند التحويم */
}

body {
    font-family: 'Cairo', sans-serif; /* استخدام خط القاهرة */
    background-color: var(--light-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* تأكد من أن الجسم يملأ ارتفاع الشاشة بالكامل */
}
main { flex: 1; } /* لجعل المحتوى الرئيسي ينمو ويملأ المساحة المتاحة */

/* Header Styling */
.header {
    background-color: var(--white-bg);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    box-shadow: var(--card-shadow); /* إضافة ظل للرأس */
}
.header .logo {
    max-height: 70px;
    width: auto;
    margin-bottom: 0.75rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.header h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}
.header .lead {
    color: var(--secondary-color);
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

/* Search Section Styling */
.search-section {
    padding: 3rem 0;
}

/* Card Styling for Branch Selection and Search Box */
.card {
    border: none; /* إزالة حدود البطاقة الافتراضية */
    border-radius: 0.75rem; /* زوايا دائرية للبطاقات */
    box-shadow: var(--card-shadow); /* تطبيق ظل البطاقة */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card:hover {
    transform: translateY(-3px); /* رفع البطاقة قليلاً عند التحويم */
    box-shadow: var(--hover-shadow); /* ظل أكبر عند التحويم */
}
.card-body {
    padding: 1.5rem; /* مساحة داخلية للبطاقة */
}

/* Form Elements Styling */
.form-label {
    font-weight: 700;
}

.form-select-lg,
.form-control-lg {
    border-radius: 50px; /* جعل حقول الإدخال دائرية */
    padding: 1.1rem 2.2rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    box-shadow: none;
    transition: all 0.3s ease-in-out;
}

.form-select-lg:focus,
.form-control-lg:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.25);
}

.search-box .input-group-text {
    border-radius: 50px;
    background-color: transparent;
    border: none;
    position: absolute;
    left: 20px; /* تم تغيير الموضع إلى اليسار */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #aaa;
    font-size: 1.3rem;
}

/* Ensure input group text doesn't break rounded corners */
.search-box .input-group > .form-control:not(:first-child):not(:last-child) {
    border-radius: 50px;
}
.search-box .form-control {
    padding-left: 3.8rem; /* تم تغيير المساحة الداخلية لليسار */
    padding-right: 2.2rem; /* ضبط المساحة الداخلية لليمين */
    text-align: right; /* محاذاة النص لليمين */
}


/* --- NEW: Professional Product Card Styling (Version 3) --- */
.results-container {
    background-color: transparent;
    border-radius: 0.75rem;
    min-height: 160px;
}

.product-card {
    display: flex;
    gap: 0; /* No gap, sections will manage their own padding */
    align-items: stretch; /* Make children stretch to full height */
    padding: 0;
    background-color: var(--white-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem; /* Slightly more rounded */
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease-in-out;
    text-align: right;
    overflow: hidden; /* Important for border-radius on children */
}

.product-card:hover {
    transform: translateY(-6px) scale(1.01); /* More pronounced hover effect */
    box-shadow: var(--hover-shadow);
}

/* Card Image Area */
.product-card-image {
    width: 120px; /* Larger image area */
    padding: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color-light); /* Give it a background color */
    border-left: 1px solid var(--border-light-color); /* Separator */
}
.product-card-image img {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--white-bg);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
.product-card-image .image-placeholder {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background-color: #dbe9f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 2.8rem;
}

/* Card Info Area */
.product-card-info {
    flex-grow: 1;
    min-width: 0;
    padding: 1.25rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.product-header .product-name {
    font-weight: 700;
    font-size: 1.3rem; /* Larger name */
    color: var(--text-color);
    line-height: 1.4;
    margin: 0;
}

.product-header .badge {
    margin-top: 5px; /* Align with the top of the text */
    font-size: 0.8rem;
    padding: 0.4em 0.9em;
    font-weight: 700;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.product-header .badge.bg-success {
    background-color: var(--success-color) !important;
    color: #fff !important;
}
.product-header .badge.bg-warning {
    background-color: var(--warning-color) !important;
    color: #343a40 !important;
}


.product-scientific {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-style: italic;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light-color);
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
.product-price .price-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem; /* Larger price font */
}
.product-price .price-item .price-label {
    font-weight: 500; /* Medium weight */
    color: var(--secondary-color);
    width: 85px; /* Fixed width for alignment */
}
.product-price .price-item .price-value {
    font-weight: 700;
    color: var(--success-color);
    background-color: var(--success-color-light);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    letter-spacing: 0.5px; /* Add some spacing for numbers */
}


/* Placeholder Messages */
.results-placeholder {
    background-color: var(--white-bg);
    border-radius: 0.75rem;
    padding: 3rem;
    box-shadow: var(--card-shadow);
    display: flex; /* استخدام فليكس بوكس لتوسيط المحتوى */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px; /* ارتفاع أدنى لضمان رؤية جيدة */
}
.results-placeholder .h5 {
    font-size: 1.25rem;
    margin-top: 1rem; /* مسافة بين الأيقونة والعنوان */
}
.results-placeholder .fa-3x {
    font-size: 3.2em !important;
    color: var(--primary-color); /* لون الأيقونات في الرسائل */
}
.results-placeholder .text-muted {
    font-size: 1rem;
}

/* Loading Indicator */
#loading-indicator {
    background-color: var(--white-bg);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}
#loading-indicator .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- NEW: Professional Footer Styling (v3) --- */
.site-footer {
    background-color: var(--white-bg);
    padding: 40px 0 0;
    margin-top: 50px;
    border-top: 4px solid var(--primary-color);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    color: var(--secondary-color);
}

.site-footer h6 {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.site-footer h6 i {
    color: var(--primary-color);
    font-size: 1.2em;
}

.site-footer .footer-contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-footer .footer-contact-info li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}
.site-footer .footer-contact-info li i {
    margin-left: 12px;
    margin-top: 5px;
    color: var(--primary-color);
    width: 15px;
    text-align: center;
}

.site-footer .working-hours, .site-footer .developer-info {
    line-height: 1.8;
}

.site-footer .developer-info a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}
.site-footer .developer-info a:hover {
    color: var(--text-color);
}

.footer-bottom-bar {
    background-color: var(--primary-color-light);
    padding: 1rem;
    margin-top: 30px;
    font-size: 0.9rem;
    text-align: center;
}

.footer-bottom-bar .copyright-text {
    margin: 0;
    color: var(--secondary-color);
}
.footer-bottom-bar .copyright-text strong {
    color: var(--text-color);
}


/* --- Responsive adjustments --- */
@media (max-width: 991px) {
    .site-footer .col-lg-5, .site-footer .col-md-6, .site-footer .col-lg-3 {
        text-align: center;
        margin-bottom: 30px;
    }
    .site-footer .footer-contact-info li {
        justify-content: center;
    }
    .site-footer h6 {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    /* Card adjustments for mobile */
    .product-card {
        flex-direction: column;
        align-items: stretch; /* Stretch children to full width */
    }
    .product-card-image {
        width: 100%;
        height: 130px; /* Fixed height for image area on mobile */
        padding: 1rem;
        border-left: none;
        border-bottom: 1px solid var(--border-light-color);
    }
    .product-card-image img, .product-card-image .image-placeholder {
        margin: 0 auto; /* Center image/placeholder */
    }
    .product-card-info {
        padding: 1rem; /* Consistent padding on mobile */
    }
    .product-header {
        flex-direction: column;
        align-items: flex-start; /* Align to the start (right in RTL) */
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    .product-header .badge {
        margin-top: 0;
    }
    .product-scientific {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    .product-price {
        margin-top: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .header h1 { font-size: 1.5rem; }
    .header .logo { max-height: 55px; }
    .form-select-lg, .form-control-lg { padding: 0.8rem 1.5rem; font-size: 0.95rem; }
    .search-box .input-group-text { left: 15px; right: auto; font-size: 1rem; }
    .search-box .form-control { padding-left: 2.8rem; padding-right: 1.5rem; }
    .results-placeholder { padding: 2rem; }
    .results-placeholder .h5 { font-size: 1.1rem; }
    .results-placeholder .fa-3x { font-size: 2.8em !important; }

    .product-header .product-name { font-size: 1.15rem; }
    .product-scientific { font-size: 0.9rem; }
    .product-price .price-item { font-size: 0.95rem; }
}
