/* MAP Practice Test Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #374151;
}

/* Loading Screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Welcome Screen */
#welcomeScreen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.welcome-container {
  background: white;
  border-radius: 24px;
  padding: 3rem;
  max-width: 700px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.welcome-header {
  text-align: center;
  margin-bottom: 2rem;
}

.welcome-header h1 {
  color: #667eea;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.welcome-header .subtitle {
  color: #6b7280;
  font-size: 1.125rem;
}

.disclaimer-box {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.disclaimer-box h3 {
  color: #92400e;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.disclaimer-box p {
  color: #78350f;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.disclaimer-box strong {
  color: #92400e;
}

.time-selection {
  margin-bottom: 2rem;
}

.time-selection h3 {
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.time-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.time-btn {
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.time-btn:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.time-btn.selected {
  border-color: #667eea;
  background: #f0f4ff;
}

.time-btn .duration {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  display: block;
}

.time-btn .questions {
  font-size: 0.875rem;
  color: #6b7280;
}

.acknowledgment {
  margin-bottom: 2rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 1rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.checkbox-label:hover {
  background: #f9fafb;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #667eea;
}

.checkbox-label span {
  flex: 1;
  line-height: 1.6;
  color: #374151;
}

.start-btn {
  width: 100%;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.start-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.legal-links {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.legal-links a {
  color: #667eea;
  text-decoration: none;
  margin: 0 0.5rem;
}

.legal-links a:hover {
  text-decoration: underline;
}

/* Test Screen */
#testScreen {
  min-height: 100vh;
  padding: 2rem;
}

.test-container {
  max-width: 900px;
  margin: 0 auto;
}

.test-header {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.question-counter {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border-radius: 8px;
}

.timer-icon {
  font-size: 1.25rem;
}

.timer-display {
  font-size: 1.25rem;
  font-weight: 700;
  color: #667eea;
  font-variant-numeric: tabular-nums;
}

.timer-display.warning {
  color: #f59e0b;
}

.timer-display.critical {
  color: #dc2626;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.question-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.subject-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.subject-badge.reading {
  background: #dbeafe;
  color: #1e40af;
}

.subject-badge.math {
  background: #dcfce7;
  color: #166534;
}

.question-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #1f2937;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.answer-option {
  position: relative;
}

.answer-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.answer-option label {
  display: block;
  padding: 1.25rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.6;
}

.answer-option label:hover {
  border-color: #667eea;
  background: #f9fafb;
}

.answer-option input[type="radio"]:checked + label {
  border-color: #667eea;
  background: #f0f4ff;
  font-weight: 500;
}

.hint-box {
  background: #f0f4ff;
  border-left: 4px solid #667eea;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.hint-box .hint-icon {
  display: inline-block;
  margin-right: 0.5rem;
}

.hint-box .hint-text {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
}

.navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 0.875rem 1.5rem;
  border: 2px solid #667eea;
  border-radius: 12px;
  background: white;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.nav-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.submit-btn {
  width: 100%;
  padding: 1.25rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Results Screen */
#resultsScreen {
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.results-container {
  background: white;
  border-radius: 24px;
  padding: 3rem;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.results-header {
  text-align: center;
  margin-bottom: 2rem;
}

.results-header h1 {
  color: #667eea;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.score-display {
  text-align: center;
  margin-bottom: 2rem;
}

.score-circle {
  width: 180px;
  height: 180px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.score-value {
  color: white;
  font-size: 3rem;
  font-weight: 700;
}

.score-label {
  color: #6b7280;
  font-size: 1.125rem;
}

.encouragement {
  text-align: center;
  font-size: 1.25rem;
  color: #374151;
  margin-bottom: 2rem;
  font-weight: 500;
}

.subject-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.subject-card {
  background: #f9fafb;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}

.subject-card h3 {
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.subject-score {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subject-card.reading .subject-score {
  color: #2563eb;
}

.subject-card.math .subject-score {
  color: #16a34a;
}

.subject-details {
  color: #6b7280;
  font-size: 0.95rem;
}

.time-stats {
  background: #f0f4ff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.time-stats h3 {
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
}

.results-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.results-actions button {
  flex: 1;
  min-width: 200px;
  padding: 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-retake {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.btn-retake:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-home {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

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

/* Progress Tracker */
.progress-tracker {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.progress-tracker h3 {
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0.5rem;
}

.question-bubble {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #e5e7eb;
  background: white;
  color: #6b7280;
}

.question-bubble:hover {
  transform: scale(1.05);
  border-color: #667eea;
}

.question-bubble.answered {
  background: #f0f4ff;
  border-color: #667eea;
  color: #667eea;
}

.question-bubble.current {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .welcome-container {
    padding: 2rem 1.5rem;
  }

  .welcome-header h1 {
    font-size: 2rem;
  }

  .time-buttons {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .test-container {
    padding: 0;
  }

  .test-header {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-info {
    flex-direction: column;
    gap: 0.75rem;
  }

  .question-card {
    padding: 1.5rem;
  }

  .navigation {
    flex-direction: column;
  }

  .nav-btn {
    width: 100%;
  }

  .results-container {
    padding: 2rem 1.5rem;
  }

  .results-actions {
    flex-direction: column;
  }

  .results-actions button {
    width: 100%;
    min-width: 0;
  }

  .question-grid {
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
label:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .navigation,
  .test-header,
  button {
    display: none;
  }
}

