@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");


body {
    font-family: "Rubik", sans-serif;
    direction: rtl;
    text-align: right;
    background-image: radial-gradient(
        circle at 50% 0%,
        rgb(54, 55, 74) 16.4%,
        rgb(47, 48, 67) 68.2%,
        rgb(23, 31, 36) 99.1%
    );
    margin: 0;
    background-color: #a8a8a8;
    color: #000000;
    transition: background-color 0.3s, color 0.3s;
    display: grid;
    flex-direction: column;
    min-height: 100vh;
    justify-items: center;
}

/* تصميم الحاوية الرئيسية */
.container {
    width: 95%; 
    margin: 2vh auto;
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    padding: 2vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    border-radius: 30px;
    text-align: center;
    overflow-x: hidden;
}

body.dark-mode .container {
    background-color: #2a2a2a;
    color: #ffffff;

}

body.dark-mode {
    background-color: #000000;
    color: #fff;
}

.schedule-table-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; /* تأكد أن الحاوية تملأ العرض الكامل */
    margin: 0 auto; /* ضمان التوسيط الأفقي */
}


.schedule-table {
    width: fit-content;
    font-size: 8.5px;  /* إضافة 0.5rem للحجم الأساسي */
    max-width: 100%; /* منع الجدول من تجاوز الحاوية */
    margin: 0; /* إزالة الهوامش */
    font-weight: bold;
    text-align: center;
    display: inline-block; /* تصحيح مشكلة العرض */
    border-collapse: separate; /* نستخدم separate لتفادي التداخل بين الحدود */
    border-spacing: 4px 4px; /* صفر بين الأعمدة و 10px بين الصفوف */
    border-radius: 8px; /* التأكد من إزالة أي حدود حول الجدول */
    background-color: #ffffff;
    transition: font-size 0.3s ease; /* انتقال سلس لحجم النص */
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

.time-checkbox-group {
    display: flex;
    flex-direction: column; /* ترتيب العناصر عموديًا */
}

.day-time-container label {
    margin-top: 20px;
    display: block; /* يجعل النص في سطر منفصل */
    margin-bottom: 15px; /* إضافة مسافة تحت النص */
    font-size: 1rem; /* تحسين وضوح النص */
    font-weight: bold; /* جعل النص واضحًا */
}


.time-group-row {
    display: flex;
    flex-wrap: wrap; /* التفاف العناصر داخل الصف */
    gap: 10px; /* مسافة بين العناصر داخل المجموعة */
}

.schedule-table thead {
    background-color: #555;
}

.schedule-table th, .schedule-table td {
    text-align: center;
    padding: 0.3vh;
    justify-content: center;
    align-items: center;
    text-align: center;
    direction: ltr; 
    
    border: none;
    border-radius: 10px;
    background-color: #111;
    white-space: nowrap; /* النص في سطر واحد */
    overflow: hidden; 
    text-overflow: ellipsis; /* عرض "..." عند وجود نص طويل */
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

.schedule-table th {
    background-color: #007BFF;
    color: #ffffff;
    
}

.schedule-table td {
    background-color: #eaeaea;
    color: #ffffff;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}
/* تغيير لون النص في العمود الأول */
.schedule-table td:first-child {
    color: #ffffff !important;
    
    line-height: 1.4; /* القيمة 1.2 تقلل المسافة بين السطور */
    background-color: #007BFF;
}

.schedule-table td:not(:first-child) {
    color: #000000 !important;
}
body.dark-mode .schedule-table td:first-child {
    color: #ffffff;
    line-height: 1.4; /* القيمة 1.2 تقلل المسافة بين السطور */
    background-color: #007BFF;
}
body.dark-mode .schedule-table {
    background-color: #2a2a2a;
}

body.dark-mode .schedule-table th, body.dark-mode .schedule-table td {
    transition: border 0.3s;
}

body.dark-mode .schedule-table th {
    background-color: #007BFF;
    color: #ffffff;
}

body.dark-mode .schedule-table td {
    background-color: #111;
    color: #000000;
}



button.dark-mode-toggler {
    background-color: #ff0000;
    color: #ffffff;
}

button.dark-mode-toggle:hover {
    background-color: #555;
}

/* ألوان الكورسات */
.course-color-1 {
    background-color: #FFB3A7;
    border-radius: 6px;
    padding: 5px;
}

body.dark-mode .course-color-1 {
    background-color: #b35e53;
}

.course-color-2 {
    background-color: #A7FFB3;
    border-radius: 6px;
    padding: 5px;
}

body.dark-mode .course-color-2 {
    background-color: #53b35e;
}


button {
    color: white;
    padding: 10px 20px;
    font-weight: bold;

    margin: 5px;
    border: none;
    cursor: pointer;
    border-radius: 7px;
    background-color: #03b1d0;
    font-size: 18px;

    font-family: "Rubik", sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, box-shadow 0.3s;
}

button:hover {
    background-color: #007BFF;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.icon-button {
  background-color: #ffd700;
  color: #000;
  width: auto;
  max-width: 100%;
  font-family: "Rubik", sans-serif;
  font-weight: 400; /* إزالة العريض */
  font-size: 1.2rem; /* تصغير الخط قليلاً */
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.7), 0 0 12px rgba(255, 215, 0, 0.5);
  border-radius: 8px;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  margin-top: auto; /* ضمان أن الزر يبقى في أسفل الحاوية */
  text-align: center;
  white-space: nowrap;
  color: #000000;
  padding: 0.7rem;
  margin: 0.75rem auto; /* تغيير المحاذاة الأفقية ليكون في المنتصف */
  border: none;
  border-radius: 10px;
  width: 250px;
  overflow: hidden; /* منع النص من الخروج عن حدود الزر */
  display: block;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.icon-button:hover {
  background-color: #f0c020;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.6);
  transform: scale(1.05);
}



label {
    font-weight: bold;
    margin-right: 5px;
}

input[type="text"] {
    font-family:Rubik;
    font-size: 16px;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 10px;
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* عند التحديد */
input[type="checkbox"]:checked {
    background-color: #007BFF;
    border-color: #007BFF;
}

input[type="checkbox"]:checked::before {
    content: "✓";
    color: white;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* تحسين التصميم للوضع الليلي */
body.dark-mode input[type="checkbox"] {
    border-color: #666; /* لون الإطار في الوضع الليلي */
    background-color: #333; /* لون الخلفية في الوضع الليلي */
}

body.dark-mode input[type="checkbox"]:checked {
    background-color: #007BFF; /* لون عند التحديد في الوضع الليلي */
    border-color: #007BFF;
}

body.dark-mode input[type="text"] {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #555;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}





.time-group-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}
.time-group-row label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-container {
    position: relative;
    display: inline-block;
}

#uploadXML_SM {
    display: none; /* إخفاء عنصر الإدخال */
}

.upload-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #4CAF50;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-button:hover {
    background-color: #45a049;
}



@media (orientation: landscape) {
    /* تقليل حجم الخط في الجدول */
    .schedule-table th, .schedule-table td {
    padding-top: 5px;
    padding-bottom: 5px;
    font-weight: bold;  
        font-size: calc(var(--dynamic-font-size) + 0.5rem);  /* إضافة 0.5rem للحجم الأساسي */
        transition: font-size 0.3s ease; /* انتقال سلس لحجم النص */

}
}


/* تصميم العنصر label */
#removeCourseSelect_SM + label {
    font-family: 'Arial', sans-serif; /* تحديد نوع الخط */
    color: #ecf0f1; /* لون النص */
    font-size: 16px; /* حجم الخط */
    margin-bottom: 10px; /* المسافة أسفل التسمية */
}

/* تصميم عنصر القائمة المنسدلة */
select#removeCourseSelect_SM {
    font-family: 'Arial', sans-serif; /* تحديد نوع الخط */
    color: #ecf0f1; /* لون النص داخل القائمة */
    margin: 10px;
    background-color: #2c3e50; /* لون خلفية القائمة */
    padding: 8px 16px; /* الحشو حول النص */
    border: px solid #34495e; /* إطار القائمة */
    border-radius: 10px; /* تدوير حواف القائمة */
    box-shadow: 0 2px 3px rgba(0,0,0,0.3); /* ظل أغمق لإضفاء العمق */
    cursor: pointer; /* تغيير شكل المؤشر للإشارة إلى قابلية التفاعل */
}

/* تصميم الخيارات داخل القائمة */
select#removeCourseSelect_SM option {
    padding: 8px; /* الحشو حول النص */
    background-color: #34495e; /* لون خلفية الخيارات */
    color: #ecf0f1; /* لون النص */
}



@media (min-aspect-ratio: 1/1) {
   .schedule-table {
    font-size: 15px;
   }
    #schedulePage .container {
        width: fit-content;
        margin: 2vh auto;
        box-shadow: 0 6px 18px rgb(0 0 0 / 30%);
        padding: 2vh;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 30px;
        text-align: center;
        overflow-x: hidden;
    }


}

select#timeToDelete {
    font-family: 'Arial', sans-serif; /* تحديد نوع الخط */
    color: #ecf0f1; /* لون النص داخل القائمة */
    background-color: #2c3e50; /* لون خلفية القائمة */
    padding: 8px 16px; /* الحشو حول النص */
    border: px solid #34495e; /* إطار القائمة */
    border-radius: 10px; /* تدوير حواف القائمة */
    margin: 10px;
    box-shadow: 0 2px 3px rgba(0,0,0,0.3); /* ظل أغمق لإضفاء العمق */
    cursor: pointer; /* تغيير شكل المؤشر للإشارة إلى قابلية التفاعل */
}

select#dayToDelete {
    font-family: 'Arial', sans-serif; /* تحديد نوع الخط */
    color: #ecf0f1; /* لون النص داخل القائمة */
    background-color: #2c3e50; /* لون خلفية القائمة */
    padding: 8px 34px; /* الحشو حول النص */
    margin: 10px;
    border: px solid #34495e; /* إطار القائمة */
    border-radius: 10px; /* تدوير حواف القائمة */
    box-shadow: 0 2px 3px rgba(0,0,0,0.3); /* ظل أغمق لإضفاء العمق */
    cursor: pointer; /* تغيير شكل المؤشر للإشارة إلى قابلية التفاعل */
}

/* Popup container styles with animations */
.popup-container {
    transition: all 0.3s ease-in-out;
    opacity: 0;
    will-change: opacity, transform;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-container.show {
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 1;
}



.popup-container.show .popup-content {
    transform: translateY(0);
    opacity: 1;
}

/* Dark mode support for popup */
.dark-mode .popup-content {
  background-color: #e9e9e9;
  color: #000000;
}

.close-btn {
  position: absolute;
  right: 10px;
  top: 5px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

.close-btn:hover {
  color: #000;
}

.popup-content {
  position: relative;
  background-color: #eeeeee;
  padding: 4px;
  border-radius: 10px;
  width: 28%;
  /* max-width: 400px; */
  position: relative;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.popup-container.show .popup-content {
  transform: scale(1);
  opacity: 1;
}

/* Dark mode support for popup */
.dark-mode .popup-content {
  background-color: #333;
  color: #fff;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: #ff5555;
}

.popup-content button {
    padding: 11px;
    font-size: 14px;
    display: block;
    margin: 11px auto;
    width: 82%;
    border-radius: 7px;
    border: none;
    background-color: #03b1d0;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
  }
  

.popup-content button:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

.popup-content button:active {
  transform: translateY(1px);
}

.popup-content h3 {
  margin-bottom: 16px;
}

/* PDF Drop Zone Styles */
.pdf-drop-zone {
    width: fit-content;
    max-width: 600px;
    margin: 10px auto;
    padding: 10px;
    border: 2px dashed #03b1d0;
    border-radius: 10px;
    text-align: center;
    background-color: rgba(3, 177, 208, 0.05);
    transition: all 0.3s ease;
}

.pdf-drop-zone.dragover {
    background-color: rgba(3, 177, 208, 0.1);
    border-color: #007BFF;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* gap: 10px; */
}

.pdf-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.upload-pdf-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #03b1d0;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-pdf-button:hover {
    background-color: #007BFF;
}

.drop-zone-hint {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

body.dark-mode .pdf-drop-zone {
    background-color: rgba(3, 177, 208, 0.1);
    border-color: #007BFF;
}

body.dark-mode .drop-zone-hint {
    color: #aaa;
}

/* Loading indicator */
.pdf-loading {
    display: none;
    margin: 10px 0;
    text-align: center;
    width: 100%;
}

.pdf-loading.active {
    display: block;
}

.pdf-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #03b1d0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

body.dark-mode .pdf-loading-spinner {
    border-color: #2c3e50;
    border-top-color: #03b1d0;
}

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

/* Mobile Responsive Design */
@media screen and (max-width: 767px) {
    .popup-content {
        width: 80%;
    }
    .popup-content button {
        font-size: 14px;
        padding: 6px;
    }    
}






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

/* تحسين جودة الصورة الملتقطة */
.schedule-table {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

.schedule-table td {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

/* =============================
   Multi-select checklist styles
   ============================= */
select[multiple] {
    width: 100%;
    min-height: 120px;
    margin: 10px;
    padding: 8px;
    border: 5px solid #ccc;
    border-radius: 8px;
    background-color: #ffffff;
    color: #000000;
    box-sizing: border-box;
    font-family: "Rubik", sans-serif;
}

body.dark-mode select[multiple] {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #555555;
}

/* Ensure options have sufficient vertical spacing */
select[multiple] option {
    padding: 4px 6px;
}

@media screen and (max-width: 767px) {
    select[multiple] {
        min-height: 48px;
    }
}

/* ======== Color Popup Styles ======== */
#colorPopup .popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* gap: 0px; */
}
#colorPopup .popup-content select.color-select {
    width: 90%;
    max-width: 220px;
    padding: 8px 12px;
    font-size: 1rem;
    border: 2px solid #007BFF;
    border-radius: 8px;
    background: #ffffff;
    color: #000000;
    cursor: pointer;
}
body.dark-mode #colorPopup .popup-content select.color-select {
    background: #1f1f1f;
    color: #ffffff;
    border-color: #4a90e2;
}
#colorPopup .popup-content input.color-input {
    width: 70px;
    height: 45px;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: 6px;
}
/* =================================== */
