/* placement-test.css - Giao diện Zen Mode & Gamification */

.placement-zen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #121212 !important;
  background: linear-gradient(135deg, #0d0d12 0%, #1a1a24 100%) !important;
  z-index: 999999;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
  font-family: "Quicksand", sans-serif;
  color: #f5f5f5 !important;
  animation: fadeIn 0.3s ease-out forwards;
}

.placement-zen-overlay * {
  box-sizing: border-box;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Header & Progress Bar */
.pt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.2);
}

.pt-close-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.pt-close-btn:hover {
  color: var(--primary-red, #d32f2f);
}

.pt-audio-btn {
  background: none;
  border: none;
  color: var(--accent-gold, #ffd700);
  font-size: 1.3rem;
  cursor: pointer;
}

.pt-progress-container {
  flex-grow: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 0 20px;
  overflow: hidden;
}

.pt-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold, #ffd700), #ff9800);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content Area */
.pt-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 100px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow-y: hidden;
}

.pt-question-box {
  width: 100%;
  text-align: center;
  animation: slideInRight 0.4s ease forwards;
}

.pt-question-text {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 30px;
  color: #ffffff !important;
}

/* Options Grid */
#pt-options-container {
  display: grid !important;
  grid-template-columns: 1fr; /* Default 1 cột */
  gap: 15px;
  width: 100%;
}

/* KHI CÓ CLASS has-images LÀ PHẢI 2 CỘT */
#pt-options-container.has-images {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px !important;
}

.pt-option-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 12px !important;
  padding: 15px !important;
  color: #ffffff !important;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Nút Bỏ qua */
.pt-skip-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.95rem;
  padding: 8px 15px;
  cursor: pointer;
  transition: color 0.2s ease;
  text-decoration: underline;
}
.pt-skip-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.pt-option-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-2px);
}

.pt-option-btn img {
  width: 100px !important;
  height: 100px !important;
  border-radius: 12px !important;
  margin-bottom: 5px !important;
  object-fit: cover !important;
}

/* Nút Audio TTS */
.pt-tts-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  margin-left: 8px;
  cursor: pointer;
  transition: color 0.2s;
}
.pt-tts-btn:hover {
  color: var(--accent-gold, #ffd700);
  transform: scale(1.1);
}

/* Image Skeleton (Shimmer) */
.img-skeleton {
  background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pt-branch-chooser p {
  color: #bbbbbb !important;
}
.pt-branch-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 2px solid #d32f2f !important;
  color: #ffffff !important;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1rem;
  margin: 10px;
  cursor: pointer;
  transition: all 0.2s;
  width: 80%;
  max-width: 300px;
}
.pt-branch-btn:hover {
  background: #d32f2f !important;
  transform: scale(1.05);
}

/* Feedback Animations */
.shake-error {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #f44336 !important;
  background: rgba(244, 67, 54, 0.1) !important;
  color: #f44336;
}

.glow-success {
  border-color: #4caf50 !important;
  background: rgba(76, 175, 80, 0.1) !important;
  color: #4caf50;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-50px); }
}
.slide-out {
  animation: slideOutLeft 0.3s ease forwards;
}

/* Result Box */
.pt-result-box {
  text-align: center;
  animation: fadeIn 0.5s ease;
}
.pt-result-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
  animation: pt-pulse-light 2s infinite;
}
@keyframes pt-pulse-light {
  0% { transform: scale(0.95); box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 35px rgba(212, 175, 55, 0.8); }
  100% { transform: scale(0.95); box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
}
.pt-result-title {
  color: var(--accent-gold, #ffd700);
  font-size: 2.2rem;
  margin-bottom: 10px;
}
.pt-result-desc {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 30px;
}
.pt-redirect-btn {
  background: linear-gradient(45deg, #FF512F, #DD2476);
  border: none;
  padding: 15px 40px;
  border-radius: 25px;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(221, 36, 118, 0.4);
  transition: transform 0.2s;
}
.pt-redirect-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(221, 36, 118, 0.6);
}

@media (max-width: 600px) {
  .pt-question-text { font-size: clamp(1rem, 4vw, 1.4rem); margin-bottom: 15px; }
  #pt-options-container.has-images { gap: 10px !important; }
  .pt-option-btn { padding: 10px !important; font-size: 1rem; }
  .pt-option-btn img { width: 80px !important; height: 80px !important; }
  .pt-char-display { font-size: 3.5rem !important; }
  .pt-score-countup { font-size: 3rem !important; }
}

/* ================================================== */
/* EXPLANATION PANEL (Hiển thị sau mỗi câu trả lời)  */
/* ================================================== */
.pt-explain-panel {
  margin-top: 25px;
  padding: 14px 18px;
  border-radius: 12px;
  text-align: left;
  animation: slideInRight 0.35s ease forwards;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.pt-explain-correct {
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.5);
  box-shadow: 0 0 18px rgba(76, 175, 80, 0.15);
}
.pt-explain-wrong {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.5);
  box-shadow: 0 0 18px rgba(244, 67, 54, 0.15);
}
.pt-explain-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.pt-explain-icon {
  font-size: 1.6rem;
}
.pt-explain-correct .pt-explain-icon { color: #4caf50; }
.pt-explain-wrong .pt-explain-icon { color: #f44336; }
.pt-explain-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}
.pt-explain-correct .pt-explain-title { color: #4caf50; }
.pt-explain-wrong .pt-explain-title { color: #f44336; }
.pt-explain-text {
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.55;
}

/* Wrapper nút Next — căn giữa, nằm dưới explanation panel */
.pt-next-btn-wrap {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
}

/* Slot chứa explanation + nút next — phải full width */
#pt-explain-slot {
  display: block;
  width: 100%;
}

/* Nút "Câu tiếp theo →" (vàng gradient) */
.pt-next-btn {
  background: linear-gradient(45deg, #ff9800, #ffd700);
  color: #1a1a24;
  border: none;
  padding: 12px 36px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.4);
  transition: transform 0.18s, box-shadow 0.18s;
  letter-spacing: 0.3px;
}
.pt-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 193, 7, 0.6);
}

/* ================================================== */
/* DẠNG CHAR_MEANING (chữ Hán lớn + pinyin)          */
/* ================================================== */
.pt-char-display {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 6px;
  text-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
  line-height: 1;
  margin-bottom: 8px;
}
.pt-char-pinyin {
  font-style: italic;
  color: var(--accent-gold, #ffd700);
  font-size: 1.3rem;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ================================================== */
/* RESULT: COUNT-UP SCORE + TITLE GLOW                */
/* ================================================== */
.pt-score-countup {
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent-gold, #ffd700);
  line-height: 1;
  margin: 10px 0 6px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  letter-spacing: 2px;
}
.pt-score-countup .pt-score-total {
  font-size: 1.8rem;
  color: #bbb;
  font-weight: 600;
  margin-left: 6px;
  text-shadow: none;
  letter-spacing: 0;
}
.pt-score-caption {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 18px;
  font-style: italic;
}
.pt-result-title-glow {
  animation: pt-title-glow 1.8s ease-in-out infinite alternate;
}
@keyframes pt-title-glow {
  from {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.2);
    transform: scale(1);
  }
  to {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.85), 0 0 40px rgba(255, 215, 0, 0.4);
    transform: scale(1.03);
  }
}
