/* ============================================
   Mon TOEIC Recorder UI v4.3 – eStudy Style
   ============================================ */

/* --- Prep Phase --- */
.prep-ui {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.prep-bubble {
  background: #eaf2ff;
  color: #2a66ff;
  font-size: 15px;
  font-weight: 500;
  border-radius: 30px;
  padding: 5px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
}
.prep-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #eaf2ff transparent transparent transparent;
}
.prep-box {
  background: linear-gradient(180deg, #fff 0%, #f6f8ff 100%);
  border: 1px solid rgba(180, 180, 180, 0.2);
  border-radius: 50px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.on-hold {
  font-size: 10px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}
.on-hold .dot {
  width: 10px;
  height: 10px;
  background: #ccc;
  border-radius: 50%;
}
#mic-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3d84ff 0%, #2a69f7 100%);
  color: #fff;
  font-size: 15px;
  border: none;
  cursor: default;
  box-shadow: 0 4px 12px rgba(45, 118, 255, 0.25);
  transition: 0.3s;
}
#toeic-controls .prep-box .skip-btn {
  background: linear-gradient(180deg, #4c9fff 0%, #2979ff 100%);
  color: #fff;
  border-radius: 30px;
  padding: 10px 20px;
  border: none;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.25);
  cursor: pointer;
  transition: 0.25s;
  font-size: 10px !important;
}
#toeic-controls .prep-box .skip-btn:hover {
  background: linear-gradient(180deg, #5bb1ff 0%, #358aff 100%);
}

/* --- Recording Phase --- */
.record-ui {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.record-tooltip {
  background: #eaf2ff;
  color: #2a66ff;
  font-size: 15px;
  font-weight: 500;
  border-radius: 30px;
  padding: 5px 14px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.record-tooltip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #eaf2ff transparent transparent transparent;
}
.record-box {
  background: linear-gradient(180deg, #fff 0%, #f6f8ff 100%);
  border: 1px solid rgba(180, 180, 180, 0.2);
  border-radius: 50px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.record-left,
.record-right {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}
.record-right span {
  color: #2a66ff;
  font-weight: 600;
}
.record-dot {
  width: 10px;
  height: 10px;
  background: #ff4d4f;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
#record-tooltip .record-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4c9fff 0%, #2979ff 100%);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.25);
  transition: 0.25s;
}
#record-tooltip .record-btn:hover {
  background: linear-gradient(180deg, #5bb1ff 0%, #358aff 100%);
}
#record-tooltip .record-btn.recording {
  background: linear-gradient(180deg, #ff4d4f 0%, #ff6f61 100%);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25);
}

/* === EXAM TIMER (Trên cùng khung bài) === */
#toeic-timer-bar {
  position: absolute;
  top: 10px;
  left: 92%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 4px 12px;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
  color: #444;
  font-size: 16px;
  display: none; /* 🛠 mặc định ẩn */
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  z-index: 20;
  min-width: 120px;
  transition: all 0.25s ease;
}
#toeic-timer-bar.recording {
  border-color: #ff4d4f;
  background: #fff5f5;
  color: #c30000;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.25);
}
#toeic-timer-icon {
  font-size: 18px;
  color: #666;
  transition: 0.25s;
}
#toeic-timer-bar.recording #toeic-timer-icon {
  color: #ff3333;
}

/* === CONTROLS AREA (Bottom of frame) === */
#toeic-controls {
 /* position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%); */
  display: none; /* 🛠 JS sẽ bật */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 999;
  min-width: 500px;
}

/* === After Record === */
#after-record {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid rgba(180, 180, 180, 0.2);
  border-radius: 50px;
  padding: 10px 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  min-width: 300px;
  transition: 0.3s ease;
}

#btn-retry, #btn-listen, #btn-next {
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 10px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition: 0.25s ease;
}
#btn-retry {
  background: #f3f4f7;
  color: #333;
}
#btn-retry:hover { background: #e5e6ea; }
#btn-listen {
  background: linear-gradient(180deg, #4c9fff 0%, #2979ff 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(41, 121, 255, 0.25);
}
#btn-listen:hover {
  background: linear-gradient(180deg, #5bb1ff 0%, #358aff 100%);
}
#btn-next {
  background: linear-gradient(180deg, #3dbb68 0%, #1ea854 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(30, 168, 84, 0.25);
}
#btn-next:hover {
  background: linear-gradient(180deg, #4bd97a 0%, #27b965 100%);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  #toeic-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
  }
  #toeic-timer-bar {
  position: absolute;
  top: 20px;
  left: 80%;
  }
}