/* ========================================
   QUIZ & SIDEBAR ENHANCED STYLES
   Matches the 3D timeline card aesthetic
   ======================================== */

/* ========================================
   QUIZ MODAL ENHANCEMENTS
   ======================================== */

.quiz-modal-content {
  background: linear-gradient(165deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border: 1px solid var(--color-border);
  box-shadow: 
    0 40px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 60px -20px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Quiz Container */
.quiz-adaptive {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px;
}

/* Progress Bar Container */
.quiz-header-new {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-progress-bar {
  height: 6px;
  background: var(--color-surface);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.quiz-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px currentColor;
}

.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.quiz-counter {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Question Card */
.quiz-question-card {
  background: linear-gradient(145deg, var(--color-surface-elevated) 0%, var(--color-surface) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay */
.quiz-question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  opacity: 0.8;
}

.quiz-question-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Hint Box */
.quiz-hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.quiz-hint svg {
  flex-shrink: 0;
  color: #6366f1;
  margin-top: 2px;
}

/* ========================================
   QUIZ OPTION CARDS - GLASS AESTHETIC
   ======================================== */

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.quiz-options-grid.compact {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Individual Option Card */
.quiz-option-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(145deg, var(--color-surface) 0%, rgba(15, 15, 20, 0.8) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  
  /* Remove default button styles */
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: inherit;
}

/* Gradient overlay on hover */
.quiz-option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* Left accent bar */
.quiz-option-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hover State */
.quiz-option-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-3px) translateX(2px);
  box-shadow: 
    0 12px 30px -8px rgba(0, 0, 0, 0.4),
    0 0 20px -8px rgba(99, 102, 241, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.quiz-option-card:hover::before {
  opacity: 1;
}

.quiz-option-card:hover::after {
  opacity: 0.6;
}

/* Selected State */
.quiz-option-card.selected {
  border-color: #6366f1;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
  box-shadow: 
    0 8px 25px -5px rgba(99, 102, 241, 0.25),
    0 0 30px -10px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.quiz-option-card.selected::after {
  opacity: 1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* Icon */
.quiz-option-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Content */
.quiz-option-content {
  flex: 1;
  z-index: 1;
}

.quiz-option-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  transition: color 0.3s;
}

.quiz-option-card:hover .quiz-option-label {
  color: #fff;
}

.quiz-option-sublabel {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Checkmark */
.quiz-option-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  opacity: 0.4;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  background: transparent;
}

.quiz-option-card:hover .quiz-option-check {
  opacity: 0.7;
  border-color: rgba(99, 102, 241, 0.5);
}

.quiz-option-card.selected .quiz-option-check {
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.quiz-option-check svg {
  width: 16px;
  height: 16px;
}

/* ========================================
   QUIZ NAVIGATION BUTTONS
   ======================================== */

.quiz-nav-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.quiz-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  
  -webkit-appearance: none;
  appearance: none;
}

.quiz-nav-btn:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-border-hover);
  color: var(--color-text);
  transform: translateY(-1px);
}

.quiz-nav-btn.back:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.quiz-nav-btn.skip {
  border-color: transparent;
  color: var(--color-text-dim);
}

.quiz-nav-btn.skip:hover {
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ========================================
   QUIZ RESULT ACTIONS
   ======================================== */

.quiz-result-actions-new {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.quiz-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.5);
  
  -webkit-appearance: none;
  appearance: none;
}

.quiz-action-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.6);
}

.quiz-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  color: #f59e0b;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  
  -webkit-appearance: none;
  appearance: none;
}

.quiz-action-secondary:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.quiz-action-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  
  -webkit-appearance: none;
  appearance: none;
}

.quiz-action-tertiary:hover {
  background: var(--color-surface);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

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

.module-sidebar {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-right: 1px solid var(--color-border);
  box-shadow: 4px 0 30px -10px rgba(0, 0, 0, 0.3);
}

/* Sidebar Tabs - Glass Effect */
.sidebar-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: linear-gradient(145deg, var(--color-surface-elevated) 0%, var(--color-surface) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.sidebar-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
  
  -webkit-appearance: none;
  appearance: none;
}

/* Tab hover state */
.sidebar-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}

/* Active tab - uses stage color */
.sidebar-tab.active {
  background: linear-gradient(135deg, var(--tab-color, #6366f1) 0%, color-mix(in srgb, var(--tab-color, #6366f1) 80%, #8b5cf6) 100%);
  color: white;
  box-shadow: 
    0 4px 15px -3px color-mix(in srgb, var(--tab-color, #6366f1) 50%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Tab count badge */
.sidebar-tab-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  transition: all 0.3s;
}

.sidebar-tab:not(.active) .sidebar-tab-count {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

/* ========================================
   SIDEBAR MODULE ITEMS
   ======================================== */

.module-nav-item,
.sidebar-module-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(145deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 6px;
  text-align: left;
  width: 100%;
  
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: inherit;
}

.module-nav-item:hover,
.sidebar-module-item:hover {
  background: linear-gradient(145deg, var(--color-surface-elevated) 0%, var(--color-surface) 100%);
  border-color: var(--color-border);
  transform: translateX(4px);
}

.module-nav-item.active,
.sidebar-module-item.active {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: color-mix(in srgb, var(--module-color, #6366f1) 40%, transparent);
  box-shadow: 
    0 4px 15px -5px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.module-nav-item.active::before,
.sidebar-module-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--module-color, #6366f1);
  border-radius: 0 2px 2px 0;
}

/* Module icon */
.module-nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.3s;
}

.module-nav-item.active .module-nav-icon,
.sidebar-module-item.active .module-nav-icon {
  background: color-mix(in srgb, var(--module-color, #6366f1) 15%, var(--color-surface));
  border-color: color-mix(in srgb, var(--module-color, #6366f1) 30%, transparent);
}

/* ========================================
   SIDEBAR TASK ITEMS
   ======================================== */

.sidebar-task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
}

.sidebar-task-item:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
}

.sidebar-task-checkbox {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  background: transparent;
  margin-top: 1px;
  
  -webkit-appearance: none;
  appearance: none;
}

.sidebar-task-item:hover .sidebar-task-checkbox {
  border-color: var(--color-text-dim);
}

.sidebar-task-item.complete .sidebar-task-checkbox {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.sidebar-task-text {
  font-size: 0.80rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  transition: color 0.2s;
}

.sidebar-task-item:hover .sidebar-task-text {
  color: var(--color-text);
}

.sidebar-task-item.complete .sidebar-task-text {
  color: var(--color-text-dim);
  text-decoration: line-through;
}

/* ========================================
   BUTTON RESET FOR ELECTRON
   ======================================== */

button {
  -webkit-appearance: none;
  appearance: none;
}

.modal-close {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-border-hover);
}