/* === Global === */
:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --accent:#5b8def;
  --accent-2:#7dd3a6;
  --danger:#e74c3c;
  --muted:#8a98a8;
  --glass: rgba(255,255,255,0.6);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: 'Inter', Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg,var(--bg), #eef3fb);
  color:#1f2937;
  -webkit-font-smoothing:antialiased;
  direction: rtl;
  text-align: right;
}

table th, table td {
    text-align: center;
}


/* container */
.wrapper{width:95%;max-width:1100px;margin:28px auto;padding:18px;}
.card{background:var(--card);border-radius:12px;padding:18px;box-shadow:0 6px 24px rgba(20,30,60,0.06);}

/* Header */
.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.brand{display:flex;gap:12px;align-items:center}
.logo{width:44px;height:44px;border-radius:10px;background:linear-gradient(135deg,var(--accent),#3db3ff);display:flex;align-items:center;justify-content:center;color:white;font-weight:700}
.brand h1{font-size:18px;margin:0}
.header .meta{color:var(--muted);font-size:14px}

/* Buttons */
.btn{display:inline-block;padding:10px 14px;border-radius:10px;border:none;background:var(--accent);color:white;cursor:pointer;font-weight:600;text-decoration:none;transition:transform .08s ease, box-shadow .12s;}
.btn:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(91,141,239,0.18);}
.btn.secondary{background:#fff;border:1px solid #e6eefc;color:var(--accent);box-shadow:none}
.btn.ghost{background:transparent;border:1px dashed #e3e8f3;color:var(--muted)}

/* forms */
label{display:block;font-weight:600;margin-bottom:6px}
input[type="text"], input[type="number"], textarea, select{
  width:100%;padding:10px;border-radius:8px;border:1px solid #e6eefc;background:#fbfdff;
  transition:box-shadow .12s ease, border-color .12s ease;
}
input:focus, textarea:focus, select:focus{outline:none;box-shadow:0 6px 20px rgba(91,141,239,0.12);border-color:var(--accent)}

/* table - admin */
.table{width:100%;border-collapse:collapse;margin-top:12px}
.table th, .table td{padding:12px;border-bottom:1px solid #f0f4fb;text-align:left}
.table th{background:linear-gradient(90deg,var(--accent),#3db3ff);color:white;font-weight:700;border-top-left-radius:8px;border-top-right-radius:8px}
.table tr:hover td{background:#fbfdff}

/* user exam question cards */
.question{border-radius:10px;padding:14px;margin-bottom:12px;border:1px solid #eef6ff;background:linear-gradient(180deg,#ffffff, #fbfdff)}
.q-title{font-weight:700;margin-bottom:8px}
.options{display:flex;flex-direction:column;gap:8px}
.option{display:flex;align-items:center;gap:10px;padding:10px;border-radius:8px;border:1px solid #eef6ff;background:white;transition:transform .08s}
.option:hover{transform:translateY(-2px)}

/* timer + progress */
/* تایمر پاپ‌آپ گوشه صفحه */
.exam-timer-popup {
    position: fixed;
    bottom: 20px;   /* تغییر از top به bottom */
    left: 20px;     /* تغییر از right به left */
    background: linear-gradient(135deg, #3db3ff, #3d61ff);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 18px;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
    transition: background 0.3s ease;
    animation: fadeIn 0.5s ease;
    min-width: 120px;
}
.exam-timer-popup.warning {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: shake 0.5s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
.timer-progress {
    height: 4px;
    background: rgba(255,255,255,0.3);
    margin-top: 6px;
    border-radius: 3px;
    overflow: hidden;
}
.timer-progress-bar {
    height: 100%;
    background: #ffd000;
    width: 100%;
    transition: width 1s linear;
}


/* result box */
.result-box{padding:12px;border-radius:10px;background:linear-gradient(180deg,#fbfdff,#ffffff);border:1px solid #eef6ff}
.result-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px dashed #f0f4fb}

/* modal (popup) */
.modal-backdrop{position:fixed;inset:0;background:rgba(10,20,40,0.45);display:flex;align-items:center;justify-content:center;z-index:60;opacity:0;pointer-events:none;transition:opacity .18s}
.modal-backdrop.show{opacity:1;pointer-events:auto}
.modal{width:90%;max-width:520px;background:white;border-radius:12px;padding:18px;box-shadow:0 12px 40px rgba(10,20,40,0.2);transform:translateY(12px);transition:transform .18s}
.modal h3{margin-top:0}
.modal .modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}

/* small */
.small{font-size:13px;color:var(--muted)}

/* responsive */
@media (max-width:720px){
  .exam-top{flex-direction:column;align-items:flex-start}
  .progress-wrap{width:100%;margin-left:0;margin-top:8px}
}