/* ════════════════════════════════════════════════════════════════════
 *  inline-edit-v1.css — Édition inline HYDPOLL
 * ════════════════════════════════════════════════════════════════════
 *  Styles cohérents pour les éléments [data-inline-edit].
 *  Palette HYDPOLL : navy #0B2140 · bleu #2471a3 · bleu clair #5dade2
 * ════════════════════════════════════════════════════════════════════ */

.hyd-inline {
  position: relative;
  display: inline-block;
  cursor: text;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
  min-width: 30px;
  min-height: 1.2em;
  user-select: text;
}

/* Hover : background subtil + icône ✏ apparaît */
.hyd-inline:hover {
  background: #f0f7fd;
  border-color: #cfe2f3;
}
.hyd-inline:hover::after {
  content: '✏';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #2471a3;
  opacity: .8;
  pointer-events: none;
}
.hyd-inline:focus-visible {
  outline: 2px solid #5dade2;
  outline-offset: 2px;
  background: #e8f4fd;
}

/* État édition active */
.hyd-inline.hyd-inline-editing {
  background: #fff;
  border-color: #2471a3;
  box-shadow: 0 0 0 3px rgba(36, 113, 163, .14);
  padding: 0;
}
.hyd-inline.hyd-inline-editing:hover::after,
.hyd-inline.hyd-inline-editing::after {
  display: none;
}

/* Input/textarea/select dans le wrapper */
.hyd-inline-input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: inherit;
  padding: 3px 8px;
  box-sizing: border-box;
  resize: vertical;
  min-height: 1.5em;
}
.hyd-inline-input::placeholder {
  color: #94a3b8;
  font-style: italic;
}
.hyd-inline-input:focus {
  outline: 0;
}
textarea.hyd-inline-input {
  display: block;
  font-family: inherit;
  line-height: 1.5;
}
select.hyd-inline-input {
  padding: 3px 24px 3px 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #2471a3 50%), linear-gradient(135deg, #2471a3 50%, transparent 50%);
  background-position: calc(100% - 12px) center, calc(100% - 7px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* État sauvegarde en cours */
.hyd-inline.hyd-inline-saving {
  background: #f0f7fd;
  border-color: #5dade2;
  pointer-events: none;
}
.hyd-inline.hyd-inline-saving::before {
  content: '';
  position: absolute;
  left: -2px; top: -2px; right: -2px; bottom: -2px;
  border-radius: 5px;
  border: 2px solid transparent;
  border-top-color: #2471a3;
  border-right-color: #2471a3;
  animation: hyd-inline-spin .8s linear infinite;
  pointer-events: none;
}
@keyframes hyd-inline-spin {
  to { transform: rotate(360deg); }
}

/* Valeur vide → placeholder visible */
.hyd-inline:empty::before {
  content: attr(data-inline-placeholder);
  color: #94a3b8;
  font-style: italic;
}

/* Disabled */
.hyd-inline[data-inline-disabled="true"] {
  cursor: default;
  opacity: .65;
}
.hyd-inline[data-inline-disabled="true"]:hover {
  background: transparent;
  border-color: transparent;
}
.hyd-inline[data-inline-disabled="true"]:hover::after {
  display: none;
}

/* Variante block (utile dans les fiches/cards) */
.hyd-inline.is-block {
  display: block;
  width: 100%;
  padding: 6px 10px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .hyd-inline,
  .hyd-inline-input,
  .hyd-inline.hyd-inline-saving::before {
    transition: none !important;
    animation: none !important;
  }
}
