/* ===================================
   OTC Age Quiz - Clean Design
   Font: Figtree
   =================================== */

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

body {
  font-family: Figtree, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f4f6fb;
  color: #0f172a;
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   APP LAYOUT
   =================================== */

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* ===================================
   MOBILE HEADER
   =================================== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: white;
  z-index: 300;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
}

.menu-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.menu-btn:hover {
  background: #f8fafc;
}

.menu-icon {
  display: block;
  width: 20px;
  height: 20px;
}

/* ===================================
   SIDEBAR
   =================================== */

.sidebar {
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 32px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Removed closed-btn styles */

.sidebar-header {
  margin-bottom: 36px;
  margin-top: 10px;
}

.sidebar-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-header h1 span {
  background: linear-gradient(135deg, #0474fc 0%, #3a95fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.parts {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.part {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: #94a3b8;
  padding: 16px 0;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
}

/* Line connector between circles (not through them) */
.part:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(50% + 16px);
  height: calc(100% - 32px);
  width: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.part:hover {
  color: #64748b;
}

.part.active {
  color: #2563eb;
  font-weight: 600;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5f5;
  z-index: 1;
  transition: background 0.2s ease;
}

.part:hover .dot {
  background: #a5b4fc;
}

.part.active .dot {
  background: #2563eb;
}

.part.completed {
  color: #16a34a;
}

.part.completed .dot {
  background: #16a34a;
}

.count {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}

.sidebar-button {
  display: block;
  margin-top: auto;
  padding: 12px 16px;
  background: #2563eb;
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  transition: background 0.2s ease;
  cursor: pointer;
}

.sidebar-button:hover {
  background: #1d4ed8;
}

/* ===================================
   MAIN CONTENT
   =================================== */

.main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 60px 40px 40px;
  min-height: 100vh;
  position: relative;
}

/* Menu button styles live under `.mobile-header` now */

/* ===================================
   QUIZ PANEL
   =================================== */

.quiz-panel {
  width: 100%;
  max-width: 760px;
  background: transparent;
  padding: 0;
}

.quiz-panel h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
  color: #0f172a;
}

.subtitle {
  color: #64748b;
  font-size: 12px;
  margin-bottom: 20px;
  display: none;
}

/* Progress Bar */
.progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 0.4s ease;
  border-radius: 0;
}

/* Answer Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.option {
  border: 1.5px solid #e5e7eb;
  padding: 16px 20px;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
  font-size: 16px;
  color: #0f172a;
  user-select: none;
}

.option:hover {
  border-color: #2563eb;
  background: #f1f5ff;
}

.option.selected {
  border-color: #2563eb;
  background: #eef2ff;
}

.option.correct {
  border-color: #10b981;
  background: #d1fae5;
  color: #047857;
}

.option.incorrect {
  border-color: #ef4444;
  background: #fee2e2;
  color: #dc2626;
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  gap: 10px;
}

.actions button {
  background: #d4d4d8;
  color: #71717a;
  border: none;
  padding: 14px 24px;
  border-radius: 0;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  width: 100%;
  cursor: not-allowed;
}

.actions button:hover:not(.enabled) {
  background: #d4d4d8;
}

.actions button.enabled {
  background: #2563eb;
  color: white;
  cursor: pointer;
}

.actions button.enabled:hover {
  background: #1d4ed8;
}

.actions button.hidden {
  display: none;
}

/* Feedback */
.feedback {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 14px 18px;
  border-radius: 0;
  font-size: 15px;
  line-height: 1.6;
  display: none;
  background: white;
  border: 1px solid #d4d4d8;
}

.feedback:not(:empty) {
  display: block;
}

.feedback.correct {
  background: white;
  border: 1px solid #d4d4d8;
  color: #16a34a;
}

.feedback.incorrect {
  background: white;
  border: 1px solid #d4d4d8;
  color: #dc2626;
}

.feedback-title {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.feedback-rationale {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
  color: #64748b;
  display: none;
}

.footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===================================
   RESULTS CONTAINER
   =================================== */

.result-container {
  background: white;
  padding: 32px;
  border: 1px solid #e5e7eb;
  text-align: center;
  margin-top: 120px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.result-container.hidden {
  display: none;
}

.result-container h2 {
  font-size: 18px;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 0;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.result-actions .btn-primary {
  background: #2563eb;
  color: white;
  border: none;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
  width: 100%;
}

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

.result-actions .btn-secondary {
  background: white;
  color: #2563eb;
  border: 2px solid #2563eb;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
  text-align: center;
  display: block;
}

.result-actions .btn-secondary:hover {
  background: #eff6ff;
}

/* ===================================
   SIDEBAR OVERLAY (Mobile)
   =================================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    padding-top: 60px; /* Space for mobile header */
  }
  
  .mobile-header {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    left: 0;
    top: 60px; /* Slide out below header */
    height: calc(100vh - 60px);
    width: 100vw;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e5e7eb;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main {
    padding: 40px 24px 40px 24px;
  }
}

@media (max-width: 600px) {
  .main {
    padding: 70px 24px 32px 24px;
  }
  
  .quiz-panel h1 {
    font-size: 20px;
  }
  
  .option {
    padding: 14px 16px;
    font-size: 14px;
  }
  
  button {
    padding: 12px 28px;
    font-size: 14px;
  }
  
  .back {
    font-size: 13px;
  }
  
  .subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
  .sidebar,
  .menu-btn,
  .actions {
    display: none !important;
  }
  
  .app {
    display: block;
  }
  
  .main {
    padding: 20px;
  }
}
