/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --background: #ffffff;
  --card-bg: #f8fafc;
  --border: #e2e8f0;
  --focus-outline: 2px solid var(--primary-dark);

  /* Updated modal colors for a more minimal pastel feel */
  --modal-bg: #f9f9f9; /* Lighter pastel background */
  --modal-border: #e0e0e0; /* Softer border color */
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}

/* Layout */
.container {
  width: min(1200px, 90%);
  margin: 0 auto;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-content {
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
  text-decoration: none;
}

/* Navigation */
.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: var(--primary);
  outline: none;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

/* Hero Section */
.hero {
  /* Subtle, fresh gradient */
  padding: 8rem 0 0.25rem;
  text-align: center;
  background: linear-gradient(to bottom, #f0f9ff, #ffffff);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-span {
  display: block;
  font-size: clamp(2rem, 5vw, 1.75rem);
  line-height: 1.5;
  margin-bottom: 2rem;
}

.span-highlight {
  color: orange;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #64748b;
  max-width: 600px;
  margin: 0 auto 2rem;
  margin-bottom: 60px;
}

/* Main Content */
.main-content {
  padding: 8rem 0 0.25rem;
}

.main-content p {
  margin: 1rem 0 1.5rem;
}

/* **Simplified List Styles** */
.main-content ul {
  list-style: disc;          /* Restore default bullet points */
  padding-left: 1.5rem;      /* Indent the list */
  margin: 1.5rem 0;          /* Vertical spacing above and below the list */
}

.main-content ol {
  list-style: decimal;          /* Restore default bullet points */
  padding-left: 2rem;      /* Indent the list */
  margin: 1.5rem 0;          /* Vertical spacing above and below the list */
}

.main-content li {
  margin-bottom: 0.5rem;     /* Space between list items */
  line-height: 1.6;           /* Optional: Improve readability */
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1.25rem; 
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-dark);
  transform: translateY(-1px);
  outline: none;
}

.btn:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Consolidated Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  padding: 1rem;
  z-index: 1000;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--modal-bg); /* Updated minimal pastel background */
  border: 1px solid var(--modal-border);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  /* Softer, minimal shadow */
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  animation: slideDown 0.3s ease-out;
}

.modal-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.75rem 0.5rem; 
  color: var(--text);
  line-height: 1; 
  transition: color 0.3s, transform 0.2s;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--primary);
  transform: scale(1.1);
  outline: none;
}

/* Keyframes */
@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Features */
.features {
  padding: 4rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  transition: transform 0.2s;
  /* Slightly reduced shadow for a cleaner look */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feature-card:hover,
.feature-card:focus-within {
  transform: translateY(-5px);
}

/* Contact Form Styles */

/* Success Message */
.success-message {
    /* Removed display: none; */
    color: #059669;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #d1fae5;
    border-radius: 0.375rem;
}

/* Form Error Messages */
.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

/* Contact Form Container */
form#contactForm {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Form Group */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

/* Labels */
.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

/* Input Fields */
form#contactForm input[type="text"],
form#contactForm input[type="email"],
form#contactForm textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

form#contactForm input[type="text"]:focus,
form#contactForm input[type="email"]:focus,
form#contactForm textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
}

/* Submit Button */
form#contactForm button#submitButton {
    position: relative;
    padding: 10px 20px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

form#contactForm button#submitButton:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
}

form#contactForm button#submitButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.spinner.active {
    display: inline-block;
}

.native-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    
    /* Guaranteed Spinning Spinner */
    animation: spin 1s linear infinite;
    -webkit-animation: spin 1s linear infinite;
    -moz-animation: spin 1s linear infinite;
}

/* Multiple animation keyframes for maximum compatibility */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@-moz-keyframes spin {
    0% { -moz-transform: rotate(0deg); }
    100% { -moz-transform: rotate(360deg); }
}

/* Button Styling */
.submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}



/* Footer */
footer {
  background: var(--card-bg);
  padding: 2rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Footer Navigation */
footer nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

footer nav ul li a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s;
  font-weight: 500;
}

footer nav ul li a:hover,
footer nav ul li a:focus {
  color: var(--primary);
  outline: none;
}

/* State List */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  padding: 1rem;
}

.state-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.state-btn:hover,
.state-btn:focus {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  outline: none;
}

.state-btn:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Mobile Styles */
/* Mobile Specific Adjustments */
@media (max-width: 480px) {
  #progress-steps {
    padding: 0 0.5rem;
    margin: 1.5rem 0;
  }

  .step::before {
    width: 20px; /* Even smaller circles on very small screens */
    height: 20px;
  }

  .step span {
    font-size: 0.675rem; /* Smaller text on mobile */
  }

  #progress-steps::before,
  #progress-steps::after {
    left: 1.5rem;
    right: 1.5rem;
    top: 10px; /* Adjust for smaller circles */
  }
}








@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    background: white;
    width: 200px;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 0 0 0.5rem 0.5rem;
  }
  .nav-menu.active {
    display: flex;
  }
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }
  .state-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-content ul {
    padding-left: 1rem;
  }
   .main-content ol {
    padding-left: 2rem;
  }
  
  
  .main-content li::before,
  .main-content ol li::before {
    left: -0.5rem;
  }
}

/* Quiz Section Layout */
.quiz.container {
  margin-top: 100px;
  padding-top: 2rem;
}

.quiz {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: #ffffff;
  border-radius: 1rem;
  /* Slight shadow for distinction */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Base button styles */
.quiz-button,
#next-button, 
#submit-button,
#restart-button,
#next-practice-test-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  /* Light box-shadow to maintain minimal style */
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.quiz-button:hover,
#next-button:hover,
#submit-button:hover,
#restart-button:hover,
#next-practice-test-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.quiz-button:active,
#next-button:active,
#submit-button:active,
#restart-button:active,
#next-practice-test-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
}

.quiz-button:focus,
#next-button:focus,
#submit-button:focus,
#restart-button:focus,
#next-practice-test-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Disabled state */
.quiz-button:disabled,
#next-button:disabled,
#submit-button:disabled,
#restart-button:disabled,
#next-practice-test-button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.quiz-button:disabled:hover,
#next-button:disabled:hover,
#submit-button:disabled:hover,
#restart-button:disabled:hover,
#next-practice-test-button:disabled:hover {
  background: #94a3b8;
  transform: none;
  box-shadow: none;
}

/* Secondary button style for Try Again and Next Test */
#restart-button,
#next-practice-test-button {
  background: #4b5563;
}

#restart-button:hover,
#next-practice-test-button:hover {
  background: #374151;
}

/* Quiz Parameters Section */
.quiz-parameters {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  margin: 2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quiz-parameters p {
  margin: 1rem 0;
  font-size: 1.125rem;
  color: #1f2937;
}

.quiz-parameters strong {
  color: var(--primary);
  font-weight: 600;
}

.quiz h1 {
  color: #1f2937;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

/* Selection Interface */
.selection-container {
  margin-bottom: 2rem;
}

.selection-group {
  margin-bottom: 1rem;
}

.selection-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #374151;
}

.selection-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  font-size: 1rem;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.selection-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Timer */
#timer-container {
  text-align: center;
  margin: 1rem 0;
}

#timer {
  display: inline-block;
  background: #f3f4f6;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: #374151;
}

/* Progress Bar */
#progress-container {
  margin: 2rem 0;
}

#progress-bar {
  width: 100%;
  height: 0.75rem;
  background: #f1f5f9;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #9333ea);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: var(--progress-width, 0%);
  box-shadow: 0 2px 4px rgba(168, 85, 247, 0.2);
}

#progress-container.complete #progress-bar > div {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
  transition: all 0.5s ease;
}

#progress-text {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #475569;
  font-weight: 500;
}

/* Progress Steps */
#progress-steps {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  position: relative;
  padding: 0 1rem;
  width: 100%;
  gap: 0.5rem;
}

/* Progress Line */
#progress-steps::before {
  content: '';
  position: absolute;
  top: 12px; /* Centered with smaller circles */
  left: 2rem;
  right: 2rem;
  height: 2px; /* Thinner line */
  background: #e2e8f0;
  z-index: 1;
}

/* Step Item */
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px; /* Reduced gap */
  color: #94a3b8;
  font-size: 0.875rem;
  z-index: 2;
  background: transparent;
  cursor: default;
  text-align: center;
  flex: 1;
  min-width: 0; /* Allows text to wrap */
}

/* Circle Indicator */
.step::before {
  content: '';
  width: 24px; /* Slightly smaller circles */
  height: 24px;
  background: #ffffff;
  border: 2px solid #cbd5e1; /* Thinner border */
  border-radius: 50%;
  margin-bottom: 4px;
  transition: all 0.3s ease;
  flex-shrink: 0; /* Prevent circle from shrinking */
}

/* Step Text */
.step span {
  font-weight: 500;
  font-size: 0.75rem; /* Smaller font size by default */
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
  max-width: 100%; /* Ensures text wraps within container */
}

/* Active Step */
.step.active::before {
  border-color: #a855f7;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.step.active {
  color: #9333ea;
  font-weight: 600;
}

/* Completed Step - Using a success green */
.step.completed::before {
  border-color: #059669;
  background: #059669;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.step.completed {
  color: #059669;
  font-weight: 600;
}

/* Progress Line Fill */
#progress-steps::after {
  content: '';
  position: absolute;
  top: 12px; /* Match the ::before line position */
  left: 2rem;
  height: 2px; /* Match the ::before line thickness */
  background: #0ea5e9;
  z-index: 1;
  transition: width 0.4s ease;
  width: var(--progress-width, 0%);
}

/* Quiz Questions */
.question {
  margin-bottom: 2rem;
  font-size: 1.125rem;
  color: #1f2937;
  line-height: 1.6;
}

.question-image {
  margin: 1rem 0;
  text-align: center;
}

.question-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Options */
.options {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.options li {
  margin-bottom: 1rem;
}

.options label {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.options label:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.options input[type="radio"] {
  margin-right: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 50%;
}

/* Navigation Buttons */
#navigation-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

/* Results */
#result-container {
  padding: 2rem;
  background: #f9fafb;
  border-radius: 1rem;
  display: flex; 
  flex-direction: row; 
  justify-content: center;
  gap: 1rem; 
  flex-wrap: wrap;
}

#score {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 2rem;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
  text-align: center;
}

.result-question {
  background: white;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.result-question h3 {
  color: #1f2937;
  margin-bottom: 1rem;
}

.result-image {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 0.5rem;
}

.correct {
  color: #059669;
  font-weight: 500;
}

.incorrect {
  color: #dc2626;
  font-weight: 500;
}

/* Error Message */
.error-message {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.error-message::before {
  content: '⚠️';
  margin-right: 0.5rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}
