/* ═══════════════════════════════════════════════════
   Student Practice Mode — Responsive Design
═══════════════════════════════════════════════════ */

/* ── Waiting screen: full viewport, centered ── */
.waiting-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  padding: 16px;
  gap: 12px;
  box-sizing: border-box;
}

/* ── "Waiting for teacher" pill ── */
.ws-waiting-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.82rem;
  color: #94a3b8;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
  animation: ws-pulse 1.5s ease-in-out infinite;
}

@keyframes ws-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0);
  }
}

/* ══════════════════════════════════════════════════
   Setup Panel — DESKTOP (default)
══════════════════════════════════════════════════ */
.student-setup-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 16, 35, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  padding: 24px 28px;
  width: 100%;
  max-width: 960px;
  max-height: calc(100vh - 80px); /* leave room for pill + gaps */
  box-sizing: border-box;
  box-shadow:
    0 0 80px rgba(99, 102, 241, 0.15),
    0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  flex-shrink: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Panel Header ── */
.ssp-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  flex-shrink: 0;
}

.ssp-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.55));
}

.ssp-title {
  font-family: "Exo 2", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.4px;
}

.ssp-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 3px;
}

/* ── Question Type Toggle ── */
.ssp-type-toggle {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.ssp-radio-label {
  flex: 1;
  cursor: pointer;
}
.ssp-radio-label input[type="radio"] {
  display: none;
}

.ssp-radio-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.07);
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.ssp-radio-label input[type="radio"]:checked + .ssp-radio-box {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

/* ── Two-column Form Grid ── */
.ssp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  overflow-y: auto;
  flex-shrink: 1;
  min-height: 0;
  padding-right: 2px;
}

.ssp-grid::-webkit-scrollbar {
  width: 4px;
}
.ssp-grid::-webkit-scrollbar-track {
  background: transparent;
}
.ssp-grid::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 4px;
}

/* ── Individual Field ── */
.ssp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ssp-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ssp-field-icon {
  font-size: 0.78rem;
}

/* ── Form controls ── */
.student-form-control {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: white;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
}

.student-form-control:focus {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

select.student-form-control option {
  background-color: #1e293b;
  color: #ffffff;
}

/* ── Checkbox row ── */
.ssp-checks {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ssp-check-label {
  cursor: pointer;
  flex: 1;
  min-width: 90px;
}
.ssp-checkbox {
  display: none;
}

.ssp-check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.ssp-checkbox:checked + .ssp-check-box {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* ── Start Button ── */
.student-btn {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white;
  border: none;
  border-radius: 11px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.student-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

/* ══════════════════════════════════════════════════
   Student MCQ Interactive Styles
══════════════════════════════════════════════════ */
.student-interactive .mcq-option {
  cursor: pointer;
}
.student-interactive .mcq-option:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
}
.student-interactive .mcq-option.selected {
  background: rgba(99, 102, 241, 0.3);
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* ══════════════════════════════════════════════════
   CQ Answer Block
══════════════════════════════════════════════════ */
.cq-answer {
  color: #10b981;
  font-size: 0.9em;
  margin-top: 4px;
  padding-left: 20px;
}
.cq-ans-label {
  font-weight: bold;
  color: #10b981;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — Tablet 640–900px: still 2-col, tighter
══════════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 900px) {
  .student-setup-view {
    padding: 18px 20px;
    gap: 10px;
  }
  .student-form-control {
    height: 35px;
    font-size: 0.85rem;
  }
  .ssp-radio-box {
    font-size: 0.85rem;
    padding: 8px 10px;
  }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — Mobile ≤ 640px: single col, page scroll
══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  html,
  body {
    overflow-y: auto !important;
  }

  /* Full height, centred, but allow scroll if content overflows */
  .waiting-screen {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    justify-content: center;
    align-items: stretch;
    padding: 12px 0px 16px;
    gap: 10px;
    width: 100%;
  }

  .ws-waiting-pill {
    align-self: center;
    font-size: 0.72rem;
    padding: 5px 14px;
  }

  .student-setup-view {
    max-width: 100%;
    max-height: none; /* no cap on mobile — page scrolls */
    overflow: visible;
    padding: 16px 14px;
    border-radius: 16px;
    gap: 10px;
    flex-shrink: unset;
  }

  /* Single column */
  .ssp-grid {
    grid-template-columns: 1fr;
    overflow-y: visible;
    gap: 8px;
  }

  .ssp-checks {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .ssp-check-label {
    flex: 1 1 calc(50% - 4px);
    min-width: 80px;
  }

  .ssp-icon {
    font-size: 1.6rem;
  }
  .ssp-title {
    font-size: 1.05rem;
  }
  .ssp-subtitle {
    font-size: 0.68rem;
  }

  .ssp-radio-box {
    font-size: 0.82rem;
    padding: 8px;
  }

  .student-form-control {
    height: 40px; /* slightly taller on mobile for easier tap */
    font-size: 0.9rem;
  }

  .student-btn {
    padding: 13px;
    font-size: 0.95rem;
  }

  .mcq-q-text {
    font-size: 1.2rem;
  }
  .mcq-option {
    font-size: 1rem;
    padding: 12px;
  }
  .mcq-options-grid {
    grid-template-columns: 1fr;
  }
}
