/* Tawheed Foundation Live Quizzes - Dark UI */

.tf-lq{
  max-width:900px;
  margin:0 auto;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:#fff;
}
.tf-lq-header{display:flex;align-items:center;justify-content:space-between;margin:14px 0}
.tf-lq-panel,
.tf-lq-qcard,
.tf-lq-codebox,
.tf-lq-board{
  background:#0f0f0f;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:16px;
  margin:14px 0;
}
.tf-lq .tf-lq-row{display:flex;gap:10px;align-items:center}
.tf-lq .tf-lq-spacer{flex:1}
.tf-lq label{display:block;font-weight:600;margin:6px 0;color:#fff}

.tf-lq input[type=text], .tf-lq select{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background:#1a1a1a;
  color:#fff;
  outline:none;
}
.tf-lq-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:720px){.tf-lq-grid2{grid-template-columns:1fr}}

.tf-lq-btn{
  border:1px solid rgba(255,255,255,.18);
  background:#1f1f1f;
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700
}
.tf-lq-btn:hover{background:#2a2a2a}

.tf-lq-btn-primary{background:#ffffff;color:#000;border-color:#ffffff}
.tf-lq-btn-primary:hover{background:#eaeaea}

.tf-lq-btn-secondary{background:#0f0f0f}
.tf-lq-btn-small{padding:7px 10px;border-radius:10px;font-weight:700}
.tf-lq-danger{border-color:#ff4d4f;color:#ff4d4f}
.tf-lq-muted{color:rgba(255,255,255,.65)}

.tf-lq-note{
  padding:12px 16px;
  border-left:4px solid rgba(255,255,255,.18);
  background:#151515;
  border-radius:10px
}

.tf-lq-table{display:block;border:1px solid rgba(255,255,255,.10);border-radius:12px;overflow:hidden}
.tf-lq-tr{display:grid;grid-template-columns:1fr 120px 180px;gap:10px;padding:10px 12px;border-top:1px solid rgba(255,255,255,.08);align-items:center}
.tf-lq-th{background:#151515;font-weight:800;border-top:none}
@media(max-width:720px){.tf-lq-tr{grid-template-columns:1fr 90px 140px}}
.tf-lq-actions{display:flex;gap:8px;justify-content:flex-end}

.tf-lq-qcard h4{margin:0 0 8px 0}
.tf-lq-qbox{border:1px dashed rgba(255,255,255,.25);border-radius:12px;padding:12px;min-height:60px}

.tf-lq-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
@media(max-width:720px){.tf-lq-options{grid-template-columns:1fr}}
.tf-lq-optbtn{
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:#1c1c1c;
  color:#fff;
  font-weight:800;
  text-align:left;
  cursor:pointer
}
.tf-lq-optbtn:hover{background:#2a2a2a}
.tf-lq-optbtn[disabled]{opacity:.65;cursor:not-allowed}

.tf-lq-code{font-size:44px;letter-spacing:6px;font-weight:900;margin-top:6px;color:#fff}

.tf-lq-scorepill{
  border:1px solid rgba(255,255,255,.12);
  background:#1c1c1c;
  border-radius:999px;
  padding:8px 12px;
  font-weight:800
}

.tf-lq-board-row{display:flex;justify-content:space-between;padding:10px 12px;border-top:1px solid rgba(255,255,255,.06)}
.tf-lq-board-row:first-child{border-top:none}

code{background:#202020;color:#fff;padding:2px 6px;border-radius:8px}

.tf-lq-letter{color:#FFD77D;}
.tf-lq-optbtn.tf-lq-selected{outline:2px solid rgba(255,215,125,.6);}

/* Host view: highlight correct option */
.tf-lq-optbtn.tf-lq-correct{
  outline: 2px solid rgba(120, 255, 160, 0.65);
}

/* Code box spacing */
.tf-lq-codebox{padding:22px 18px;}
.tf-lq-code{margin-top:12px;margin-bottom:10px;line-height:1.05;}


/* Responsive table wrapper for mobile (Quiz Dashboard list) */
.tf-lq-table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}
.tf-lq-table{
  min-width: 520px;
}
.tf-lq-table td, .tf-lq-table th{
  vertical-align: middle;
}
.tf-lq-table td.tf-lq-actions,
.tf-lq-table th.tf-lq-actions{
  white-space: nowrap;
}
@media (max-width: 600px){
  .tf-lq-table{
    min-width: 560px;
  }
  .tf-lq-btn{
    padding: 8px 12px;
    font-size: 14px;
  }
}


/* Mobile: Host live UI spacing improvements */
@media (max-width: 600px){
  .tf-lq-host-header{
    flex-wrap: wrap;
  }
  .tf-lq-host-header .tf-lq-spacer{
    flex-basis: 100%;
    height: 0;
  }
  #tf-lq-host-timer{
    margin-left: 0 !important;
    order: 3;
  }
  #tf-lq-host-status{
    order: 2;
    width: auto;
  }
  .tf-lq-row{
    gap: 10px;
  }
  .tf-lq-panel{
    padding: 14px;
  }
  .tf-lq-scorepill{
    padding: 8px 10px;
    font-size: 14px;
  }
  .tf-lq-btn{
    padding: 10px 12px;
    font-size: 14px;
  }
  .tf-lq-huge{
    font-size: 46px;
    letter-spacing: 4px;
  }
}


/* Mobile: keep Quiz Dashboard table within panel (no overflow off-screen) */
@media (max-width: 600px){
  .tf-lq-table-wrap{
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
  }
  .tf-lq-table{
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }
  .tf-lq-table th, .tf-lq-table td{
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Column sizing */
  .tf-lq-table th:nth-child(1), .tf-lq-table td:nth-child(1){ width: 55%; }
  .tf-lq-table th:nth-child(2), .tf-lq-table td:nth-child(2){ width: 20%; text-align:center; }
  .tf-lq-table th:nth-child(3), .tf-lq-table td:nth-child(3){ width: 25%; }
  .tf-lq-table td.tf-lq-actions{ text-align: right; }
}


/* Mobile card layout for quiz list (div-table) */
@media (max-width: 700px){
  /* hide header row */
  .tf-lq-table .tf-lq-th{ display:none; }

  /* each row becomes a card */
  .tf-lq-table .tf-lq-tr{
    display:block;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255,255,255,0.03);
    margin-top: 12px;
  }

  /* stack cells */
  .tf-lq-table .tf-lq-tr > div{
    display:block;
    width:100%;
  }

  /* Title */
  .tf-lq-table .tf-lq-tr > div:nth-child(1){
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 8px;
  }

  /* Questions count */
  .tf-lq-table .tf-lq-tr > div:nth-child(2){
    color: rgba(255,255,255,0.75);
    margin-bottom: 12px;
  }
  .tf-lq-table .tf-lq-tr > div:nth-child(2)::before{
    content: "Questions: ";
    color: rgba(255,255,255,0.55);
  }

  /* Actions */
  .tf-lq-table .tf-lq-tr > div:nth-child(3){
    display:flex;
    gap: 10px;
  }
  .tf-lq-table .tf-lq-tr > div:nth-child(3) .tf-lq-btn{
    width:100%;
    text-align:center;
  }
}
