:root {
    --greating-text: rgb(74, 74, 74);
    --modal-content: white;
    --text: black;
    --delete-subject-item: #f3f3f3;
}

[data-theme="dark"] {
    --greating-text: rgb(255, 255, 255);
    --modal-content: rgb(21, 19, 43);
    --text: white;
    --delete-subject-item: rgb(35, 33, 59);
}



/* Greating */
#greating {
    margin-top: 90px;
}

#portal-greating {
    text-align: center;
    margin-top: 190px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 75px;
    color: var(--greating-text);
}

#greating p {
    text-align: center;
    font-size: 30px;
    padding: 20px;
    color: var(--greating-text);
}

/* Modal Styles */
#modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--modal-content);
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    transform: scale(0.9);
    opacity: 0;
    color: var(--text);
    transition: all 0.3s ease;

    max-height: 85vh; /* 85% من ارتفاع الشاشة */
    display: flex;
    flex-direction: column;
}

#modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

#header-modal {
    display: flex;
    background: #0070ad;
    color: white;
    padding: 15px 20px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
}

#header-modal span {
    cursor: pointer;
    font-size: 28px;
    transition: transform 0.2s ease;
}

#header-modal span:hover {
    transform: rotate(90deg);
    color: red;
}


#modal-form-container {
    margin: 20px auto;
    width: 70%;
    display: flex;
    flex-direction: column;
}

#modal-body {
    overflow-y: auto;  /* هذا هو مفتاح الحل: إضافة تمرير عمودي عند الحاجة */
    flex-grow: 1;      /* يجعل هذا العنصر يملأ المساحة المتبقية */
    
    /* (اختياري) لإضافة مسافة بسيطة في الأسفل عند التمرير */
    padding-bottom: 20px;
}

.form-lb {
    direction: rtl;
    margin: 10px 0 5px auto;
    font-size: 20px;
    color: var(--text);
}

.text-box {
    padding: 5px;
    border-radius: 15px;
    font-size: 25px;
    margin-bottom: 20px;
}

.color-input {
    width: 70%;
    height: 40px;
    margin: 0 0 40px auto;
}


        /* checkbox style */


#days-checkbox-div {
    display: flex;
    justify-content: space-between;
}


.checkbox-input, .checkbox-input-period {
    display: none; 
}


.checkbox-label {
    display: inline-block;
    padding: 10px 20px;
    font-family: Arial, sans-serif;
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.4s ease;
}

        /* 3. Style the label when the checkbox is checked */
        /* HERE IS THE FIX:
        We use + (Adjacent Sibling) instead of ~ (General Sibling)
        This selects ONLY the label immediately following the checked input.
        */
.checkbox-input:checked + .checkbox-label {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.checkbox-input-period:checked + .checkbox-label {
    background-color: green;
    color: white;
    border-color: green;
}

    /* (Optional) Add a hover effect for good UX */
.checkbox-label:hover {
    border: 1px solid black;
    box-shadow: 0 0 10px black;
    text-shadow: 0 0 10px white;;
}

    /* Apply the fix here as well */
.checkbox-input:checked + .checkbox-label:hover {
    background-color: #0056b3;
}

.periods-container {
    width: 70%;
    margin: 10px auto;
    text-align: right;
    direction: rtl;
}

.periods-box-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

.periods-box-container label {
    margin: 5px;
}

.day-label {
    direction: rtl !important;
    text-align: right !important;
    margin: 10px 0 10px auto;
}

#add-button-div {
    width: 60%;
    margin: auto;
}

#add-button {
    padding: 10px 30px;
    width: 100%;
    margin: 10px auto;
    text-align: center;
    font-size: 20px;
    border-radius: 15px;
    transition: all 0.4s ease;
}

#add-button:hover {
    background-color: #0056b3;
    color: white;
    border: white;
}

/* schedule Creating container */

#schedule-container {
    width: 85%;
    margin: 60px auto;
}

#schedule-buttons {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 20px;
}

#schedule-buttons button {
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 20px;
    border: none;
    transition: all 0.4s ease;
}

#schedule-buttons button:hover {
    border: 1px solid black;
    box-shadow: 0 0 10px black;
    text-shadow: 0 0 10px white;
}

#schedule-table-contianer {
    padding: 30px;
    overflow: scroll;
}

table {
    width: 100%;
    min-width: 550px;
    text-align: center;
    overflow: scroll;
}

thead {
    border-radius: 15px 15px 0 0;
}

th {
    padding: 10px 0;
    background-color: rgb(225, 225, 225);
}

td {
    background-color: #103591;
    overflow: hidden;
    max-width: 30px;
    color: white;
    padding: 10px;
    margin: 10px;
    
}

.table-subjects {
    background-color: rgb(174, 174, 174);
}

/* Delete Modal Styles */
.delete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1100; /* higher than other elements */
    align-items: center;
    justify-content: center;
}

.delete-modal.active {
    display: flex;
}

#delete-modal.active {
    display: flex;
}

#delete-modal-header {
    display: flex;
    background: #c62828;
    color: white;
    padding: 15px 20px;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
}

#delete-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

#close-delete-modal {
    cursor: pointer;
    transition: all 0.2s ease;
}

#close-delete-modal:hover {
    transform: rotate(90deg);
    color: gainsboro;
}

#subjects-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--delete-subject-item);
    margin: 10px 0;
    padding: 10px 20px;
    border-radius: 10px;
}
.subject-item button {
    background-color: #c62828;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

#delete-modal.delete-modal.active {
    display: flex;
}

#delete-modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Phone alert */
#phone-alert {
    display: none;
}

/* Export buttons */
#export-container {
    width: 50%;
    margin: 20px auto;
    display: flex;
    justify-content: space-evenly;
}

#export-container button {
    font-size: 20px;
    padding: 10px 20px;
    direction: rtl;
    border-radius: 10px;
    border: none;
    transition: all 0.4s ease;
}

#export-png-btn {
    background-color: #3267a0;
    color: white;
}

#export-pdf-btn {
    background-color: #bd2f2f;
    color: white;
}

#export-excel-btn {
    background-color: green;
    color: white;
}

#export-png-btn:hover, #export-pdf-btn:hover, #export-excel-btn:hover {
    box-shadow: 5px 5px 10px #333 ;
    border: 1px solid black;
    text-shadow: 2px 2px 4px white;
}

/* responsive greating */
@media (max-width:600px) {
    #portal-greating {
        font-size: 50px;
    }

    #greating p {
        font-size: 20px;
    }
}


/* responsive Schedule buttons */
@media (max-width:600px) {
    #schedule-buttons button {
        font-size: 15px;
    }
}

@media (max-width:500px) {
    #schedule-buttons button {
        font-size: 12px;
    }
}

/* responsive Schedule table */
@media (max-width:1000px) {
    #schedule-container {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    #schedule-table-contianer {
        width: 100%;
        padding: 20px;
    }
    table {
        width: 100%;
    }
}

@media (max-width:800px) {
    th, td {
        font-size: 10px;
    }

    #schedule-table-contianer {
        width: 100%;
        padding: 5px;
        margin: 60px 0;

    }
}


/* responsive phone alert */
@media (max-width: 545px) {
    #phone-alert {
        display: block;
        margin: auto;
        width: 85%;
        text-align: center;
    }

    #phone-alert h3 {
        font-size: 15px;
        text-align: center;
    }
}

/* responsive export buttons */
@media (max-width:1060px) {
    #export-container {
        width: 80%;
    }
}

@media (max-width:600px) {
    #export-container button {
        font-size: 15px;
    }
}

@media (max-width:460px) {
    #export-container button {
        font-size: 12px;
    }

    #export-container {
        width: 95%;
    }
}