/**
 * PMERIT Assessment System Styles
 * Mobile-first responsive design
 * Version: 1.0
 * Last Updated: November 2025
 */

/* ========================================
   BASE ASSESSMENT STYLES
   Mobile-first (320px and up)
   ======================================== */

/* Layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

main {
  flex: 1;
}

/* Container */
.assessment-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Section Styling */
.section {
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-title i {
  color: var(--color-primary);
}

/* Utility classes for common inline styles */
.link-primary {
  color: var(--color-primary);
}

.section-spacing-top {
  margin-top: var(--space-12);
}

.text-xl {
  font-size: var(--text-xl);
}

/* ========================================
   ENTRY PAGE STYLES
   ======================================== */

/* Hero Section with Purple Gradient (Structural Element Only) */
.hero-section {
  background: var(--gradient-hero);
  color: var(--text-inverse);
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: var(--text-mobile-hero);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
}

.hero-subtitle {
  font-size: var(--text-base);
  margin-bottom: var(--space-6);
  opacity: 0.95;
  line-height: var(--leading-relaxed);
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

/* Timeline - What to Expect */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-8);
  padding-left: var(--space-6);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-icon {
  position: absolute;
  left: -23px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  z-index: 1;
}

.timeline-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.timeline-desc {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Privacy & Consent Card */
.consent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.privacy-text {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

/* Checkboxes */
.checkbox-group {
  margin-bottom: var(--space-6);
}

.checkbox-item {
  display: flex;
  align-items: start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  border: 2px solid transparent;
  transition: var(--transition-base);
  cursor: pointer;
  min-height: var(--mobile-touch-target);
}

.checkbox-item:hover {
  border-color: var(--color-primary);
}

.checkbox-item input[type='checkbox'] {
  /* Restore native checkbox appearance to ensure toggling works reliably */
  appearance: auto;
  
  /* Set accent color to match brand */
  accent-color: var(--color-primary);
  
  /* Basic sizing and spacing */
  margin-top: 4px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label {
  flex: 1;
  cursor: pointer;
  user-select: none;
}

/* Enhanced label clickability */
.checkbox-item label {
  cursor: pointer;
  flex: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-item {
  cursor: pointer;
}

.checkbox-required {
  color: var(--color-error);
  font-weight: var(--weight-semibold);
}

.checkbox-optional {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* FAQ Section */
.faq-list {
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0;
}

.faq-item {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  border-left: 4px solid var(--color-primary);
}

.faq-question {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.faq-answer {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Buttons */
.btn-group {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.btn {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--border-radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  cursor: pointer;
  transition: var(--transition-base);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  min-height: var(--mobile-touch-target);
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  background: var(--interactive-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-resume {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-resume:hover {
  background: var(--interactive-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 80%);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  text-align: center;
  color: #ffffff;
}

.loading-spinner {
  border: 4px solid rgb(255 255 255 / 30%);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

/* Resume Assessment Card */
.resume-card {
  display: none;
  background: linear-gradient(135deg, #ff6b6b 0%, #e05a5a 100%);
  color: #ffffff;
  padding: var(--space-6);
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-lg);
}

.resume-card.active {
  display: block;
}

.resume-card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.resume-card-text {
  margin-bottom: var(--space-4);
  opacity: 0.95;
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   QUESTIONS PAGE STYLES
   ======================================== */

/* Progress Bar (Sticky) */
.progress-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  padding: var(--space-4);
  border-bottom: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* Section Indicators */
.section-indicators {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
}

.indicator {
  font-size: 1.5rem;
  color: var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  color: var(--color-primary);
  transform: scale(1.2);
}

.indicator:hover {
  color: var(--color-secondary);
}

/* Question Card */
.question-card {
  max-width: 800px;
  margin: var(--space-8) auto;
  padding: var(--space-8);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.question-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--border-color);
}

.question-number {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trait-label {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}

.facet-label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.question-text {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
  text-align: center;
}

/* Answer Options - Likert Scale */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.radio-option {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--mobile-touch-target);
  background: var(--bg-secondary);
}

.radio-option:hover {
  border-color: var(--color-primary);
  background: rgba(42, 91, 140, 0.05);
  transform: translateX(4px);
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  margin-right: var(--space-3);
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.radio-option input[type="radio"]:checked + .radio-label {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
}

.radio-option:has(input[type="radio"]:checked) {
  border-color: var(--color-primary);
  background: rgba(42, 91, 140, 0.1);
  box-shadow: 0 0 0 3px rgba(42, 91, 140, 0.1);
}

.radio-label {
  flex: 1;
  font-size: var(--text-base);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

/* Navigation Buttons */
.navigation-buttons {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.navigation-buttons .btn {
  flex: 1;
  min-width: 120px;
}

/* Auto-Save Indicator */
.autosave-indicator {
  text-align: center;
  min-height: 24px;
  padding: var(--space-2);
}

.autosave-text {
  font-size: var(--text-sm);
  color: var(--color-success);
  font-weight: var(--weight-medium);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.autosave-text.show {
  opacity: 1;
}

/* Resume Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: var(--space-8);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modal-title i {
  color: var(--color-accent);
}

.modal-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.progress-info {
  background: var(--bg-secondary);
  padding: var(--space-4);
  border-radius: var(--border-radius-md);
  border-left: 4px solid var(--color-primary);
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-buttons .btn {
  width: 100%;
}

/* ========================================
   PROCESSING PAGE STYLES
   ======================================== */

.processing-container {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  background: var(--bg-primary);
}

/* Brain Animation */
.brain-animation {
  margin-bottom: var(--space-12);
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brain-icon {
  font-size: 5rem;
  position: relative;
  z-index: 2;
  animation: brain-pulse 2s ease-in-out infinite;
}

@keyframes brain-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Pulse Rings */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border: 3px solid var(--color-secondary);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 2s ease-out infinite;
}

.pulse-ring.delay-1 {
  animation-delay: 0.5s;
}

.pulse-ring.delay-2 {
  animation-delay: 1s;
}

@keyframes pulse-ring {
  0% {
    width: 100px;
    height: 100px;
    opacity: 0.6;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

/* Progress Steps */
.progress-steps {
  width: 100%;
  max-width: 500px;
  margin-bottom: var(--space-8);
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.step {
  display: flex;
  align-items: center;
  padding: var(--space-3) 0;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.step.active {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
}

.step.completed {
  color: var(--color-success);
}

.step-icon {
  font-size: 1.5rem;
  margin-right: var(--space-3);
  transition: all 0.3s ease;
}

.step-text {
  font-family: var(--font-secondary);
  font-size: var(--text-base);
}

/* Fun Facts */
.fun-facts {
  width: 100%;
  max-width: 600px;
  min-height: 80px;
  text-align: center;
  position: relative;
  margin-top: var(--space-8);
}

.fact {
  position: absolute;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  font-family: var(--font-secondary);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  font-style: italic;
}

.fact.active {
  position: relative;
  opacity: 1;
}

/* Error Message */
.error-message {
  display: none;
  text-align: center;
  padding: var(--space-8);
  background: rgba(255, 107, 107, 0.1);
  border-radius: var(--border-radius-lg);
  max-width: 500px;
}

.error-message.show {
  display: block;
}

.error-message h3 {
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  font-family: var(--font-primary);
}

.error-message p {
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  font-family: var(--font-secondary);
}

/* ========================================
   PROCESSING PAGE - MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 767px) {
  .brain-animation {
    width: 150px;
    height: 150px;
    margin-bottom: var(--space-8);
  }
  
  .brain-icon {
    font-size: 3.5rem;
  }
  
  .progress-steps {
    padding: var(--space-4);
  }
  
  .step-text {
    font-size: var(--text-sm);
  }
  
  .fact {
    font-size: var(--text-base);
  }
}

/* ========================================
   RESULTS PAGE STYLES
   (Placeholder for future implementation)
   ======================================== */

/* Radar chart */

/* Trait cards */

/* Career matches */

/* ========================================
   MOBILE RESPONSIVE BREAKPOINTS
   Mobile-first approach with progressive enhancement
   ======================================== */

/* Small Mobile (481px - 768px) - Mobile Landscape */
@media (min-width: 481px) {
  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .timeline {
    padding-left: var(--space-8);
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-icon {
    left: -28px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* Tablet Portrait (769px - 1024px) */
@media (min-width: 769px) {
  .hero-title {
    font-size: var(--text-4xl);
  }

  .btn-group {
    flex-direction: row;
  }

  .btn {
    width: auto;
  }
}

/* Tablet Landscape / Small Desktop (1025px - 1440px) */
@media (min-width: 1025px) {
  .assessment-container {
    padding: var(--space-12) var(--space-6);
  }

  .consent-card {
    padding: var(--space-10);
  }
  
  /* Questions Page - Desktop Layout */
  .answer-options {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  
  .radio-option {
    flex: 1;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    min-width: 140px;
    padding: var(--space-5);
  }
  
  .radio-option:hover {
    transform: translateY(-4px);
  }
  
  .radio-option input[type="radio"] {
    margin-right: 0;
    margin-bottom: var(--space-2);
  }
  
  .radio-label {
    font-size: var(--text-sm);
  }
  
  .question-card {
    padding: var(--space-10);
  }
  
  .modal-buttons {
    flex-direction: row;
  }
  
  .modal-buttons .btn {
    width: auto;
    flex: 1;
  }
}

/* Large Desktop (1441px and up) */
@media (min-width: 1441px) {
  .hero-content {
    max-width: 1000px;
  }

  .assessment-container {
    max-width: 1200px;
  }
}
