@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap');

/* ============================================
   الكود القديم — محرر الأسئلة في الإدارة
   ============================================ */
.dflex {
    background: #f7f7f7;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 5px;
}
.dflex input {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
}
.loader {
  width: 20px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid;
  border-color: #000 #0000;
  animation: l1 1s infinite;
  margin: 20px auto;
}
@keyframes l1 {to{transform: rotate(.5turn)}}
ul.question-lists li {
    background: #fff;
    padding: 10px;
    position: relative;
    border-bottom: 1px solid #ddd;
}
ul.question-lists li:last-child { border:0 }
ul.question-lists li span {
    position: absolute;
    background: #007cba;
    padding: 2px 10px;
    left: 10px;
    top: 8px;
    border-radius: 5px;
    color: #fff;
    transition: .35s ease;
    opacity: 0;
    cursor: pointer;
}
ul.question-lists li:hover span { opacity:1 }
ul.question-lists li span:hover { background:#1f1f1f }
.search-results {
    position: relative;
    box-sizing: border-box;
}
.question-lists {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    max-width: 500px;
    background: #fefefe;
    box-shadow: 0 0 20px #0000001f;
    z-index: 999;
}
.quest {
    padding: 10px;
    background: #fff;
    margin-bottom: 6px;
    border-radius: 5px;
    border: 1px solid #eee;
    cursor: all-scroll;
    position: relative;
}
.remove {
    background: #f003;
    color: #f00;
    padding: 1px 8px;
    position: absolute;
    left: 8px;
    top: 8px;
    border-radius: 5px;
    opacity: 0;
    transition: .35s ease;
    cursor: pointer;
}
.quest:hover .remove { opacity:1 }
.remove:hover { background:#f00; color:#fff }
.list-chosen-questions { margin-top: 15px; }


@keyframes aq-fadeUp {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes aq-ripple {
    0%   { transform:scale(0); opacity:.35; }
    100% { transform:scale(3); opacity:0; }
}
@keyframes aq-shine {
    0%   { left:-100%; }
    100% { left:200%; }
}
@keyframes aq-goldPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(186,117,23,.35); }
    60%      { box-shadow: 0 0 0 8px rgba(186,117,23,.0); }
}
@keyframes aq-spin {
    to { transform: rotate(.5turn); }
}

/* ---- الحاوية الرئيسية ---- */
.aq-wrap {
    padding: 1.5rem 1.25rem 1.75rem;
    direction: rtl;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    max-width: 860px;
    margin: 0 auto;
}

/* ---- زر اكسب نقاط ---- */
.aq-points-btn {
    width: 100%;
    border: 1.5px solid #EF9F27;
    border-radius: 13px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    color: #633806;
    position: relative;
    overflow: hidden;
    transition: transform .12s, filter .2s;
    background: #FAEEDA;
    text-decoration: none;
    animation: aq-fadeUp .32s ease both, aq-goldPulse 2.5s 1.5s infinite;
}
.aq-points-btn:hover { transform: translateY(-2px); filter: brightness(.96); }
.aq-points-btn:active { transform: scale(.98); }
.aq-points-btn .aq-shine {
    position: absolute; inset: 0; left: -100%;
    width: 55%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
    animation: aq-shine 2.2s .8s infinite;
    pointer-events: none;
}
.aq-points-btn .aq-pb-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #EF9F27;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff; flex-shrink: 0;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.aq-points-btn:hover .aq-pb-icon { transform: rotate(-8deg) scale(1.1); }
.aq-points-btn .aq-pb-info {
    display: flex; flex-direction: column; gap: 2px;
    text-align: right; flex: 1;
}
.aq-points-btn .aq-pb-title { font-size: 15px; font-weight: 600; color: #633806; }
.aq-points-btn .aq-pb-sub  { font-size: 11px; color: #854F0B; opacity: .8; }
.aq-points-btn .aq-pb-badge {
    background: #EF9F27; color: #fff;
    font-size: 11px; font-weight: 600;
    padding: 3px 12px; border-radius: 20px;
    white-space: nowrap; flex-shrink: 0;
}
.aq-pb-rpl {
    position: absolute; border-radius: 50%;
    width: 80px; height: 80px;
    background: rgba(239,159,39,.25);
    animation: aq-ripple .65s ease-out forwards;
    pointer-events: none;
}

/* ---- فاصل أو ---- */
.aq-divider-or {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 1rem;
    animation: aq-fadeUp .32s .05s ease both;
}
.aq-divider-or .aq-dl { flex:1; height:1px; background:#e0e0e0; }
.aq-divider-or span {
    font-size: 11px; font-weight: 600;
    color: #888; letter-spacing: .5px;
}

/* ---- صف البحث ---- */
.aq-search-row {
    display: flex; gap: 8px;
    margin-bottom: .6rem;
    animation: aq-fadeUp .32s .08s ease both;
    align-items: stretch;
}

/* أزرار كمي / لفظي */
.aq-type-btns { display: flex; gap: 5px; flex-shrink: 0; }
.aq-tt {
    border: 1.5px solid #ddd;
    border-radius: 11px;
    padding: 0 13px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: #fff;
    transition: all .2s;
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap; color: #888;
}
.aq-tt i { font-size: 13px; }
.aq-tt:hover { transform: translateY(-1px); }
.aq-tt:active { transform: scale(.96); }
.aq-tt-k.aq-sel {
    background: #E6F1FB; border-color: #378ADD;
    color: #0C447C;
    box-shadow: 0 0 0 3px rgba(55,138,221,.12);
}
.aq-tt-l.aq-sel {
    background: #E1F5EE; border-color: #1D9E75;
    color: #085041;
    box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}
.aq-tt-k.aq-sel i { color: #378ADD; }
.aq-tt-l.aq-sel i { color: #1D9E75; }

/* صندوق البحث */
.aq-search-box {
    flex: 1; display: flex; align-items: center; gap: 10px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color .22s, box-shadow .22s;
}
.aq-search-box:focus-within {
    border-color: #378ADD;
    box-shadow: 0 0 0 3px rgba(55,138,221,.1);
}
.aq-search-box.aq-lf:focus-within {
    border-color: #1D9E75;
    box-shadow: 0 0 0 3px rgba(29,158,117,.1);
}
.aq-search-box.aq-al:focus-within {
    border-color: #7F77DD;
    box-shadow: 0 0 0 3px rgba(127,119,221,.1);
}
.aq-search-icon {
    font-size: 17px; color: #bbb;
    transition: transform .22s, color .22s;
}
.aq-search-box.aq-km .aq-search-icon { color: #378ADD; }
.aq-search-box.aq-lf .aq-search-icon { color: #1D9E75; }
.aq-search-box.aq-al .aq-search-icon { color: #7F77DD; }
.aq-search-box:focus-within .aq-search-icon { transform: rotate(-10deg) scale(1.1); }
.aq-search-box input {
    flex: 1; border: none; outline: none;
    background: transparent;
    font-size: 14px; color: #333;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    padding: 12px 0;
}
.aq-search-box input::placeholder { color: #bbb; }

/* زر بحث */
.aq-sbtn {
    color: #fff; border: none;
    border-radius: 11px; padding: 0 20px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    white-space: nowrap;
    background: #bbb;
    transition: background .25s, transform .12s, filter .18s;
}
.aq-sbtn.aq-km { background: #378ADD; }
.aq-sbtn.aq-lf { background: #1D9E75; }
.aq-sbtn.aq-al { background: #7F77DD; }
.aq-sbtn:hover { filter: brightness(.9); transform: translateY(-1px); }
.aq-sbtn:active { transform: scale(.97); }

/* نتائج البحث */
.aq-search-results { position: relative; }
.aq-question-lists {
    position: absolute;
    top: 100%; right: 0;
    width: 100%; max-width: 100%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 999;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    margin-top: 4px;
}
.aq-question-lists li {
    list-style: none;
    background: #fff;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px; color: #333;
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.aq-question-lists li:last-child { border: 0; }
.aq-question-lists li span {
    background: #378ADD;
    padding: 3px 12px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s;
}
.aq-question-lists li span:hover { background: #185FA5; }

/* ---- شريط التلميح ---- */
.aq-hint-bar {
    height: 18px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.aq-hint-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #ddd;
    transition: background .2s; flex-shrink: 0;
}
.aq-hint-dot.aq-k  { background: #378ADD; }
.aq-hint-dot.aq-l  { background: #1D9E75; }
.aq-hint-dot.aq-kl { background: #7F77DD; }
.aq-hint-txt { font-size: 11px; color: #aaa; }

/* ---- شبكة الفلاتر 4×4 ---- */
.aq-grid4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.aq-fc {
    border-radius: 11px;
    padding: 11px 13px;
    border: 1.5px solid;
    display: flex; flex-direction: column; gap: 5px;
    transition: transform .18s, box-shadow .18s;
    animation: aq-fadeUp .38s ease both;
    opacity: 0;
    animation-fill-mode: both;
}
.aq-fc:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.09);
}
.aq-fc-lbl {
    font-size: 10px; font-weight: 600;
    letter-spacing: .5px;
    display: flex; align-items: center; gap: 5px;
}
.aq-fc-lbl i { font-size: 13px; }
.aq-fc-sel {
    border: none; outline: none;
    background: transparent;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    width: 100%; appearance: none;
    padding: 2px 0 0;
}

/* ألوان الفلاتر */
.aq-teal   { background:#E1F5EE; border-color:#5DCAA5; }
.aq-teal   .aq-fc-lbl { color:#0F6E56; }
.aq-teal   .aq-fc-sel { color:#085041; }
.aq-blue   { background:#E6F1FB; border-color:#85B7EB; }
.aq-blue   .aq-fc-lbl { color:#185FA5; }
.aq-blue   .aq-fc-sel { color:#0C447C; }
.aq-purple { background:#EEEDFE; border-color:#AFA9EC; }
.aq-purple .aq-fc-lbl { color:#534AB7; }
.aq-purple .aq-fc-sel { color:#3C3489; }
.aq-amber  { background:#FAEEDA; border-color:#EF9F27; }
.aq-amber  .aq-fc-lbl { color:#854F0B; }
.aq-amber  .aq-fc-sel { color:#633806; }
.aq-coral  { background:#FAECE7; border-color:#F0997B; }
.aq-coral  .aq-fc-lbl { color:#993C1D; }
.aq-coral  .aq-fc-sel { color:#712B13; }
.aq-pink   { background:#FBEAF0; border-color:#ED93B1; }
.aq-pink   .aq-fc-lbl { color:#993556; }
.aq-pink   .aq-fc-sel { color:#72243E; }

/* ---- أزرار الوقت ---- */
.aq-tog {
    border-radius: 11px;
    padding: 11px 13px;
    border: 1.5px solid;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
    animation: aq-fadeUp .38s ease both;
    opacity: 0; animation-fill-mode: both;
    user-select: none;
}
.aq-tog:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.09);
}
.aq-tog:active { transform: scale(.97); }
.aq-tog-lbl { font-size: 13px; font-weight: 500; flex: 1; }
.aq-tblue { background:#E6F1FB; border-color:#85B7EB; }
.aq-tblue .aq-tog-lbl  { color:#0C447C; }
.aq-tblue .aq-tog-icon { color:#378ADD; font-size:16px; }
.aq-track {
    width: 34px; height: 19px;
    border-radius: 10px;
    background: rgba(0,0,0,.13);
    position: relative;
    transition: background .25s;
    flex-shrink: 0;
}
.aq-track.aq-on { background: #378ADD; }
.aq-thumb {
    width: 15px; height: 15px;
    border-radius: 50%; background: #fff;
    position: absolute; top: 2px; right: 2px;
    transition: right .22s cubic-bezier(.34,1.56,.64,1), transform .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.aq-track.aq-on .aq-thumb { right: 17px; }
.aq-tog:active .aq-thumb { transform: scaleX(1.3); }

/* ---- زر ابدأ الاختبار ---- */
.aq-go-btn {
    width: 100%; border: none;
    border-radius: 12px; padding: 14px;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    margin-top: 8px; margin-bottom: 1.5rem;
    color: #fff;
    position: relative; overflow: hidden;
    transition: transform .12s, filter .2s, background .3s;
    animation: aq-fadeUp .38s .3s ease both;
    opacity: 0; animation-fill-mode: both;
    background: #534AB7;
}
.aq-go-btn.aq-km  { background: #378ADD; }
.aq-go-btn.aq-lf  { background: #1D9E75; }
.aq-go-btn.aq-al  { background: #7F77DD; }
.aq-go-btn.aq-any { background: #534AB7; }
.aq-go-btn:hover { transform: translateY(-2px); filter: brightness(.92); }
.aq-go-btn:active { transform: scale(.98); }
.aq-go-btn .aq-btn-icon {
    transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.aq-go-btn:hover .aq-btn-icon { transform: translateX(-4px) scale(1.1); }
.aq-go-btn .aq-shine {
    position: absolute; inset: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
    animation: aq-shine 2.8s 1s infinite;
    pointer-events: none;
}
.aq-rpl {
    position: absolute; border-radius: 50%;
    width: 80px; height: 80px;
    background: rgba(255,255,255,.22);
    animation: aq-ripple .65s ease-out forwards;
    pointer-events: none;
}

/* ---- فاصل الإحصائيات ---- */
.aq-sep {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 1rem;
    animation: aq-fadeUp .38s .35s ease both;
    opacity: 0; animation-fill-mode: both;
}
.aq-sep-line { flex: 1; height: 1px; background: #eee; }
.aq-sep-lbl {
    font-size: 11px; font-weight: 600;
    color: #aaa; letter-spacing: .6px; white-space: nowrap;
}

/* ---- شبكة الإحصائيات ---- */
.aq-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.aq-sc {
    background: #f7f7f7;
    border-radius: 11px;
    padding: 13px 12px;
    display: flex; flex-direction: column; gap: 3px;
    transition: transform .18s;
    animation: aq-fadeUp .38s ease both;
    opacity: 0; animation-fill-mode: both;
}
.aq-sc:hover { transform: translateY(-3px); }
.aq-sc-ico {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; margin-bottom: 5px;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.aq-sc:hover .aq-sc-ico { transform: scale(1.15) rotate(-5deg); }
.aq-ico-t { background:#E1F5EE; color:#0F6E56; }
.aq-ico-g { background:#EAF3DE; color:#3B6D11; }
.aq-ico-r { background:#FCEBEB; color:#A32D2D; }
.aq-ico-a { background:#FAEEDA; color:#854F0B; }
.aq-sc-lbl { font-size: 11px; color: #aaa; line-height: 1.3; }
.aq-sc-val { font-size: 21px; font-weight: 600; color: #333; }

/* ---- مستوى الطالب ---- */
.aq-levels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1.5rem;
    animation: aq-fadeUp .38s .4s ease both;
    opacity: 0; animation-fill-mode: both;
}
.aq-level-card {
    border-radius: 12px;
    padding: 14px 16px;
    border: 1.5px solid;
    display: flex; flex-direction: column; gap: 8px;
}
.aq-level-card.aq-lc-k {
    background: #E6F1FB; border-color: #85B7EB;
}
.aq-level-card.aq-lc-l {
    background: #E1F5EE; border-color: #5DCAA5;
}
.aq-level-top {
    display: flex; align-items: center;
    justify-content: space-between;
}
.aq-level-name {
    font-size: 13px; font-weight: 600;
}
.aq-lc-k .aq-level-name { color: #185FA5; }
.aq-lc-l .aq-level-name { color: #0F6E56; }
.aq-level-badge {
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
}
.aq-lc-k .aq-level-badge { background:#378ADD; color:#fff; }
.aq-lc-l .aq-level-badge { background:#1D9E75; color:#fff; }
.aq-level-pts {
    font-size: 11px;
}
.aq-lc-k .aq-level-pts { color: #185FA5; }
.aq-lc-l .aq-level-pts { color: #0F6E56; }
.aq-level-bar-wrap {
    height: 7px;
    border-radius: 10px;
    background: rgba(0,0,0,.1);
    overflow: hidden;
}
.aq-level-bar {
    height: 100%;
    border-radius: 10px;
    transition: width .6s cubic-bezier(.34,1.2,.64,1);
}
.aq-lc-k .aq-level-bar { background: #378ADD; }
.aq-lc-l .aq-level-bar { background: #1D9E75; }

/* لودر البحث */
.aq-loader {
    width: 20px; aspect-ratio: 1;
    border-radius: 50%; border: 3px solid;
    border-color: #378ADD #0000;
    animation: aq-spin 1s infinite;
    margin: 16px auto;
}

/* ريسبونسف */
@media (max-width: 600px) {
    .aq-grid4 { grid-template-columns: repeat(2, 1fr); }
    .aq-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .aq-levels { grid-template-columns: 1fr; }
    .aq-search-row { flex-wrap: wrap; }
    .aq-type-btns { width: 100%; }
    .aq-tt { flex: 1; justify-content: center; }
}