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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Page Management */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Header Styles */
.header {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: #2563eb;
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 1.5rem;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: bold;
  color: #111827;
}

.logo-text p {
  font-size: 0.875rem;
  color: #6b7280;
}

.developer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Homepage Styles */
.hero {
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  max-width: 48rem;
  margin: 0 auto;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.developer-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.developer-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.developer-header i {
  color: #2563eb;
}

.developer-header span {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.developer-card p {
  color: #6b7280;
}

/* Test Info Section */
.test-info {
  padding: 3rem 0;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.info-card {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.info-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
}

.info-icon.blue {
  background: #dbeafe;
  color: #2563eb;
}

.info-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.info-icon.purple {
  background: #f3e8ff;
  color: #9333ea;
}

.info-card h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #111827;
}

.info-card p {
  color: #6b7280;
}

/* Instructions */
.instructions-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  max-width: 64rem;
  margin: 0 auto 2rem;
}

.instructions-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  color: #111827;
}

.instructions-list {
  list-style: none;
}

.instructions-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: #374151;
}

.step-number {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  min-width: 1.5rem;
  text-align: center;
  margin-top: 0.125rem;
}

/* Start Test Button */
.start-test-section {
  text-align: center;
}

.start-test-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.start-test-btn:hover {
  background: #1d4ed8;
}

/* Footer */
.footer {
  background: #111827;
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-developer {
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.footer-description {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Test Page Styles */
.test-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.test-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.test-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #111827;
}

.test-logo i {
  color: #2563eb;
  font-size: 1.5rem;
}

.test-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.timer i {
  color: #ef4444;
}

#timeDisplay {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: #374151;
}

#timeDisplay.warning {
  color: #ef4444;
}

.submit-btn {
  background: #16a34a;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background: #15803d;
}

/* Test Layout */
.test-container {
  background: #f9fafb;
  min-height: calc(100vh - 80px);
  padding: 1.5rem 0;
}

.test-layout {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 1.5rem;
}

/* Navigation Panel */
.nav-panel {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.nav-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.nav-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.question-nav-btn {
  width: 2rem;
  height: 2rem;
  border: 2px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.question-nav-btn:hover {
  border-color: #9ca3af;
}

.question-nav-btn.current {
  border-color: #2563eb;
  background: #2563eb;
  color: white;
}

.question-nav-btn.answered {
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
}

.question-nav-btn.flagged {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #d97706;
}

.legend {
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.legend-item i {
  width: 0.75rem;
}

.legend-item:nth-child(1) i {
  color: #16a34a;
}

.legend-item:nth-child(2) i {
  color: #f59e0b;
}

.legend-item:nth-child(3) i {
  color: #9ca3af;
}

/* Question Panel */
.question-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.question-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.flag-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.flag-btn:hover {
  border-color: #9ca3af;
}

.flag-btn.flagged {
  color: #f59e0b;
  border-color: #f59e0b;
}

.question-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.options-container {
  margin-bottom: 2rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.option:hover {
  background: #f9fafb;
}

.option input[type="radio"] {
  margin: 0;
}

.option-label {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-letter {
  font-weight: 500;
}

.question-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.nav-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

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

.next-btn {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.next-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.question-counter {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Results Page Styles */
.results-container {
  background: #f9fafb;
  min-height: calc(100vh - 80px);
  padding: 2rem 0;
}

.results-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.control-btn:hover {
  background: #f9fafb;
}

.control-btn.primary {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.control-btn.primary:hover {
  background: #1d4ed8;
}

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

.score-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  max-width: 32rem;
  margin: 0 auto;
}

.score-icon {
  font-size: 4rem;
  color: #2563eb;
  margin-bottom: 1rem;
}

.score-card h2 {
  font-size: 1.875rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 1rem;
}

.final-score {
  font-size: 3.75rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.final-score.excellent {
  color: #16a34a;
}

.final-score.good {
  color: #f59e0b;
}

.final-score.needs-improvement {
  color: #ef4444;
}

.score-badge {
  font-size: 1.125rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
}

.score-badge.excellent {
  background: #dcfce7;
  color: #15803d;
}

.score-badge.good {
  background: #fef3c7;
  color: #d97706;
}

.score-badge.needs-improvement {
  background: #fee2e2;
  color: #dc2626;
}

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

.stat-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.stat-header {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.stat-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-content i {
  color: #2563eb;
  font-size: 1.25rem;
}

.stat-content span {
  font-size: 2rem;
  font-weight: bold;
  color: #111827;
}

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

.result-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.result-card.correct .result-header {
  color: #16a34a;
}

.result-card.incorrect .result-header {
  color: #ef4444;
}

.result-card.average .result-header {
  color: #6b7280;
}

.result-number {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.result-card.correct .result-number {
  color: #16a34a;
}

.result-card.incorrect .result-number {
  color: #ef4444;
}

.result-card.average .result-number {
  color: #6b7280;
}

.result-percentage {
  font-size: 0.875rem;
  color: #6b7280;
}

.question-review {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.review-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1.5rem;
}

.review-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.review-question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.review-question-text {
  font-weight: 500;
  color: #111827;
  flex: 1;
  margin-right: 1rem;
}

.review-badges {
  display: flex;
  gap: 0.5rem;
}

.review-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.review-badge.flagged {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #f59e0b;
}

.review-badge.correct {
  background: #dcfce7;
  color: #15803d;
}

.review-badge.incorrect {
  background: #fee2e2;
  color: #dc2626;
}

.review-badge.skipped {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.review-options {
  margin-top: 0.5rem;
}

.review-option {
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-option.correct-answer {
  background: #dcfce7;
  border: 1px solid #16a34a;
}

.review-option.user-incorrect {
  background: #fee2e2;
  border: 1px solid #ef4444;
}

.review-option.neutral {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.review-option i {
  font-size: 1rem;
}

.review-option.correct-answer i {
  color: #16a34a;
}

.review-option.user-incorrect i {
  color: #ef4444;
}

.option-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-letter-review {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .test-layout {
    grid-template-columns: 1fr;
  }

  .nav-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .test-header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .question-controls {
    flex-direction: column;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detailed-results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }

  .question-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .final-score {
    font-size: 3rem;
  }
}
