/* === Exam Simulation Styles === */

/* Exam button on student page */
.exam-btn {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  color: white !important;
  border: none !important;
}

/* Exam hub page */
.exam-page {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 16px;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

.exam-section {
  margin-bottom: 24px;
}

.exam-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Exam song cards */
.exam-song-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.exam-song-info {
  flex: 1;
  overflow: hidden;
}

.exam-song-name {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-song-tone {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.exam-song-remove {
  background: none;
  border: none;
  color: #FF3B30;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

/* Add song button */
.exam-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.exam-add-btn:active {
  border-color: var(--primary);
  color: var(--primary);
}

/* Start exam area */
.exam-start-area {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.prep-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 16px;
}

.prep-option {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.prep-option.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.exam-start-btn {
  width: 100%;
  max-width: 240px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.exam-start-btn:active {
  transform: scale(0.97);
}

.exam-start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Exam history cards */
.exam-history-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.exam-history-card.status-completed {
  border-left-color: #34C759;
}

.exam-history-card.status-started {
  border-left-color: #FF9500;
}

.exam-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.exam-history-song {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.exam-history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.exam-history-tone {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Song search modal (reused from homework) */
.exam-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.exam-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.exam-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* === Exam Session Styles === */

.exam-session-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Countdown overlay */
.exam-countdown {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.countdown-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.countdown-song {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.countdown-tone {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
}

.countdown-timer {
  font-size: 6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 16px;
}

.countdown-hint {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* Recording indicator */
.exam-recording-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: #FF3B30;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
}

.exam-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  animation: exam-rec-blink 1s ease-in-out infinite;
}

@keyframes exam-rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Score area in exam */
.exam-score-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Complete screen */
.exam-complete {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}

.exam-complete-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.exam-complete h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.exam-complete p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.exam-complete .btn {
  min-width: 160px;
}

/* Simple controls bar for exam */
.exam-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.exam-progress {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.exam-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}
