/**
 * Exam Layout - Responsive Grids
 * Goethe Assessment Exam Interface
 */

/* Exam Container */
.exam-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.exam-header {
  background-color: var(--bg-card, var(--goethe-white));
  border-bottom: 3px solid var(--goethe-red);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-sm);
}

.exam-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.exam-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.exam-logo img {
  height: 40px;
}

.exam-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-body, var(--goethe-black));
}

.exam-timer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--goethe-lighter-gray);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 600;
}

.exam-timer.warning {
  background-color: var(--status-warning);
  color: #000;
  animation: pulse 1s infinite;
}

.exam-timer.danger {
  background-color: var(--status-danger);
  color: var(--goethe-white);
  animation: pulse 0.5s infinite;
}

/* Main Content */
.exam-main {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
}

/* Progress Bar */
.exam-progress {
  background-color: var(--bg-card, var(--goethe-white));
  padding: var(--space-4) 0;
  margin-bottom: var(--space-6);
}

.exam-progress-bar {
  height: 8px;
  background-color: var(--goethe-light-gray);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.exam-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--goethe-red), var(--goethe-red-light));
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.exam-progress-text {
  text-align: center;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--goethe-gray);
}

/* Question Container */
.question-container {
  background-color: var(--bg-card, var(--goethe-white));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
}

.question-number {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background-color: var(--goethe-red);
  color: var(--goethe-white);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.question-text {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* Answer Options */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 2px solid var(--goethe-light-gray);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.answer-option:hover {
  border-color: var(--goethe-blue);
  background-color: rgba(0, 94, 168, 0.05);
}

.answer-option.selected {
  border-color: var(--goethe-red);
  background-color: rgba(227, 6, 19, 0.05);
}

.answer-option input {
  width: auto;
  margin-top: 2px;
}

.answer-option-label {
  flex: 1;
  cursor: pointer;
}

/* Navigation */
.exam-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.exam-nav-btn {
  padding: var(--space-3) var(--space-8);
}

.exam-nav-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Footer */
.exam-footer {
  background-color: var(--bg-card, var(--goethe-white));
  border-top: 1px solid var(--goethe-light-gray);
  padding: var(--space-4) 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--goethe-gray);
}

/* Question Navigator Grid */
.question-navigator {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.question-nav-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--goethe-light-gray);
  background-color: var(--bg-card, var(--goethe-white));
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.question-nav-btn:hover {
  border-color: var(--goethe-blue);
}

.question-nav-btn.current {
  border-color: var(--goethe-red);
  background-color: var(--goethe-red);
  color: var(--goethe-white);
}

.question-nav-btn.answered {
  background-color: var(--goethe-lighter-gray);
  border-color: var(--goethe-dark-gray);
}

.question-nav-btn.review {
  position: relative;
}

.question-nav-btn.review::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background-color: var(--status-warning);
  border-radius: 50%;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .exam-header-content {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  
  .exam-title {
    font-size: var(--text-base);
  }
  
  .question-container {
    padding: var(--space-4);
  }
  
  .exam-navigation {
    flex-direction: column;
  }
  
  .exam-nav-btn {
    width: 100%;
  }
}

/* Section Headers */
.section-header {
  background: linear-gradient(135deg, var(--goethe-red), var(--goethe-red-dark));
  color: var(--goethe-white);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.section-header h2 {
  margin-bottom: var(--space-1);
}

.section-header p {
  margin: 0;
  opacity: 0.9;
  font-size: var(--text-sm);
}

/* Instructions */
.instructions-box {
  background-color: rgba(0, 94, 168, 0.05);
  border-left: 4px solid var(--goethe-blue);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.instructions-box h3 {
  color: var(--goethe-blue);
  margin-bottom: var(--space-2);
}

/* Media Container */
.media-container {
  background-color: var(--goethe-lighter-gray);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  text-align: center;
}

.media-player {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Loading State */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--goethe-light-gray);
  border-top-color: var(--goethe-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: var(--space-4);
  color: var(--goethe-dark-gray);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}

.modal {
  background-color: var(--bg-card, var(--goethe-white));
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--transition-base);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--goethe-light-gray);
}

.modal-header h3 {
  margin: 0;
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--goethe-light-gray);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Dark mode overrides */
[data-theme="dark"] .loading-overlay {
  background-color: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .answer-option:hover {
  background-color: rgba(0, 94, 168, 0.15);
}

[data-theme="dark"] .instructions-box {
  background-color: rgba(74, 159, 212, 0.1);
}
