:root {
  --primary-color: #2A5C82;
  --secondary-color: #5BA4E6;
}

body {
  font-family: 'Tajawal', sans-serif;
  font-display: swap;
}

/* تحسينات الشريط العلوي */
.navbar {
 /* box-shadow: 0 2px 8px rgba(0,0,0,0.1);*/
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* تنسيقات عامة للشريط العلوي */
.navbar-brand {
  display: flex !important;
  align-items: center !important;
}

/* تنسيق اسم المستشفى */
.brand-info h4 {
  font-family: 'Tajawal', sans-serif;
  font-weight: 800 !important;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  padding-bottom: 3px;
}
/*
.brand-info h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: rgba(255,255,255,0.3);
}*/
/* تنسيق الرؤية */
.vision-text {
  font-family: 'Cairo', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  color: #e6f4ff !important;
  opacity: 0.95 !important;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
  .brand-info h4 {
    font-size: 1.3rem !important;
    line-height: 1.2 !important;
  }
  
  .vision-text {
    font-size: 0.8rem !important;
    display: block !important; /* إظهار النص دائمًا */
    margin-top: 2px !important;
  }
  
  .hospital-logo {
    height: 45px !important;
    margin-left: 10px !important;
  }
}


.hospital-logo {
  height: 50px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  margin-left: 15px;
}
.pdf-container {
  width: 100%;
  height: 85vh;
  overflow-y: auto;
  background: #fff;
  padding: 15px;
}

.pdf-container canvas {
  width: 100% !important;
  margin: 10px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* عارض PDF */
.pdf-iframe {
  width: 100%;
  height: 85vh;
  border: none;
  background: white;
  transition: opacity 0.3s;
}

#pdf-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
}

/* تحسينات القائمة الجانبية */
@media (max-width: 992px) {
  #resultsSidebar {
    width: 85%;
    height: calc(100vh - 60px) !important;
  }
}

.list-group-item {
  transition: all 0.2s;
}

.list-group-item.active {
  background: var(--primary-color) !important;
  color: white !important;
}

/* تحسينات عامة للأداء */
.card {
  border-radius: 12px;
  overflow: hidden;
}

/* تعديل ملف Style.css */
@media (max-width: 992px) {
  #resultsSidebar {
    position: fixed;
    top: 60px !important; /* تحديد المسافة من الأعلى */
    right: 0;
    z-index: 1050; /* زيادة الترتيب الزندي */
    width: 85%;
    height: calc(100vh - 60px) !important;
    background: white;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    /*transition: transform 0.3s ease;*/
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  #resultsSidebar.show {
    transform: translateX(0);
  }

  #resultsSidebar.collapse:not(.show) {
    display: none;
    transform: translateX(100%);
  }
  
  #resultsSidebar.collapse.show {
    transform: translateX(0);
    display: block;
  }
}

/* إضافة هذه الأنماط الجديدة للجزء المعدل */

/* تنسيق قائمة المرضى */
#patientsList .list-group-item {
  cursor: pointer;
  transition: all 0.2s;
  border-right: 3px solid transparent;
}

#patientsList .list-group-item:hover {
  background-color: #f8f9fa;
  border-right-color: var(--primary-color);
}

#patientsList .list-group-item.active {
  background-color: var(--primary-color);
  color: white;
  border-right-color: #fff;
}

#patientsList .patient-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#patientsList .patient-name {
  font-weight: 600;
}

#patientsList .patient-last-test {
  font-size: 0.8rem;
  color: #6c757d;
}

#patientsList .list-group-item.active .patient-last-test {
  color: rgba(255,255,255,0.8);
}

/* تحسينات للأداء */
.pdf-container {
  will-change: contents;
}

/* تحسينات للطباعة */
@media print {
  .navbar, .card-header, footer, #resultsSidebar {
      display: none !important;
  }
  
  .pdf-container {
      height: auto !important;
      overflow: visible !important;
  }
}

/* تحسينات التحميل */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* تحسينات للأجهزة الصغيرة */
@media (max-width: 768px) {
  #patientPhone {
      font-size: 0.9rem;
  }
  
  #patientsList .patient-name {
      font-size: 0.95rem;
  }
}

/* تنسيق العنصر النشط في القوائم */
.patient-item.active, 
.report-item.active {
    background-color: #2A5C82;
    color: white;
    border-right: 3px solid #fff;
}

.patient-item.active .patient-name,
.report-item.active {
    font-weight: bold;
}

.patient-item.active .patient-last-test {
    color: rgba(255,255,255,0.8);
}

/* تحسينات التحميل */
#patientsList, #resultsList {
    min-height: 100px;
    transition: all 0.3s ease;
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    .patient-item, .report-item {
        padding: 0.75rem 1rem;
    }
    
    .patient-name {
        font-size: 1rem;
    }
    
    .patient-last-test {
        font-size: 0.75rem;
    }
}