/* ===== MİQ TEST PLATFORM – UNIFIED STYLE ===== */
/* © 2026 TAİM. Bütün hüquqlar qorunur. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Disable text selection globally */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #f4f6f9;
  color: #333;
  min-height: 100vh;
}

/* ── LANG SWITCH ─────────────────────────────────── */
.lang-switch {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
  background: #fff;
  border-radius: 25px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  display: flex;
  gap: 3px;
}
.lang-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #555;
  transition: background .2s, color .2s;
}
.lang-btn.active { background: #2a5298; color: #fff; }
.lang-btn:hover:not(.active) { background: #e9ecef; }

/* ── HEADER ─────────────────────────────────────── */
.miq-header {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #fff;
  padding: 18px 20px 18px 20px;
  text-align: center;
}
.miq-header h1 { font-size: 22px; margin-bottom: 4px; }
.miq-header p  { font-size: 14px; opacity: .9; }

/* ── CONTAINER ──────────────────────────────────── */
.container {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 15px 40px;
}

/* ── BACK LINK ──────────────────────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: #2a5298;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* ── INFO PANEL ─────────────────────────────────── */
.info-panel {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
}
.info-item { text-align: center; }
.info-item .label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.info-item .value { font-size: 20px; font-weight: 700; color: #2a5298; }

/* ── START SCREEN ───────────────────────────────── */
.start-screen {
  text-align: center;
  background: #fff;
  padding: 40px 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  margin-bottom: 18px;
}
.start-screen h2 { color: #2a5298; margin-bottom: 14px; font-size: 22px; }
.start-screen p  { margin: 7px 0; color: #555; font-size: 15px; }

/* ── BUTTONS ────────────────────────────────────── */
.btn {
  background: #2a5298;
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 8px 4px;
  transition: background .2s, transform .15s;
}
.btn:hover   { background: #1e3c72; transform: translateY(-1px); }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #545b62; }
.btn-success   { background: #28a745; }
.btn-success:hover { background: #218838; }
.btn-danger    { background: #dc3545; }
.btn-danger:hover { background: #c82333; }
.hidden { display: none !important; }

/* ── QUIZ AREA ──────────────────────────────────── */
.quiz-area {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  margin-bottom: 18px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 2px solid #e9ecef;
  flex-wrap: wrap;
  gap: 8px;
}
.question-number {
  font-size: 17px;
  font-weight: 700;
  color: #2a5298;
}
.timer {
  font-size: 17px;
  font-weight: 700;
  color: #dc3545;
  background: #fff3cd;
  padding: 6px 14px;
  border-radius: 20px;
  min-width: 80px;
  text-align: center;
}
.timer.urgent { background: #f8d7da; color: #721c24; animation: pulse .8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ── SUBJECT TAG ────────────────────────────────── */
.subject-tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  background: rgba(42,82,152,.12);
  color: #2a5298;
}

/* ── QUESTION TEXT ──────────────────────────────── */
.question-text {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 18px;
  padding: 13px 15px;
  background: #f8f9fa;
  border-left: 4px solid #2a5298;
  border-radius: 5px;
  white-space: pre-wrap;
}

/* ── OPTIONS ────────────────────────────────────── */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  padding: 13px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.option:hover   { border-color: #2a5298; background: #f0f4ff; }
.option.selected{ border-color: #2a5298; background: #e8eaf6; }
.option.correct { border-color: #28a745; background: #d4edda; }
.option.wrong   { border-color: #dc3545; background: #f8d7da; }
.option-letter {
  background: #2a5298;
  color: #fff;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.option.correct .option-letter { background: #28a745; }
.option.wrong   .option-letter { background: #dc3545; }
.option-text { flex: 1; line-height: 1.5; font-size: 14px; }

/* ── PROGRESS ───────────────────────────────────── */
.progress {
  margin: 18px 0 10px;
  background: #e9ecef;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  background: linear-gradient(90deg, #2a5298, #1e3c72);
  height: 100%;
  transition: width .4s;
}

/* ── NAV BUTTONS ────────────────────────────────── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── QUESTION NAV GRID ──────────────────────────── */
.question-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}
.q-nav-btn {
  padding: 8px 4px;
  border: 2px solid #e9ecef;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all .2s;
  text-align: center;
}
.q-nav-btn:hover  { border-color: #2a5298; background: #f0f4ff; }
.q-nav-btn.answered { background: #2a5298; color: #fff; border-color: #2a5298; }
.q-nav-btn.current  { border-color: #ffc107; box-shadow: 0 0 0 2px rgba(255,193,7,.35); }
.q-nav-btn.answered.current { background: #1e3c72; }

/* ── EXPLANATION ────────────────────────────────── */
.explanation {
  margin-top: 14px;
  padding: 13px 15px;
  background: #e8f4f8;
  border-left: 4px solid #17a2b8;
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.6;
  color: #0c5460;
}

/* ── PASS BADGE ─────────────────────────────────── */
.pass-badge {
  font-size: 20px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 10px;
  margin: 12px auto;
  text-align: center;
  max-width: 320px;
}

/* ── RESULT SCREEN ──────────────────────────────── */
.result-screen {
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  text-align: center;
}
.result-screen h2 { color: #2a5298; font-size: 24px; margin-bottom: 10px; }
.score {
  font-size: 52px;
  font-weight: 700;
  color: #2a5298;
  margin: 16px 0 4px;
}
.score-label { font-size: 15px; color: #666; margin-bottom: 18px; }

.stats-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.stat-item { text-align: center; min-width: 70px; }
.stat-item span {
  display: block;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 3px;
}
.stat-item small { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: .4px; }
.stat-correct { color: #28a745; }
.stat-wrong   { color: #dc3545; }
.stat-empty   { color: #6c757d; }
.stat-percent { color: #2a5298; }

#resultDetails {
  margin: 10px 0 20px;
  text-align: left;
  max-height: 280px;
  overflow-y: auto;
}

/* ── TABLE SUPPORT ──────────────────────────────── */
.question-text table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}
.question-text th {
  background: rgba(42,82,152,.12);
  color: #2a5298;
  padding: 8px;
  text-align: left;
  border: 1px solid #dee2e6;
  font-weight: 700;
}
.question-text td {
  padding: 7px 8px;
  border: 1px solid #dee2e6;
  vertical-align: top;
  line-height: 1.5;
}

/* ── NAME INPUT ─────────────────────────────────── */
.name-input {
  display: block;
  width: 100%;
  max-width: 380px;
  margin: 14px auto 16px;
  padding: 11px 16px;
  border: 2px solid #dee2e6;
  border-radius: 25px;
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color .2s;
  user-select: text;
  -webkit-user-select: text;
}
.name-input:focus { border-color: #2a5298; }

/* ── RESULT BTNS ────────────────────────────────── */
.result-btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ── MOBILE ─────────────────────────────────────── */
@media (max-width: 600px) {
  .miq-header h1 { font-size: 17px; }
  .miq-header p  { font-size: 12px; }
  .info-panel { flex-direction: column; align-items: center; gap: 8px; }
  .question-text { font-size: 13px; padding: 10px 12px; }
  .option-text   { font-size: 13px; }
  .score { font-size: 40px; }
  .question-nav  { grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); }
  .nav-buttons   { flex-direction: column; }
  .nav-buttons .btn { width: 100%; }
  .start-screen  { padding: 24px 16px; }
  table { font-size: 11px; display: block; overflow-x: auto; }
}
