/* ==============================================================================
   TỔNG HỘI Y HỌC CỔ TRUYỀN VIỆT MINH - MODULE NGÂN HÀNG THI SÁT HẠCH CCHN YHCT
   Phiên bản: v3.7.0
   Design: East Asian Holographic Medical Theme (Hiện đại - Chuẩn Y Khoa - Tối Ưu)
   ============================================================================== */

:root {
  --yhct-primary: #059669;
  --yhct-primary-hover: #047857;
  --yhct-primary-light: #ecfdf5;
  --yhct-primary-border: #a7f3d0;
  
  --yhct-accent: #0284c7;
  --yhct-accent-light: #e0f2fe;
  
  --yhct-gold: #d97706;
  --yhct-gold-light: #fef3c7;
  
  --yhct-danger: #dc2626;
  --yhct-danger-light: #fee2e2;
  
  --yhct-bg: #f8fafc;
  --yhct-card-bg: #ffffff;
  --yhct-text-main: #0f172a;
  --yhct-text-muted: #64748b;
  --yhct-border: #e2e8f0;
  
  --yhct-radius: 14px;
  --yhct-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
  --yhct-shadow-lg: 0 10px 30px -5px rgba(15, 23, 42, 0.12);
}

.yhct-exam-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--yhct-text-main);
  box-sizing: border-box;
}

.yhct-exam-container * {
  box-sizing: border-box;
}

/* Header Banner */
.yhct-exam-header {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #0f766e 100%);
  border-radius: var(--yhct-radius);
  color: #ffffff;
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--yhct-shadow-lg);
  position: relative;
  overflow: hidden;
}

.yhct-exam-header::before {
  content: "☯";
  position: absolute;
  right: -20px;
  bottom: -40px;
  font-size: 16rem;
  opacity: 0.06;
  pointer-events: none;
  line-height: 1;
}

.yhct-exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.yhct-exam-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
}

.yhct-exam-subtitle {
  font-size: 0.98rem;
  opacity: 0.9;
  margin: 0;
  max-width: 800px;
  line-height: 1.5;
}

/* Nav Tabs */
.yhct-exam-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}

.yhct-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background: #ffffff;
  border: 1px solid var(--yhct-border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--yhct-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.yhct-tab-btn:hover {
  background: #f1f5f9;
  color: var(--yhct-text-main);
  border-color: #cbd5e1;
}

.yhct-tab-btn.active {
  background: var(--yhct-primary);
  color: #ffffff;
  border-color: var(--yhct-primary);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* Main Cards */
.yhct-card {
  background: var(--yhct-card-bg);
  border: 1px solid var(--yhct-border);
  border-radius: var(--yhct-radius);
  padding: 1.75rem;
  box-shadow: var(--yhct-shadow);
  margin-bottom: 1.5rem;
}

.yhct-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--yhct-border);
}

/* Filter & Search Bar */
.yhct-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.5rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--yhct-border);
}

.yhct-search-box {
  flex: 1 1 280px;
  position: relative;
}

.yhct-search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  border: 1px solid var(--yhct-border);
  border-radius: 8px;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
}

.yhct-search-input:focus {
  border-color: var(--yhct-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.yhct-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--yhct-text-muted);
  pointer-events: none;
}

.yhct-select {
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--yhct-border);
  border-radius: 8px;
  font-size: 0.92rem;
  background: #ffffff;
  color: var(--yhct-text-main);
  outline: none;
  cursor: pointer;
  min-width: 230px;
}

.yhct-select:focus {
  border-color: var(--yhct-primary);
}

/* Question Item */
.yhct-question-card {
  background: #ffffff;
  border: 1px solid var(--yhct-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yhct-question-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.yhct-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.yhct-q-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--yhct-accent-light);
  color: var(--yhct-accent);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.yhct-q-subject {
  font-size: 0.82rem;
  color: var(--yhct-text-muted);
  font-weight: 600;
}

.yhct-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 1.15rem;
  color: var(--yhct-text-main);
}

/* Options */
.yhct-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.yhct-option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  line-height: 1.45;
  user-select: none;
}

.yhct-option-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.yhct-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--yhct-text-main);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.yhct-option-item.selected {
  background: var(--yhct-accent-light);
  border-color: var(--yhct-accent);
}
.yhct-option-item.selected .yhct-option-letter {
  background: var(--yhct-accent);
  color: #ffffff;
}

/* Feedback states in Practice Mode */
.yhct-option-item.correct {
  background: var(--yhct-primary-light) !important;
  border-color: var(--yhct-primary) !important;
  color: #065f46;
}
.yhct-option-item.correct .yhct-option-letter {
  background: var(--yhct-primary);
  color: #ffffff;
}

.yhct-option-item.wrong {
  background: var(--yhct-danger-light) !important;
  border-color: var(--yhct-danger) !important;
  color: #991b1b;
}
.yhct-option-item.wrong .yhct-option-letter {
  background: var(--yhct-danger);
  color: #ffffff;
}

/* Explanation Box */
.yhct-explanation-box {
  margin-top: 1.15rem;
  padding: 1rem 1.25rem;
  background: #f0fdf4;
  border-left: 4px solid var(--yhct-primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #166534;
}

.yhct-explanation-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Exam Mode Controls */
.yhct-exam-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--yhct-border);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  position: sticky;
  top: 10px;
  z-index: 10;
}

.yhct-timer {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--yhct-primary);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.yhct-timer.warning {
  color: var(--yhct-danger);
  animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-danger {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.yhct-exam-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 480px;
}

.yhct-grid-node {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.yhct-grid-node:hover {
  background: #e2e8f0;
}

.yhct-grid-node.answered {
  background: var(--yhct-primary);
  color: #ffffff;
  border-color: var(--yhct-primary);
}

.yhct-grid-node.active {
  outline: 2px solid var(--yhct-accent);
  outline-offset: 1px;
}

/* Buttons */
.yhct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.yhct-btn-primary {
  background: var(--yhct-primary);
  color: #ffffff;
}
.yhct-btn-primary:hover {
  background: var(--yhct-primary-hover);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.yhct-btn-secondary {
  background: #f1f5f9;
  color: var(--yhct-text-main);
  border: 1px solid #cbd5e1;
}
.yhct-btn-secondary:hover {
  background: #e2e8f0;
}

.yhct-btn-danger {
  background: var(--yhct-danger);
  color: #ffffff;
}
.yhct-btn-danger:hover {
  background: #b91c1c;
}

/* Upload Dropzone */
.yhct-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 14px;
  padding: 3rem 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
}

.yhct-dropzone:hover, .yhct-dropzone.dragover {
  border-color: var(--yhct-primary);
  background: #f0fdf4;
}

.yhct-dropzone-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--yhct-primary);
}

.yhct-progress-bar-bg {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 1.25rem 0 0.5rem 0;
}

.yhct-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #0284c7);
  width: 0%;
  transition: width 0.3s ease;
}

/* Result Scoreboard */
.yhct-score-box {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid var(--yhct-primary-border);
  border-radius: 16px;
  margin-bottom: 2rem;
}

.yhct-score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0 auto 1.25rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 6px solid var(--yhct-primary);
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.2);
}

.yhct-score-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--yhct-primary);
  line-height: 1;
}

.yhct-score-max {
  font-size: 0.85rem;
  color: var(--yhct-text-muted);
  font-weight: 600;
}

.yhct-score-verdict {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .yhct-exam-container {
    padding: 0.75rem 0.75rem 2rem 0.75rem;
  }
  .yhct-exam-header {
    padding: 1.5rem 1.25rem;
  }
  .yhct-exam-title {
    font-size: 1.4rem;
  }
  .yhct-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .yhct-select {
    width: 100%;
  }
  .yhct-exam-topbar {
    position: static;
  }
}


/* ==============================================================================
   EXAM CENTER LIST & CARDS (v3.9.1)
   ============================================================================== */
.yhct-exam-setup-wrapper {
  animation: yhctFadeIn 0.3s ease;
}

.yhct-exam-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.yhct-exam-paper-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.yhct-exam-paper-card:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.15);
}

.yhct-exam-paper-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #059669, #0284c7);
}

.yhct-paper-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.yhct-paper-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.yhct-paper-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.15rem;
}

.yhct-paper-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

@media (max-width: 640px) {
  .yhct-exam-list-grid {
    grid-template-columns: 1fr;
  }
}


/* ==============================================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION (v3.9.2)
   ============================================================================== */
.yhct-exam-active-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .yhct-exam-active-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

.yhct-exam-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .yhct-exam-list-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .yhct-exam-container {
    padding: 0.5rem 0.5rem 2rem 0.5rem !important;
  }
  .yhct-exam-header {
    padding: 1.25rem 1rem !important;
    border-radius: 12px !important;
    margin-bottom: 1.25rem !important;
  }
  .yhct-exam-title {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
  }
  .yhct-exam-subtitle {
    font-size: 0.85rem !important;
    line-height: 1.45 !important;
  }
  .yhct-exam-tabs {
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
  }
  .yhct-tab-btn {
    padding: 0.55rem 0.85rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }
  .yhct-exam-paper-card {
    padding: 1.15rem 1rem !important;
  }
  .yhct-paper-header {
    gap: 0.65rem !important;
  }
  .yhct-paper-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.25rem !important;
  }
}
