/* =============================================
   screens.css — per-screen styles
   iOS 26 Liquid Glass edition
   ============================================= */

/* ========== HOME SCREEN ========== */
#screen-home .scroll-area { padding: 0 20px; }

.home-header {
  padding: 24px 0 32px;
  text-align: center;
  position: relative;
}

/* Globe logo with continuous spin + pulse glow */
.home-logo {
  font-size: 68px;
  display: block;
  margin-bottom: 14px;
  animation: globeSpin 18s linear infinite, logoPulse 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(124,108,255,0.6));
  will-change: transform;
  transform-origin: center;
}
@keyframes globeSpin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 22px rgba(124,108,255,0.55)); }
  50%     { filter: drop-shadow(0 0 40px rgba(198,110,255,0.75)) drop-shadow(0 0 60px rgba(124,108,255,0.3)); }
}

.home-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, #d4aaff 40%, #a855f7 80%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: titleShimmer 6s ease-in-out infinite;
}
@keyframes titleShimmer {
  0%,100% { background-position: 0% 50%;   }
  50%     { background-position: 100% 50%; }
}

.home-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 7px;
  letter-spacing: 0.1px;
  animation: slideDown 0.6s var(--spring-bounce) 0.3s both;
}

/* Quiz list */
.quiz-list { display: flex; flex-direction: column; gap: 10px; }

.quiz-card {
  border-radius: var(--radius-md);
  padding: 17px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: transform 0.22s var(--spring-bounce),
              box-shadow 0.22s ease,
              background  0.22s ease;
  position: relative;
  overflow: hidden;
}
.quiz-card:active { transform: scale(0.97); }
/* Progress tint stripe along the left edge */
.quiz-card-progress-stripe {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--accent1), var(--accent2));
  opacity: 0.7;
}
.quiz-card-info { flex: 1; min-width: 0; }
.quiz-card-name {
  font-size: 16px; font-weight: 600; letter-spacing: -0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quiz-card-meta { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
/* Mini mastery bar inside card */
.quiz-card-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}
.quiz-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transition: width 0.6s var(--spring-smooth);
}
.quiz-card-chevron { color: var(--text-tertiary); font-size: 18px; flex-shrink: 0; }

/* Create Quiz action button */
.action-btn {
  border-radius: var(--radius-md);
  padding: 18px 16px;
  border: none;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  transition: transform 0.2s var(--spring-bounce), box-shadow 0.2s ease;
  position: relative; overflow: hidden; text-align: left;
}
.action-btn:active { transform: scale(0.96); }
.action-btn-icon  { font-size: 28px; }
.action-btn-label { font-size: 15px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.2px; }
.action-btn-sub   { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.3; }

/* ========== EDIT QUIZ SCREEN ========== */
#screen-edit .scroll-area { padding: 0 20px; }

.input-group { margin-bottom: 14px; }
.input-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: 8px; display: block;
}

/* Question items */
.questions-list { display: flex; flex-direction: column; gap: 10px; }

.question-item {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  transition: transform 0.18s var(--spring-bounce), opacity 0.18s ease;
}
.question-item:active { transform: scale(0.98); }
.question-item-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.question-item-num {
  width: 24px; height: 24px; border-radius: 8px;
  background: rgba(124,108,255,0.2); border: 1px solid rgba(124,108,255,0.32);
  font-size: 12px; font-weight: 700; color: var(--accent1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.question-item-text {
  font-size: 14px; font-weight: 500; flex: 1; color: var(--text-primary);
  -webkit-user-select: text; user-select: text;
}
.question-delete {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,94,126,0.14); border: 1px solid rgba(255,94,126,0.22);
  color: var(--accent-danger); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.18s var(--spring-bounce);
}
.question-delete:active { background: rgba(255,94,126,0.28); }

.question-edit-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(124,108,255,0.14); border: 1px solid rgba(124,108,255,0.22);
  color: var(--accent1); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.18s var(--spring-bounce); margin-right: 4px;
}
.question-edit-btn:active { background: rgba(124,108,255,0.28); }


.answer-tag {
  display: inline-block; font-size: 12px;
  padding: 3px 8px; border-radius: 6px; margin: 2px 3px 2px 0;
}
.answer-correct { background: rgba(95,255,176,0.13); border: 1px solid rgba(95,255,176,0.24); color: var(--accent3); }
.answer-wrong   { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); color: var(--text-secondary); }

.btn-add-question {
  width: 100%; padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px dashed rgba(124,108,255,0.38);
  background: rgba(124,108,255,0.06);
  color: var(--accent1);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--spring-bounce);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-add-question:active { background: rgba(124,108,255,0.13); transform: scale(0.98); }

.save-bar {
  padding: 16px 20px calc(var(--safe-bottom) + 16px);
  flex-shrink: 0;
}
.btn-save {
  width: 100%; padding: 17px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, var(--accent3) 0%, #3dcc8a 100%);
  color: #06200f; font-size: 16px; font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(95,255,176,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.22s var(--spring-bounce);
  letter-spacing: -0.2px;
}
.btn-save:active { transform: scale(0.97); }

/* ========== SELECT QUIZ SCREEN ========== */
.quiz-select-list { display: flex; flex-direction: column; gap: 10px; }

.quiz-select-item {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: transform 0.22s var(--spring-bounce), background 0.22s ease, border-color 0.22s ease;
}
.quiz-select-item:active { transform: scale(0.97); }
.quiz-select-item.selected {
  border-color: rgba(124,108,255,0.55) !important;
  background: rgba(124,108,255,0.14) !important;
  box-shadow: 0 0 0 1px rgba(124,108,255,0.25), 0 8px 24px rgba(124,108,255,0.15) !important;
}
.quiz-select-item.selected .quiz-select-dot { background: var(--accent1); }

.quiz-select-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  transition: all 0.25s var(--spring-bounce);
}

/* ========== QUIZ SCREEN ========== */
#screen-quiz { background: transparent; }

.quiz-header {
  padding: 8px 20px 16px;
  flex-shrink: 0;
  position: relative;
}
.quiz-header::after {
  content: '';
  position: absolute; bottom: 0; left: 20px; right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.quiz-stats { display: flex; gap: 10px; margin-bottom: 14px; }

.stat-pill {
  border-radius: 20px; padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
  letter-spacing: -0.2px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s var(--spring-bounce);
}
.stat-timer {
  background: rgba(255,184,94,0.14); border: 1px solid rgba(255,184,94,0.26);
  color: var(--accent-warm);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  min-width: 76px;
}
/* Timer urgency pulse when <10s remaining in future */
.stat-timer.urgent {
  background: rgba(255,94,126,0.18); border-color: rgba(255,94,126,0.35);
  color: var(--accent-danger);
  animation: timerUrgent 1s ease-in-out infinite;
}
@keyframes timerUrgent {
  0%,100% { box-shadow: none; }
  50%     { box-shadow: 0 0 12px rgba(255,94,126,0.4); }
}

.stat-progress-pill {
  background: rgba(124,108,255,0.12); border: 1px solid rgba(124,108,255,0.24);
  color: var(--accent1); flex: 1;
  transition: all 0.4s var(--spring-bounce);
}
/* Pill grows when a question is mastered */
.stat-progress-pill.celebrate {
  background: rgba(95,255,176,0.18) !important;
  border-color: rgba(95,255,176,0.4) !important;
  color: var(--accent3) !important;
  transform: scale(1.06);
}

/* Progress track */
.progress-track {
  height: 5px; background: rgba(255,255,255,0.07);
  border-radius: 3px; overflow: visible; position: relative;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transition: width 0.55s var(--spring-smooth);
  box-shadow: 0 0 12px rgba(124,108,255,0.5);
  position: relative;
}
/* Glowing tip dot */
.progress-fill::after {
  content: '';
  position: absolute; right: -3px; top: 50%;
  transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: white;
  box-shadow: 0 0 8px rgba(124,108,255,0.8), 0 0 16px rgba(124,108,255,0.4);
  transition: opacity 0.3s ease;
}
/* Hide the dot when at 0% or 100% */
.progress-fill[style*="width: 0"]::after,
.progress-fill[style*="width:0"]::after { opacity: 0; }

/* Question zone */
.question-zone {
  flex: 1; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-bottom) + 24px);
}
.question-card {
  border-radius: var(--radius-lg); padding: 26px 22px;
  position: relative; overflow: hidden; flex-shrink: 0;
}
/* Animated gradient border — iOS 26 "live" material feel */
.question-card::before {
  content: '';
  position: absolute; inset: -2px; border-radius: calc(var(--radius-lg) + 2px);
  background: conic-gradient(
    from var(--angle, 0deg),
    rgba(124,108,255,0.6) 0%, rgba(198,110,255,0.4) 25%,
    rgba(95,255,176,0.2) 50%, rgba(124,108,255,0.6) 100%
  );
  z-index: -1;
  animation: borderRotate 4s linear infinite;
  opacity: 0.6;
}
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes borderRotate { to { --angle: 360deg; } }

.question-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(124,108,255,0.16); border: 1px solid rgba(124,108,255,0.28);
  border-radius: 20px; padding: 5px 12px;
  font-size: 11px; font-weight: 700; color: var(--accent1);
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 14px;
}
.question-text {
  font-family: var(--font-display);
  font-size: 23px; font-weight: 700; line-height: 1.3; letter-spacing: -0.5px;
}

/* Mastery dots — now with spring animation */
.mastery-dots { display: flex; gap: 6px; margin-top: 18px; }
.mastery-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  transition: all 0.35s var(--spring-bounce);
}
.mastery-dot.filled {
  background: var(--accent3); border-color: var(--accent3);
  box-shadow: 0 0 8px rgba(95,255,176,0.5);
  transform: scale(1.15);
}
/* Newly-filled dot: burst animation */
.mastery-dot.just-filled {
  animation: dotBurst 0.5s var(--spring-bounce);
}
@keyframes dotBurst {
  0%  { transform: scale(1); }
  40% { transform: scale(1.7); box-shadow: 0 0 16px rgba(95,255,176,0.7); }
  100%{ transform: scale(1.15); }
}

/* Answer options */
.answers-grid { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

.answer-option {
  border-radius: var(--radius-md); padding: 17px 18px;
  cursor: pointer;
  transition: transform 0.2s var(--spring-bounce), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex; align-items: center; gap: 14px;
  position: relative; overflow: hidden;
  will-change: transform;
}
.answer-option::after { border-radius: var(--radius-md); }
/* Hover lift */
.answer-option:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10) !important;
  border-color: rgba(255,255,255,0.25) !important;
}
.answer-option:active { transform: scale(0.97); }

.answer-option.correct-anim {
  background: rgba(95,255,176,0.18) !important;
  border-color: rgba(95,255,176,0.42) !important;
  box-shadow: 0 0 24px rgba(95,255,176,0.22), inset 0 1px 0 rgba(95,255,176,0.22) !important;
  animation: correctPulse 0.45s var(--spring-bounce);
}
.answer-option.wrong-anim {
  background: rgba(255,94,126,0.18) !important;
  border-color: rgba(255,94,126,0.42) !important;
  animation: wrongShake 0.42s ease;
}
@keyframes correctPulse {
  0%  { transform: scale(1);    }
  45% { transform: scale(1.03); }
  100%{ transform: scale(1);    }
}
@keyframes wrongShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-7px); }
  40%     { transform: translateX(7px);  }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px);  }
}

.answer-letter {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.2s ease;
}
.answer-option.correct-anim .answer-letter { background: rgba(95,255,176,0.25); color: var(--accent3); }
.answer-option.wrong-anim   .answer-letter { background: rgba(255,94,126,0.25); color: var(--accent-danger); }

.answer-text { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; flex: 1; }

/* ========== RESULTS SCREEN ========== */
#screen-results .scroll-area { padding: 0 20px; }

.results-hero { text-align: center; padding: 32px 20px; }
.results-emoji {
  font-size: 76px; display: block; margin-bottom: 16px;
  animation: resultsBounce 0.7s var(--spring-bounce);
}
@keyframes resultsBounce {
  0%  { transform: scale(0.2) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(4deg);  }
  100%{ transform: scale(1)    rotate(0deg);  opacity: 1; }
}

.results-title {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, var(--accent1) 55%, var(--accent2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.results-sub { color: var(--text-secondary); font-size: 15px; margin-top: 6px; }

.stats-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
.stat-card {
  border-radius: var(--radius-md); padding: 18px 16px; text-align: center;
  animation: popIn 0.5s var(--spring-bounce) both;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.12s; }
.stat-card:nth-child(3) { animation-delay: 0.19s; }
.stat-card:nth-child(4) { animation-delay: 0.26s; }

.stat-card-value {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 800; letter-spacing: -0.5px;
}
.stat-card-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
