/* ===== SCRUM ROLE SIMULATOR - ESTILOS ESPECÍFICOS ===== */

/* ===== DARK THEME FIXES ===== */
[data-theme="dark"] .responsibility-table td {
  color: var(--text);
}

[data-theme="dark"] .resp-primary {
  background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .resp-secondary {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .quiz-question-text {
  color: var(--text);
}

[data-theme="dark"] .quiz-context {
  background: rgba(102, 126, 234, 0.15);
  color: var(--text);
}

[data-theme="dark"] .quiz-feedback.correct {
  background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .quiz-feedback.incorrect {
  background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .feedback-text {
  color: var(--text);
}

[data-theme="dark"] .conflict-solution,
[data-theme="dark"] .conflict-detail {
  color: var(--text);
}

[data-theme="dark"] .conflict-role-action {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .conflict-role-action h5 {
  color: var(--text);
}

[data-theme="dark"] .role-progress-item {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .achievement {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .achievement.unlocked {
  background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .history-item {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .modal-content {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .scenario-card {
  background: var(--surface);
}

[data-theme="dark"] .scenario-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .conflict-card {
  background: var(--surface);
}

[data-theme="dark"] .conflict-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .quiz-option {
  color: var(--text);
}

[data-theme="dark"] .role-detail {
  color: var(--text);
}

[data-theme="dark"] .role-detail ul {
  color: var(--text);
}

[data-theme="dark"] .role-detail p,
[data-theme="dark"] .role-detail h4,
[data-theme="dark"] .role-detail h5 {
  color: var(--text);
}

[data-theme="dark"] .answer-review {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .answer-review.correct {
  background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .answer-review.incorrect {
  background: rgba(239, 68, 68, 0.1);
}

/* ===== ROLES GRID ===== */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.role-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.role-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.role-card:hover::before {
  transform: scaleX(1);
}

.role-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.role-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.role-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.role-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.role-focus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.focus-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.focus-value {
  font-weight: 600;
  color: var(--primary);
}

/* ===== RESPONSIBILITY TABLE ===== */
.table-container {
  overflow-x: auto;
}

.responsibility-table {
  width: 100%;
  border-collapse: collapse;
}

.responsibility-table th {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
}

.responsibility-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.responsibility-table tr:hover td {
  background: rgba(102, 126, 234, 0.05);
}

.resp-primary {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  font-weight: 600;
}

.resp-secondary {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.resp-none {
  color: var(--muted);
}

/* ===== SCENARIO FILTER ===== */
.scenario-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text);
}

.filter-btn:hover {
  border-color: var(--primary);
}

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

/* ===== SCENARIOS GRID ===== */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.scenario-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.scenario-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.scenario-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.scenario-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.scenario-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.scenario-roles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.scenario-role-tag {
  padding: 4px 10px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--primary);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

/* ===== QUIZ ===== */
.quiz-config {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.quiz-config .form-group {
  margin-bottom: 0;
  min-width: 150px;
}

.quiz-container {
  max-width: 800px;
  margin: 0 auto;
}

.quiz-progress {
  margin-bottom: 24px;
}

.progress-text {
  display: block;
  text-align: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.quiz-question {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.quiz-question-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.quiz-context {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 12px;
  padding: 12px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option .option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.quiz-option:hover:not(.disabled) .option-key {
  background: var(--primary);
  color: white;
}

.quiz-option:hover:not(.disabled) {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.05);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.quiz-option.disabled {
  cursor: default;
  opacity: 0.7;
}

.quiz-feedback {
  padding: 20px;
  border-radius: var(--radius);
  margin: 20px 0;
}

.quiz-feedback.correct {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
}

.quiz-feedback.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--danger);
}

.feedback-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.feedback-text {
  line-height: 1.6;
}

.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ===== QUIZ RESULT ===== */
.quiz-result {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.result-header {
  margin-bottom: 24px;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-score {
  margin-bottom: 24px;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-breakdown {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-answers {
  max-width: 600px;
  margin: 0 auto 24px;
  text-align: left;
}

/* ===== CONFLICTS ===== */
.conflicts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.conflict-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.conflict-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.conflict-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.conflict-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.conflict-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.conflict-severity {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.conflict-severity.severe {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.conflict-severity.moderate {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.conflict-severity.mild {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.conflict-modal {
  max-width: 800px;
}

.conflict-detail {
  margin-bottom: 24px;
}

.conflict-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.conflict-detail-desc {
  color: var(--muted);
  margin-bottom: 16px;
}

.conflict-solution {
  background: rgba(16, 185, 129, 0.05);
  border-left: 4px solid var(--success);
  padding: 16px;
  border-radius: 0 8px 8px 0;
}

.conflict-solution h4 {
  color: var(--success);
  margin-bottom: 8px;
}

.conflict-role-actions {
  margin-top: 24px;
}

.conflict-role-action {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.conflict-role-action h5 {
  font-weight: 600;
  margin-bottom: 8px;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ===== ROLE PROGRESS ===== */
.role-progress-grid {
  display: grid;
  gap: 16px;
}

.role-progress-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.role-progress-icon {
  font-size: 2rem;
}

.role-progress-info {
  flex: 1;
}

.role-progress-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.role-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.role-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

.role-progress-score {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===== ACHIEVEMENTS ===== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.achievement {
  text-align: center;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.achievement.locked {
  opacity: 0.5;
}

.achievement.unlocked {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.achievement-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ===== HISTORY ===== */
.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
}

.history-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.history-score {
  font-weight: 600;
}

.stats-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ===== HIDDEN ===== */
.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .roles-grid {
    grid-template-columns: 1fr;
  }
  
  .scenarios-grid {
    grid-template-columns: 1fr;
  }
  
  .quiz-config {
    flex-direction: column;
  }
  
  .quiz-config .form-group {
    width: 100%;
  }
  
  .conflicts-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}