* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  min-height: 100vh;
}

.dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.back-link {
  position: absolute;
  top: 0;
  left: 0;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: #fff;
}

.header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #94a3b8;
}

/* Test Selection */
.test-selection {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.selection-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.input-group {
  flex: 1;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.code-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  outline: none;
}

.code-input:focus {
  border-color: #f59e0b;
}

.code-input::placeholder {
  font-size: 0.9rem;
  letter-spacing: normal;
  color: #64748b;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn.primary {
  background: #f59e0b;
  color: #000;
}

.btn.primary:hover {
  background: #d97706;
  transform: translateY(-2px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Error Message */
.error-message {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.hidden {
  display: none !important;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #64748b;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.divider span {
  padding: 0 1rem;
}

/* Tests List */
.tests-list {
  display: grid;
  gap: 0.75rem;
}

.test-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.test-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.test-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.test-item-name {
  font-weight: 600;
}

.test-item-code {
  font-size: 0.85rem;
  color: #f59e0b;
  font-family: monospace;
}

.test-item-date {
  font-size: 0.8rem;
  color: #64748b;
}

.empty-state {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

/* Test Info */
.test-info {
  margin-bottom: 2rem;
}

.info-card {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
}

.info-card h2 {
  font-size: 1.5rem;
  color: #fbbf24;
  margin-bottom: 1rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: #94a3b8;
}

.info-row .value {
  font-weight: 500;
}

.info-row .value.code {
  font-family: monospace;
  color: #f59e0b;
}

/* Recordings Section */
.recordings-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.recordings-list {
  display: grid;
  gap: 1rem;
}

.recording-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s;
}

.recording-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.recording-thumbnail {
  width: 120px;
  height: 90px;
  background: #1a1a1a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.recording-thumbnail.has-video {
  background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
  cursor: pointer;
}

.recording-thumbnail.has-video:hover {
  transform: scale(1.05);
}

.recording-info {
  flex: 1;
}

.recording-id {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
}

.recording-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #94a3b8;
}

.recording-date {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.recording-email {
  font-size: 0.8rem;
  color: #8b5cf6;
  margin-top: 0.15rem;
}

.recording-actions {
  display: flex;
  gap: 0.5rem;
}

.view-btn,
.play-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.view-btn:hover,
.play-btn:hover {
  background: #2563eb;
}

.play-btn:disabled {
  background: #475569;
  cursor: not-allowed;
}

/* Video Modal */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: #1a1a2e;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-content video {
  width: 100%;
  display: block;
  background: #000;
}

.modal-info {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-info h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.modal-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Question Results */
.modal-questions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-questions h4 {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#question-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.question-result {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 0.85rem;
}

.question-result.correct {
  border-left: 3px solid #22c55e;
}

.question-result.incorrect {
  border-left: 3px solid #ef4444;
}

.result-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.result-content {
  flex: 1;
}

.result-question {
  color: #e2e8f0;
  margin-bottom: 0.25rem;
}

.result-answer {
  color: #94a3b8;
  font-size: 0.8rem;
}

.result-answer .correct-answer {
  color: #22c55e;
}

/* Score Badge */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.score-badge.good {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.score-badge.medium {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.score-badge.poor {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Recording card score indicator */
.recording-score {
  font-weight: 600;
}

.recording-score.good {
  color: #22c55e;
}

.recording-score.medium {
  color: #fbbf24;
}

.recording-score.poor {
  color: #ef4444;
}

/* Responsive */
@media (max-width: 600px) {
  .selection-row {
    flex-direction: column;
    align-items: stretch;
  }

  .recording-card {
    flex-direction: column;
    text-align: center;
  }

  .recording-stats {
    justify-content: center;
  }

  .modal-content {
    margin: 1rem;
  }
}
