/* sosa_app.css — Wouf 2024 */

.sosa_app {
  font-family: Georgia, serif;
  max-width: 580px;
  margin: 0 auto;
  padding: 10px 0 40px;
}

/* ── En-tête ── */
.sosa-header {
  text-align: center;
  margin-bottom: 28px;
}

.sosa-header h2 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1c1a17;
}

.sosa-header h2 em {
  color: #8b4513;
  font-style: italic;
}

.sosa-subtitle {
  margin-top: 6px;
  color: #8a8070;
  font-size: 0.95rem;
  font-style: italic;
}

.sosa-divider {
  width: 50px;
  height: 2px;
  background: linear-gradient(to right, #8b4513, #c17f3a);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ── Carte ── */
.sosa-card {
  background: #ffffff;
  border: 1px solid #ddd8ce;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

/* ── Saisie ── */
.sosa-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#sosa-saisie {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1.15rem;
  padding: 10px 14px;
  border: 2px solid #ddd8ce;
  border-radius: 7px;
  background: #f7f4ef;
  color: #1c1a17;
  outline: none;
  transition: border-color .2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#sosa-saisie:focus {
  border-color: #8b4513;
}

#sosa-saisie::placeholder {
  color: #8a8070;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

.sosa-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 7px;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all .15s;
}

.sosa-btn-primary {
  background: #8b4513;
  color: #fff;
  font-weight: bold;
}

.sosa-btn-primary:hover {
  background: #6d3410;
  transform: translateY(-1px);
}

.sosa-btn-secondary {
  background: transparent;
  color: #8a8070;
  border: 1px solid #ddd8ce;
}

.sosa-btn-secondary:hover {
  background: #f7f4ef;
  color: #1c1a17;
}

/* ── Hint ── */
.sosa-hint {
  font-size: 0.83rem;
  color: #8a8070;
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
}

.sosa-hint code {
  font-family: 'Courier New', monospace;
  background: #f7f4ef;
  padding: 1px 5px;
  border-radius: 3px;
  font-style: normal;
  color: #8b4513;
}

/* ── Résultat ── */
#sosa-resultat {
  background: #f7f4ef;
  border-left: 3px solid #8b4513;
  border-radius: 0 7px 7px 0;
  padding: 18px 22px;
  min-height: 80px;
  margin-bottom: 24px;
  display: none;
  animation: sosaFadeIn .25s ease;
}

#sosa-resultat.visible {
  display: block;
}

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

.sosa-res-conversion {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: #c17f3a;
  margin-bottom: 10px;
  font-weight: bold;
}

.sosa-res-francais {
  font-size: 1rem;
  line-height: 1.7;
  color: #1c1a17;
}

.sosa-res-generation {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #8a8070;
  font-style: italic;
}

.sosa-res-erreur {
  color: #c0392b;
  font-style: italic;
}

/* ── Badges P/M ── */
#sosa-chaine-visuelle {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 12px;
}

.sosa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.95rem;
  animation: sosaBadgePop .2s ease both;
}

@keyframes sosaBadgePop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.sosa-badge-P {
  background: #dbeafe;
  color: #2a6496;
  border: 1px solid #bfdbfe;
}

.sosa-badge-M {
  background: #fde8d8;
  color: #8b4513;
  border: 1px solid #f4c6a0;
}

/* ── Historique ── */
.sosa-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a8070;
  margin-bottom: 8px;
}

#sosa-historique {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 190px;
  overflow-y: auto;
}

#sosa-historique li {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  padding: 7px 12px;
  background: #f7f4ef;
  border: 1px solid #ddd8ce;
  border-radius: 5px;
  cursor: pointer;
  color: #1c1a17;
  transition: all .15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#sosa-historique li:hover {
  border-color: #c17f3a;
  background: #fdf5ee;
}

#sosa-historique li .sosa-hi-arrow {
  color: #8a8070;
  font-size: 0.72rem;
}

#sosa-historique:empty::after {
  content: "Aucune conversion pour l'instant…";
  font-style: italic;
  color: #8a8070;
  font-family: Georgia, serif;
  font-size: 0.88rem;
  padding: 4px 0;
  display: block;
}
/* ── À ajouter à la fin de sosa_app.css ── */

/* Intro */
.sosa-intro {
  font-family: Georgia, serif;
  font-size: 0.97rem;
  line-height: 1.7;
  color: #3a3530;
  margin-bottom: 20px;
  max-width: 620px;
}

/* ── Bloc aide (details/summary) ── */
.aide {
  background: #fffdf9;
  border: 1px solid #ddd8ce;
  border-left: 4px solid #8b4513;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.aide summary {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: bold;
  color: #5a3010;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s;
}

.aide summary::-webkit-details-marker { display: none; }

.aide summary::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.85rem;
  color: #8b4513;
  transition: transform .2s;
}

.aide[open] summary::after {
  transform: rotate(90deg);
}

.aide summary:hover {
  background: #fdf5ee;
}

.aide-body {
  padding: 4px 22px 22px;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  color: #2a2520;
  line-height: 1.7;
}

.aide-body h3 {
  font-size: 0.95rem;
  color: #8b4513;
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: Georgia, serif;
}

.aide-body p {
  margin-bottom: 10px;
}

.aide-body code {
  font-family: 'Courier New', monospace;
  background: #f0ece4;
  padding: 1px 5px;
  border-radius: 3px;
  color: #8b4513;
  font-size: 0.9em;
}

.aide-body kbd {
  font-family: 'Courier New', monospace;
  background: #e8e2d8;
  border: 1px solid #c5bfb0;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
  color: #3a3530;
}

/* Blocs P / M */
.aide-bloc {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #f7f4ef;
  border-radius: 7px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e5dfd4;
}

.aide-bloc-icone {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.aide-bloc--sosa {
  border-left: 3px solid #2a6496;
}

.aide-bloc--pm {
  border-left: 3px solid #8b4513;
}

.aide-exemple {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #6a5a4a;
  font-style: italic;
}

/* Table */
.aide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 10px;
}

.aide-table th {
  background: #8b4513;
  color: #fff;
  padding: 7px 12px;
  text-align: left;
  font-weight: bold;
}

.aide-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #e5dfd4;
}

.aide-table tr:nth-child(even) td {
  background: #f7f4ef;
}

.aide-table td:first-child {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #8b4513;
}

.aide-table td:nth-child(2) {
  font-family: 'Courier New', monospace;
  color: #2a6496;
}
