/* Test Session Styles - Mobile First */

.test-session {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.test-header {
  background: var(--primary-gradient);
  color: white;
  padding: 16px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.test-info h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: white;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: white;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-full);
}

.question-counter {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.test-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.question-container {
  max-width: 800px;
  margin: 0 auto;
}

.question-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.question-text {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.option-button {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  text-align: left;
  font-size: 16px;
  color: var(--text-primary);
  min-height: 60px;
}

.option-button:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.option-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.option-button.selected {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.option-button.correct {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
}

.option-button.incorrect {
  border-color: var(--error-color);
  background: rgba(239, 68, 68, 0.1);
}

.option-label {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.option-button.selected .option-label {
  background: var(--primary-color);
  color: white;
}

.option-button.correct .option-label {
  background: var(--success-color);
  color: white;
}

.option-button.incorrect .option-label {
  background: var(--error-color);
  color: white;
}

.option-text {
  flex: 1;
  line-height: 1.5;
}

.answer-input-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.answer-input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

#answer-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  transition: var(--transition-base);
}

#answer-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#answer-input:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
}

.answer-feedback {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.feedback-result {
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 16px;
}

.feedback-result.correct {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success-color);
  color: var(--success-color);
}

.feedback-result.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--error-color);
  color: var(--error-color);
}

.feedback-result strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.feedback-result p {
  margin: 4px 0;
  font-size: 14px;
}

.feedback-explanation {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.feedback-explanation strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.feedback-explanation p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
}

.test-controls {
  padding: 16px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  bottom: 0;
  z-index: 50;
}

.controls-buttons {
  display: flex;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.control-button {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  min-height: 48px;
}

.control-button:hover:not(:disabled) {
  background: var(--border-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.control-button.primary-button {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.control-button.primary-button:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.control-button.finish-button {
  background: var(--success-color);
  color: white;
}

.control-button.finish-button:hover:not(:disabled) {
  background: #059669;
  box-shadow: var(--shadow-md);
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  .test-header {
    padding: 24px;
  }

  .test-info h2 {
    font-size: 24px;
  }

  .test-content {
    padding: 24px;
  }

  .question-content {
    padding: 32px;
  }

  .question-text {
    font-size: 20px;
  }

  .option-button {
    padding: 20px;
    font-size: 17px;
  }

  .test-controls {
    padding: 24px;
  }

  .controls-buttons {
    gap: 16px;
  }

  .control-button {
    padding: 16px 24px;
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .question-container {
    max-width: 900px;
  }
}
