
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{

    font-family:'Poppins',sans-serif;
    background:
    linear-gradient(135deg,#dbeafe,#f8fafc);

    min-height:100vh;
    padding:30px;
}

/* ================= HEADER ================= */

.topbar{

    max-width:850px;
    margin:auto;
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.home-btn{

    text-decoration:none;
    background:#111827;
    color:white;
    padding:12px 18px;
    border-radius:12px;
    font-size:15px;
    transition:0.3s;
}

.home-btn:hover{

    background:#000;
    transform:translateY(-2px);
}

.student{

    color:#374151;
    font-weight:600;
}

/* ================= CARD ================= */

.card{

    background:white;
    max-width:850px;
    margin:auto;
    border-radius:28px;
    padding:40px;
    box-shadow:0 15px 40px rgba(0,0,0,0.08);
}

/* ================= TITLE ================= */

.exam-title{

    text-align:center;
    margin-bottom:30px;
}

.exam-title h1{

    font-size:28px;
    color:#111827;
    margin-bottom:10px;
}

.exam-title p{

    color:#6b7280;
    font-size:16px;
}

/* ================= PROGRESS ================= */

.progress-box{

    margin-bottom:30px;
}

.progress-info{

    display:flex;
    justify-content:space-between;
    margin-bottom:10px;
    font-weight:600;
    color:#374151;
}

.progress{

    width:100%;
    height:12px;
    background:#e5e7eb;
    border-radius:20px;
    overflow:hidden;
}

.progress-bar{

    height:100%;
    background:#2563eb;
    width:
    <?php echo (($current + 1) / $totalQuestions) * 100; ?>%;
}

/* ================= AUDIO ================= */

.audio-card{

    background:#f9fafb;
    border:2px dashed #d1d5db;
    border-radius:20px;
    padding:30px;
    margin-bottom:35px;
    text-align:center;
}

#timer{

    font-size:24px;
    font-weight:bold;
    color:#dc2626;
    margin-bottom:20px;
}

audio{

    width:100%;
    display:none;
}

/* ================= QUESTION ================= */

.question-number{

    color:#2563eb;
    font-weight:bold;
    margin-bottom:12px;
    font-size:18px;
}

.question{

    font-size:28px;
    color:#111827;
    line-height:1.5;
    margin-bottom:30px;
}

/* ================= ANSWERS ================= */

.answers{

    display:flex;
    flex-direction:column;
    gap:18px;
}

.answer{

    border:2px solid #e5e7eb;
    border-radius:18px;
    padding:20px;
    cursor:pointer;
    transition:0.3s;
    font-size:17px;
}

.answer:hover{

    border-color:#2563eb;
    background:#eff6ff;
    transform:translateX(5px);
}

.answer input{

    margin-right:12px;
    transform:scale(1.2);
}

/* ================= BUTTONS ================= */

.buttons{

    display:flex;
    justify-content:space-between;
    gap:15px;
    margin-top:40px;
}

.btn{

    flex:1;
    border:none;
    padding:18px;
    border-radius:16px;
    font-size:17px;
    font-weight:bold;
    cursor:pointer;
    transition:0.3s;
}

.prev-btn{

    background:#e5e7eb;
    color:#111827;
}

.prev-btn:hover{

    background:#d1d5db;
}

.next-btn{

    background:#2563eb;
    color:white;
}

.next-btn:hover{

    background:#1d4ed8;
}

/* ================= MOBILE ================= */

@media(max-width:768px){

    .card{

        padding:25px;
    }

    .question{

        font-size:22px;
    }

    .buttons{

        flex-direction:column;
    }

    .topbar{

        flex-direction:column;
        gap:15px;
    }
}
/* الأب هو النافذة بالكامل وتملأ الشاشة */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.5); 
    backdrop-filter: blur(5px); 
    z-index: 9999; 
    /* هذه تضمن التمركز المثالي */
    display: none; /* سيتم تغييرها إلى flex عبر الجافاسكريبت */
    justify-content: center; 
    align-items: center; 
}

/* هنا التعديل المهم: إضافة relative ليتم وضع زر الإغلاق بناءً عليه */
.modal-content { 
    background: #fff; 
    padding: 30px; 
    border-radius: 20px; 
    width: 90%; 
    max-width: 450px; 
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative; /* مهم جداً ليعمل زر الإغلاق داخل الصندوق */
}

/* تحسين الأزرار لتناسب الموبايل */
.modal-grid { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 10px; 
    margin-top: 20px; 
}

.q-link { 
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: #f8f9fa; 
    border: 1px solid #ddd;
    border-radius: 50%; 
    text-decoration: none; 
    color: #333; 
    font-weight: 600;
    transition: all 0.3s;
    margin: 0 auto; /* لضمان تمركز الدائرة */
}

/* زر الإغلاق */
.close-modal { 
    position: absolute; 
    top: 10px; 
    right: 20px; 
    font-size: 30px; 
    cursor: pointer; 
    color: #333;
}