/**
 * 🎨 Styles pour le panneau de correction IA linguistique
 */

/* Panneau de correction flottant */
.ai-correction-panel {
  position: fixed;
  right: 20px;
  bottom: 120px;
  width: 380px;
  max-height: 500px;
  overflow-y: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
  z-index: 1000;
  font-family: 'Source Serif 4', serif;
}

.ai-correction-panel::-webkit-scrollbar {
  width: 8px;
}

.ai-correction-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.ai-correction-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.ai-correction-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Élément de correction */
.ai-correction-item {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* En-tête correction */
.correction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
}

.correction-time {
  color: #718096;
  font-weight: 500;
}

.correction-score {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 11px;
}

/* Contenu correction */
.correction-content {
  margin-bottom: 12px;
}

.correction-original {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #2d3748;
  line-height: 1.5;
}

.correction-original strong {
  color: #667eea;
}

.correction-suggested {
  margin: 8px 0;
  font-size: 14px;
  color: #10b981;
  background: #d1fae5;
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.5;
}

.correction-suggested strong {
  color: #059669;
}

/* Erreurs */
.correction-errors {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.correction-errors strong {
  color: #991b1b;
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.correction-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.correction-errors li {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  align-items: flex-start;
}

.correction-errors li:last-child {
  margin-bottom: 0;
}

/* Types d'erreurs */
.error-grammar {
  border-left: 3px solid #f59e0b;
  padding-left: 8px;
}

.error-spelling {
  border-left: 3px solid #ef4444;
  padding-left: 8px;
}

.error-pronunciation {
  border-left: 3px solid #8b5cf6;
  padding-left: 8px;
}

.error-tone {
  border-left: 3px solid #06b6d4;
  padding-left: 8px;
}

.error-type {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
  min-width: 60px;
}

.error-detail {
  color: #7f1d1d;
  flex: 1;
}

/* Succès */
.correction-success {
  background: #dcfce7;
  border-left: 4px solid #22c55e;
  padding: 12px;
  border-radius: 6px;
  color: #166534;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
}

/* Feedback pédagogique */
.correction-feedback {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  border-left: 4px solid #f59e0b;
  padding: 12px;
  border-radius: 6px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

.correction-feedback strong {
  color: #b45309;
}

/* Toggle panneau */
.ai-correction-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-correction-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.ai-correction-toggle:active {
  transform: scale(0.95);
}

/* Bannière avertissement */
.ai-warning-banner {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Mode responsive */
@media (max-width: 768px) {
  .ai-correction-panel {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    max-height: 400px;
  }

  .ai-correction-toggle {
    right: 15px;
    bottom: 15px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

/* Stats panel */
.ai-stats-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ai-stats-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-stats-header {
  text-align: center;
  margin-bottom: 30px;
}

.ai-stats-header h2 {
  font-size: 28px;
  color: #1f2937;
  margin: 0 0 10px 0;
}

.ai-stats-header p {
  color: #6b7280;
  margin: 0;
}

.ai-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.ai-stat-card {
  background: linear-gradient(135deg, #f0f4ff 0%, #f5f0ff 100%);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.ai-stat-value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}

.ai-stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-errors-breakdown {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.ai-errors-breakdown h3 {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
}

.ai-error-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.ai-error-item:last-child {
  border-bottom: none;
}

.ai-error-name {
  font-size: 13px;
  color: #4b5563;
  font-weight: 500;
}

.ai-error-count {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.ai-stats-actions {
  display: flex;
  gap: 12px;
}

.ai-stats-actions button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-stats-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.ai-stats-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.ai-stats-actions .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.ai-stats-actions .btn-secondary:hover {
  background: #e5e7eb;
}
