/**
 * Styles pour le détecteur IA premium - Disposition verticale
 */

/* Classe utilitaire pour masquer les éléments */
.hidden {
  display: none !important;
}

/* Conteneur principal - Disposition verticale */
.ced-detector-premium-container {
  max-width: 800px;
  margin: 20px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Section formulaire (en haut) */
.ced-detector-premium-form-section {
  width: 100%;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  padding: 25px;
  display: flex;
  flex-direction: column;
}

/* Section résultats (en bas) */
.ced-detector-premium-results-section {
  width: 100%;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  padding: 25px;
}

/* Conteneur pour textarea et bouton corbeille */
.ced-detector-premium-textarea-container {
  position: relative;
  display: flex;
  align-items: stretch;
}

.ced-detector-premium-textarea {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  padding-right: 50px; /* Espace pour le bouton corbeille */
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.3s ease;
  background-color: #fff;
}

/* Bouton corbeille */
.ced-detector-premium-clear-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
  z-index: 2;
}

.ced-detector-premium-clear-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  transform: scale(1.05);
}

.ced-detector-premium-clear-btn:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.1);
}

.ced-detector-premium-clear-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 1;
}

/* Amélioration du footer du formulaire */
.ced-detector-premium-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.ced-detector-premium-word-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #666;
}

.ced-detector-premium-word-helper {
  font-weight: 600;
  transition: color 0.3s ease;
}

.ced-detector-premium-word-helper.warning {
  color: #e74c3c;
}

.ced-detector-premium-quota-info {
  font-size: 13px;
  color: #666;
  background: #f8f9fa;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

/* Informations - Disposition responsive pour mobile */
.ced-detector-premium-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  color: #555;
  font-size: 14px;
  padding: 0 2px;
}

.ced-detector-premium-info span {
  white-space: nowrap;
}

/* Zone d'information du compteur de mots */
.ced-detector-premium-word-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Aide dynamique pour le compteur de mots */
.ced-detector-premium-word-helper {
  font-size: 12px;
  font-style: italic;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.ced-detector-premium-word-helper.warning {
  color: #e74c3c;
  font-weight: 500;
}

.ced-detector-premium-word-helper.success {
  color: #27ae60;
}

.ced-detector-premium-word-helper.info {
  color: #3498db;
}

/* Bouton - Largeur optimisée pour disposition verticale */
.ced-detector-premium-button {
  display: inline-block;
  background-color: #2271b1;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 200px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ced-detector-premium-button:hover {
  background-color: #135e96;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.ced-detector-premium-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ced-detector-premium-button.disabled {
  background-color: #999;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Chargement */
.ced-detector-premium-loading {
  display: none;
  text-align: center;
  padding: 15px;
  color: #555;
  font-style: italic;
}

/* Résultats - Ajustement pour disposition verticale */
.ced-detector-premium-result {
  /* visible par défaut lorsqu'il est injecté dynamiquement */
}

.ced-detector-premium-result h3 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 18px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
  text-align: center;
}

.ced-detector-premium-result h4 {
  font-size: 16px;
  margin: 25px 0 12px;
  color: #333;
}

/* Visualisation texte complet - Optimisée pour disposition verticale */
.ced-detector-premium-full-text {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
  font-size: 15px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* Segments de texte analysés */
.ced-detector-text-segment {
  cursor: help;
  display: inline;
}

/* Score global - Optimisé pour disposition verticale */
.ced-detector-premium-global-score {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
}

.ced-detector-premium-score-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.ced-detector-premium-label {
  font-weight: bold;
  font-size: 16px;
  color: #333;
  text-align: center;
}

.ced-detector-premium-scores {
  display: flex;
  justify-content: space-around;
  gap: 20px;
}

.ced-detector-premium-scores .ai-score,
.ced-detector-premium-scores .human-score {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: #fff;
  border: 1px solid #ddd;
  flex: 1;
  text-align: center;
}

.ced-detector-premium-scores .ai-score {
  color: #721c24;
  border-color: #f5c6cb;
  background-color: #f8d7da;
}

.ced-detector-premium-scores .human-score {
  color: #155724;
  border-color: #c3e6cb;
  background-color: #d4edda;
}

/* Barre de score */
.ced-detector-premium-bar-container {
  height: 20px;
  background-color: #e9ecef;
  border-radius: 10px;
  overflow: visible; /* Pour que le triangle soit visible */
  position: relative;
  margin-top: 15px; /* Espace pour le triangle */
}

.ced-detector-premium-bar {
  height: 100%;
  transition: all 0.3s ease;
  /* Rouge (IA élevée) à gauche, vert (Humain) à droite */
  background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
  width: 100%;
  border-radius: 10px;
  position: relative;
}

/* Le trait vertical */
.ced-detector-premium-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: var(--ai-percentage, 0%);
  width: 3px;
  height: 100%;
  background-color: #000;
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  transition: left 0.3s ease;
}

/* Le triangle au-dessus */
.ced-detector-premium-cursor {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #000;
  position: absolute;
  top: -12px; /* Position au-dessus de la barre */
  transform: translateX(-50%);
  transition: left 0.3s ease;
  z-index: 1;
}

/* La jauge de progression */
.ced-detector-premium-progress {
  position: absolute;
  top: 5px; /* Même position que la barre */
  left: 0;
  height: 10px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  transition: width 0.3s ease;
}

/* Adaptation mobile pour disposition verticale */
@media (max-width: 768px) {
  .ced-detector-premium-container {
    margin: 10px;
    gap: 15px;
  }

  .ced-detector-premium-form-section,
  .ced-detector-premium-results-section {
    padding: 20px;
  }

  .ced-detector-premium-textarea {
    min-height: 150px;
    font-size: 16px; /* Éviter le zoom sur iOS */
  }

  .ced-detector-premium-info {
    flex-direction: column;
    gap: 5px;
    align-items: center;
  }

  .ced-detector-premium-word-info {
    text-align: center;
    flex-direction: column;
    gap: 5px;
  }

  .ced-detector-premium-word-helper {
    font-size: 11px;
  }

  .ced-detector-premium-button {
    width: 100%;
    max-width: none;
  }

  .ced-detector-premium-scores {
    flex-direction: column;
    gap: 10px;
  }
}
