/**
 * Visionneuse de correction TCF Writing Simulator - Design moderne et épuré
 * Palette : #1363DF (primaire), #12BB6A (succès), #082A5E (sombre)
 */

/* Variables CSS */
:root {
  --primary: #1363df;
  --success: #12bb6a;
  --warning: #f59e0b;
  --error: #ef4444;
  --dark: #082a5e;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* Reset et base */
.tcf-correction-viewer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--gray-700);
  /* background: var(--gray-50); */
  min-height: 100vh;
}

/* En-tête de correction */
.tcf-correction-header {
  background: linear-gradient(
    135deg,
    rgba(8, 42, 94, 0.05) 0%,
    rgba(19, 99, 223, 0.05) 100%
  );
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}

.tcf-correction-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
}

.tcf-work-info h2 {
  color: var(--dark);
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.tcf-work-info p {
  margin: 0.5rem 0;
  color: var(--gray-600);
  font-size: 1rem;
}

.tcf-work-info strong {
  color: var(--primary);
  font-weight: 600;
}

/* Bouton de retour */
.tcf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.tcf-btn-secondary {
  background: var(--gray-500);
  color: white;
}

.tcf-btn-secondary:hover {
  background: var(--dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hero section avec score principal - Design capture d'écran */
.tcf-global-summary {
  background: white;
  border-radius: 1rem;
  padding: 0;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.tcf-score-card {
  background: #f8fafc;
  padding: 2rem;
  text-align: center;
  border-radius: 1rem;
  margin: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tcf-score-header {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 1rem;
}

.tcf-score-number {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  margin-bottom: 1rem;
}

.tcf-level-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}

.tcf-level-icon {
  font-size: 1rem;
}

.tcf-level-text {
  color: var(--primary);
}

/* Version erreur */
.tcf-score-card.tcf-score-error {
  background: #fef2f2;
}

.tcf-score-card.tcf-score-error .tcf-score-number {
  color: var(--error);
}

.tcf-error-message {
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Grille de métriques moderne */
.tcf-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  background: white;
}

.tcf-metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--gray-50);
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.tcf-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.tcf-metric-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.tcf-icon-success {
  background: var(--success);
  color: white;
  font-size: 1.25rem;
}

.tcf-icon-score {
  background: var(--primary);
  color: white;
  font-size: 0.875rem;
}

.tcf-icon-words {
  background: var(--gray-200);
  font-size: 1.25rem;
}

.tcf-icon-warning {
  background: var(--warning);
  color: white;
  font-size: 1.25rem;
}

.tcf-metric-content {
  flex: 1;
}

.tcf-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.tcf-metric-total {
  font-size: 1rem;
  color: var(--gray-500);
  font-weight: 500;
}

.tcf-metric-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

.tcf-metric-warning {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.05);
}

/* Barre de progression */
.tcf-progress-bar {
  padding: 2rem;
  background: white;
  border-top: 1px solid var(--gray-200);
}

.tcf-progress-label {
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 1rem;
}

.tcf-progress-container {
  width: 100%;
  height: 0.75rem;
  background: var(--gray-200);
  border-radius: 0.375rem;
  overflow: hidden;
  position: relative;
}

.tcf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: 0.375rem;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tcf-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Sections de tâches */
.tcf-task-item {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--success);
  transition: all 0.2s ease;
}

.tcf-task-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.tcf-task-item.task-failed {
  border-left-color: var(--error);
}

.tcf-task-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 2rem;
}

.tcf-task-header h4 {
  color: var(--dark);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.tcf-task-header p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

/* Statut des tâches */
.tcf-task-status {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
}

.tcf-status-success {
  background: rgba(18, 187, 106, 0.05);
  border-color: rgba(18, 187, 106, 0.2);
}

.tcf-status-error {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

.tcf-status-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tcf-status-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  font-weight: 600;
}

.tcf-status-icon.success {
  background: var(--success);
}

.tcf-status-icon.error {
  background: var(--error);
}

.tcf-status-title {
  color: var(--dark);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.tcf-status-subtitle {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0.25rem 0 0 0;
}

.tcf-task-score-display {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
}

.tcf-main-score-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.tcf-score-level {
  font-size: 1.125rem;
  color: var(--success);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tcf-score-words {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Réponse utilisateur */
.tcf-user-response {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--gray-50);
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
}

.tcf-user-response h5 {
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tcf-response-text {
  padding: 1.5rem;
  background: white;
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary);
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.6;
  color: var(--gray-700);
  font-size: 0.875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tcf-response-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--gray-100);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

/* Critères d'évaluation - Accordion */
.tcf-criterion {
  margin-bottom: 1rem;
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all 0.2s ease;
}

.tcf-criterion:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tcf-criterion-header {
  padding: 1.5rem;
  cursor: pointer;
  background: var(--gray-50);
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.tcf-criterion-header:hover {
  background: rgba(19, 99, 223, 0.05);
}

.tcf-criterion-header::after {
  content: "▼";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.tcf-criterion.expanded .tcf-criterion-header::after {
  transform: translateY(-50%) rotate(180deg);
}

.tcf-criterion-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tcf-criterion-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 600;
}

.tcf-criterion-icon.excellent {
  background: var(--success);
}

.tcf-criterion-icon.good {
  background: var(--warning);
}

.tcf-criterion-icon.poor {
  background: var(--error);
}

.tcf-criterion-text h6 {
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.tcf-criterion-score {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.tcf-criterion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.tcf-criterion.expanded .tcf-criterion-content {
  max-height: 500px;
}

.tcf-criterion-inner {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.tcf-analysis-points {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tcf-analysis-point {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.tcf-point-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.125rem;
}

.tcf-point-icon.positive {
  color: var(--success);
}

.tcf-point-icon.negative {
  color: var(--error);
}

.tcf-point-icon.neutral {
  color: var(--gray-500);
}

.tcf-point-text {
  flex: 1;
  color: var(--gray-700);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Sections additionnelles */
.tcf-methodology,
.tcf-errors,
.tcf-strengths,
.tcf-advice,
.tcf-corrected-text {
  margin-bottom: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.tcf-methodology-header,
.tcf-errors-header,
.tcf-strengths-header,
.tcf-advice-header,
.tcf-corrected-header {
  padding: 1.5rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.tcf-section-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tcf-section-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 600;
}

.tcf-section-icon.errors {
  background: var(--error);
}

.tcf-section-icon.strengths {
  background: var(--success);
}

.tcf-section-icon.advice {
  background: var(--primary);
}

.tcf-section-title {
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.tcf-section-subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.tcf-methodology-content,
.tcf-errors-content,
.tcf-strengths-content,
.tcf-advice-content,
.tcf-corrected-content {
  padding: 1.5rem;
}

/* Conseils spéciaux */
.tcf-advice {
  background: rgba(19, 99, 223, 0.03);
  border-left: 3px solid var(--primary);
}

.tcf-advice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tcf-advice-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.tcf-advice-icon {
  color: var(--primary);
  font-size: 0.75rem;
  margin-top: 0.125rem;
  font-weight: 600;
}

/* Texte corrigé */
.tcf-corrected-text {
  background: linear-gradient(
    135deg,
    rgba(18, 187, 106, 0.05) 0%,
    transparent 100%
  );
  border-left: 3px solid var(--success);
}

.tcf-corrected-content div {
  padding: 1.5rem;
  white-space: pre-wrap;
  font-family: inherit;
  color: #065f46;
  font-size: 0.875rem;
  line-height: 1.6;
  background: white;
  border-radius: 0.5rem;
  border-left: 3px solid var(--success);
}

/* Messages d'erreur */
.tcf-error-message {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(239, 68, 68, 0.05);
  border-radius: 0.75rem;
  border-left: 4px solid var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.tcf-error-title {
  color: #7f1d1d;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tcf-error-details {
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.detail-label {
    color: #22c55e;
}

.tcf-error-text {
  margin: 0;
  color: #7f1d1d;
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  word-break: break-word;
}
.tcf-correction-viewer .wrapper__container .header {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}
.detail-value, .positive, .negative {
    font-family: "Poppins", sans-serif;
}
.points-forts, .conseils {
    padding-bottom: 15px;
}
/* Responsive */
@media (max-width: 768px) {
  .tcf-correction-viewer {
    padding: 1rem;
  }
  .score-content {
    box-shadow: none;
  }
  .points-forts li {
    padding: 0;
    font-weight: 400;
  }
  .points-forts li svg {
    display: none;
  }
  .wrapper__container {
    padding: 0;
  }

  .tcf-score-number {
    font-size: 3rem;
  }

  .tcf-metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

  .tcf-task-item {
    padding: 1.5rem;
  }

  .tcf-correction-header {
    padding: 1.5rem;
  }

  .tcf-work-info h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .tcf-correction-viewer {
    padding: 0;
  }

  .tcf-score-number {
    font-size: 2.5rem;
  }

  .tcf-metrics-grid {
    padding: 1rem;
  }

  .tcf-task-item {
    padding: 1rem;
  }

  .tcf-correction-header {
    padding: 1rem;
  }

  .tcf-level-badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
}

/* Message d'absence de corrections */
.tcf-no-corrections-info {
  text-align: center;
  padding: 2rem;
  background: rgba(245, 158, 11, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin: 1rem 0;
}

.tcf-no-corrections-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.tcf-no-corrections-title {
  color: #92400e;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.tcf-no-corrections-text {
  color: #92400e;
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
  opacity: 0.8;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tcf-correction-viewer {
  animation: fadeInUp 0.6s ease-out;
}
