/**
 * Scenario Challenges Styles
 */

/* ============================================ */
/* Challenge Container */
/* ============================================ */

.challenge-container {
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  max-width: 800px;
  margin: 2rem auto;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.challenge-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.challenge-difficulty {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.challenge-category {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: capitalize;
}

.challenge-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, rgba(91, 138, 255, 0.1), rgba(118, 221, 255, 0.1));
  border: 1px solid rgba(91, 138, 255, 0.3);
  border-radius: 24px;
}

.timer-icon {
  font-size: 1.2rem;
}

.timer-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  min-width: 40px;
  text-align: center;
}

/* ============================================ */
/* Challenge Content */
/* ============================================ */

.challenge-content {
  margin-bottom: 2rem;
}

.challenge-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.challenge-description {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.challenge-chart {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

.challenge-chart img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.challenge-context {
  background: rgba(91, 138, 255, 0.1);
  border-left: 4px solid var(--brand);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.challenge-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 1rem 0;
}

/* ============================================ */
/* Challenge Options */
/* ============================================ */

.challenge-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.challenge-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 1rem;
  color: var(--text);
  width: 100%;
}

.challenge-option:hover:not(:disabled) {
  background: rgba(91, 138, 255, 0.1);
  border-color: rgba(91, 138, 255, 0.5);
  transform: translateX(8px);
}

.challenge-option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #5b8aff, #76ddff);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  line-height: 1.5;
}

.challenge-option.correct {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.5);
  animation: correctPulse 0.5s ease;
}

.challenge-option.correct .option-letter {
  background: linear-gradient(135deg, #22c55e, #10b981);
}

.challenge-option.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  animation: incorrectShake 0.5s ease;
}

.challenge-option.incorrect .option-letter {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes incorrectShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* ============================================ */
/* Challenge Result */
/* ============================================ */

.challenge-result {
  margin-top: 2rem;
}

.challenge-result-content {
  border-radius: 12px;
  padding: 2rem;
  animation: slideUp 0.5s ease;
}

.result-correct {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
  border: 2px solid rgba(34, 197, 94, 0.3);
}

.result-incorrect {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
  border: 2px solid rgba(239, 68, 68, 0.3);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-icon {
  font-size: 3rem;
  line-height: 1;
}

.result-status {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.result-score {
  text-align: center;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.result-score-value {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.result-score-label {
  font-size: 1rem;
  color: var(--muted);
}

.result-explanation {
  margin: 1.5rem 0;
}

.result-explanation h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.result-explanation p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.result-stats {
  display: flex;
  gap: 2rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.result-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.result-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
}

.result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.result-actions .btn {
  flex: 1;
}

/* ============================================ */
/* Challenges Hub */
/* ============================================ */

.challenges-hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.challenges-header {
  text-align: center;
  margin-bottom: 3rem;
}

.challenges-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.challenges-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
}

.challenges-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand);
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.challenge-card {
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.challenge-card:hover {
  border-color: rgba(91, 138, 255, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(91, 138, 255, 0.15);
}

.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.challenge-card-difficulty {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.challenge-card-category {
  font-size: 0.85rem;
  color: var(--muted);
}

.challenge-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.challenge-card-description {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.challenge-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.challenge-card-points {
  font-size: 0.9rem;
  color: var(--brand);
  font-weight: 600;
}

.challenge-card-time {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================ */
/* Stats Dashboard */
/* ============================================ */

.challenges-stats {
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-box {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(91, 138, 255, 0.1), rgba(118, 221, 255, 0.1));
  border: 1px solid rgba(91, 138, 255, 0.2);
  border-radius: 12px;
}

.stat-box-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #5b8aff, #76ddff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.stat-box-label {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ============================================ */
/* Responsive Design */
/* ============================================ */

@media (max-width: 768px) {
  .challenge-container {
    padding: 1.5rem 1rem;
  }

  .challenge-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .challenge-title {
    font-size: 1.5rem;
  }

  .challenge-option {
    padding: 1rem;
  }

  .option-letter {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .challenges-filters {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .challenges-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
