/* ===================  //mustafa.saoud====================== */


/* ======   Styles for ALL Screens   ======= */


/* ========================================= */

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Added for better box model handling */
}


/* ===================  //mustafa.saoud====================== */

*,
*:before,
*:after {
    box-sizing: inherit;
    /* Ensures padding and border are included in the element's total width and height */
}

header {
    background-color: #004b8d;
    color: white;
    padding: 20px 10px;
    background-image: url('Log.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 500px auto;
    /* أو حسب حجم الصورة المناسب */
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    /* Added for better layout on very large screens */
    margin: 0 auto;
}

.header-text {
    flex: 1;
    text-align: center;
    padding: 0 15px;
}

.logo {
    width: 150px;
    /* Slightly reduced size for better balance */
    height: auto;
}


/* ===================  //mustafa.saoud====================== */

.form-section {
    background: white;
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
    text-align: center;
    margin-bottom: 20px;
}

form input,
form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}


/* ====== تمت إضافة تنسيقات لمربعات الاختيار ====== */

.course-checkbox-group {
    margin-bottom: 15px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 6px;
}

.course-checkbox-group h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin: 0 0 0 10px;
    /* تعديل الهامش ليتناسب مع اتجاه RTL */
}

.checkbox-container label {
    font-size: 16px;
    cursor: pointer;
}


/* ============================================== */


/* ===================  //mustafa.saoud====================== */

form button {
    width: 100%;
    padding: 12px;
    background-color: #004b8d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

form button:hover {
    background-color: #003366;
}

.table-section {
    /* Changed max-width to be more flexible */
    max-width: 95%;
    width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    /* Add horizontal scroll on desktop if table is too wide */
}

.table-section h3 {
    text-align: center;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}


/* ===================  //mustafa.saoud====================== */

th,
td {
    padding: 12px;
    border: 1px solid #ddd;
}

th {
    background-color: #f0f0f0;
    font-weight: bold;
}

footer {
    text-align: center;
    background-color: #004b8d;
    color: white;
    padding: 15px;
    margin-top: 30px;
}

#downloadCSV {
    display: block;
    /* Make it a block element for easier margin handling */
    margin: 20px auto 0;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
}


/* ===================  //mustafa.saoud====================== */

#downloadCSV:hover {
    background-color: #218838;
}


/* ========================================= */


/* =====   Styles for Mobile Screens   ===== */


/* ===================  //mustafa.saoud====================== */


/* ========================================= */

@media (max-width: 768px) {
    /* --- Header Adjustments --- */
    .header-container {
        flex-direction: column;
        /* Stack header items vertically */
    }
    .logo {
        margin: 10px 0;
        width: 120px;
        /* Make logos smaller on mobile */
    }
    .header-text h1 {
        font-size: 1.5em;
        /* Adjust font size */
    }
    .header-text h2 {
        font-size: 1.1em;
        /* Adjust font size */
    }
    /* ===================  //mustafa.saoud====================== */
    /* --- Form & Table Sections Spacing --- */
    .form-section,
    .table-section {
        width: 95%;
        /* Use more of the screen width */
        margin: 20px auto;
        padding: 15px;
    }
    /* ===================  //mustafa.saoud====================== */
    /* --- Responsive Table Magic --- */
    /* Hide the table headers (we'll add them back in the cells) */
    table thead {
        display: none;
    }
    /* Make the table, body, rows, and cells behave like blocks */
    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }
    /* Make each row look like a card */
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
        /* To respect the border-radius */
    }
    td {
        text-align: right;
        /* Align text to the right */
        padding-right: 50%;
        /* Make space for the label on the left */
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
        /* Separator between cells in a card */
    }
    td:last-child {
        border-bottom: 0;
    }
    /* ===================  //mustafa.saoud====================== */
    /* Add the labels before each piece of data */
    td::before {
        content: attr(data-label);
        /* Use a data-label attribute (better) or hardcode */
        position: absolute;
        right: 10px;
        /* Position the label on the right */
        width: 45%;
        padding-left: 10px;
        font-weight: bold;
        text-align: right;
    }
    /* We will now assign the labels using their column order */
    td:nth-of-type(1)::before {
        content: "الاسم:";
    }
    td:nth-of-type(2)::before {
        content: "البريد الإلكتروني:";
    }
    td:nth-of-type(3)::before {
        content: "رقم الهاتف:";
    }
    td:nth-of-type(4)::before {
        content: "الدورة:";
    }
    /* ===================  //mustafa.saoud====================== */
    td:nth-of-type(5)::before {
        content: "طالب جامعي؟:";
    }
    td:nth-of-type(6)::before {
        content: "اسم الكلية:";
    }
    td:nth-of-type(7)::before {
        content: "اسم القسم:";
    }
    td:nth-of-type(8)::before {
        content: "رقم القيد:";
    }
    /* --- Button Adjustments --- */
    #downloadCSV {
        width: 100%;
        /* Make button full-width for easy tapping */
    }
    /* ===================  //mustafa.saoud====================== */
}


/* ===================  //mustafa.saoud====================== */

body#display-page {
    background-color: #2c3e50;
    /* خلفية داكنة */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100vh;
    overflow: hidden;
}

#display-container h1 {
    font-size: 5vw;
    /* حجم خط يتناسب مع الشاشة */
    color: #ecf0f1;
}

#display-container p {
    font-size: 3vw;
    color: #bdc3c7;
}

#qr-code-canvas {
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    display: inline-block;
}


/* ===================  //mustafa.saoud====================== */

#qr-code-canvas img {
    width: 25vw !important;
    /* حجم كبير للـ QR */
    height: 25vw !important;
}

#room-code-display {
    font-size: 6vw;
    font-weight: bold;
    letter-spacing: 10px;
    /* تباعد بين الأحرف */
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 15px;
    margin-top: 20px;
}