/* ═══════════════════════════════════════════════════════════════
   vo-potions.css — Catalogue de recettes
   Adapté de vo-sorts.css avec préfixe pot-
   ═══════════════════════════════════════════════════════════════ */

#main { padding-top: 70px; display: block !important; }

/* ─── Bouton Nouveau ─── */
.btn-nouveau {
    background: #c8e6c9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
    border-radius: 5px;
    padding: 5px 14px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-nouveau:hover { background: #a5d6a7; }
.btn-gerer {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 5px;
    padding: 5px 14px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}
.btn-gerer:hover { background: #ffe0b2; }

/* ─── Sticky Search Header ─── */
.pot-sticky-header {
    position: sticky;
    top: 56px;
    z-index: 5;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    border-radius: 8px 8px 0 0;
    max-width: 900px;
    margin: 0 auto;
}
.pot-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: center;
    padding: 8px 14px 10px 14px;
}
.pot-recherche-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 1 250px;
    min-width: 140px;
    gap: 4px;
}
.pot-recherche-wrap input[type="text"] {
    flex: 1;
    padding: 6px 30px 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
}
.pot-recherche-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2em;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.pot-recherche-clear:hover { color: #333; }
.pot-filtres select {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9em;
    background: #fff;
}

/* Toggle */
.pot-toggle-label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.9em;
    user-select: none;
}
.pot-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: #bbb;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.pot-toggle-on { background: #4caf50; }
.pot-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.pot-toggle-on .pot-toggle-knob { left: 20px; }

/* ─── Liste ─── */
#pot-liste { max-width: 900px; margin: 0 auto; }

.pot-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 4px 8px;
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
    background: #fff;
}
.pot-card:hover { background: #eef5ff; border-color: #aac8e8; }
.pot-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.pot-card-nom { font-weight: bold; font-size: 0.95em; }
.pot-card-desc {
    font-size: 0.85em;
    color: #444;
    margin: 4px 0 2px 0;
    padding-left: 4px;
    border-left: 2px solid #ddd;
}
.pot-card-ing {
    font-size: 0.82em;
    color: #555;
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Badges */
.pot-badge {
    font-size: 0.78em;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: bold;
}
.pot-badge-type[data-type="herb"] { background: #e8f5e9; color: #1b5e20; }
.pot-badge-type[data-type="alch"] { background: #e3f2fd; color: #0d47a1; }
.pot-badge-type[data-type="poi"]  { background: #fce4ec; color: #880e4f; }
.pot-badge-force { background: #f3e5f5; color: #4a148c; }
.pot-badge-duree { background: #fffde7; color: #827717; font-weight: normal; }
.pot-badge-hidden { background: #ffecb3; color: #e65100; }

/* Pastilles ingrédients : voir css/ingredients-pills.css */

/* ─── Popup détail ─── */
.pot-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pot-popup-box {
    background: #fff;
    max-width: 700px;
    width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 20px 24px;
}
.pot-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
    gap: 8px;
}
.pot-popup-header strong { font-size: 1.15em; }
.pot-popup-fermer {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0 4px;
}
.pot-popup-fermer:hover { color: #333; }

.pot-popup-infos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f8f8f8;
    border-radius: 6px;
}
.pot-popup-info-item { display: flex; flex-direction: column; }
.pot-popup-info-item.full-width { grid-column: 1 / -1; }
.pot-popup-info-label {
    font-size: 0.78em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pot-popup-info-val {
    font-size: 0.92em;
    color: #333;
    font-weight: 500;
}
.edit-btn-inline {
    font-size: 0.9em;
    cursor: pointer;
    opacity: 0.6;
    margin-left: 4px;
    background: none;
    border: none;
    padding: 0;
}
.edit-btn-inline:hover { opacity: 1; }

.pot-texte-long {
    max-height: 100px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s;
}
.pot-texte-long.expanded { max-height: none; }
.pot-texte-toggle {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 0.82em;
    padding: 2px 0;
}

/* Section ingrédients dans popup */
.pot-popup-ing {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8f8f8;
    border-radius: 6px;
}
.pot-popup-ing-titre {
    font-size: 0.78em;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pot-popup-ing-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Editeur ingrédients (admin) */
.pot-ing-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pot-ing-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pot-ing-row select,
.pot-ing-row input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.88em;
}
.pot-ing-row input[type="number"] { width: 70px; }
.pot-ing-row .btn-x {
    background: none;
    border: none;
    color: #c62828;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 4px;
}
.btn-add-ing {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    align-self: flex-start;
}
.btn-add-ing:hover { background: #c8e6c9; }

/* Admin actions */
.pot-popup-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.btn-supprimer {
    border: 1px solid #e57373;
    background: #ffebee;
    color: #b71c1c;
    border-radius: 5px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.88em;
}
.btn-supprimer:hover { background: #ffcdd2; }

/* Inline editor */
.pot-inline-editor {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 2px;
    flex-wrap: wrap;
}
.pot-inline-editor input,
.pot-inline-editor textarea,
.pot-inline-editor select {
    flex: 1;
    min-width: 140px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}
.pot-inline-editor textarea {
    min-height: 100px;
    font-family: inherit;
    line-height: 1.4;
}
.pot-inline-editor .btn-ie {
    border: 1px solid #ccc;
    background: #f8f8f8;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.85em;
}
.pot-inline-editor .btn-ie:hover { background: #eee; }

/* ─── Formulaire création / éditeur ingrédients ─── */
.pot-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pot-form-card {
    background: #fff;
    max-width: 700px;
    width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 20px 24px;
}
.pot-form-card h2 { margin: 0 0 12px; font-size: 1.15em; }
.pot-form-group {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.pot-form-group label {
    font-size: 0.78em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: bold;
}
.pot-form-group input,
.pot-form-group textarea,
.pot-form-group select {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
}
.pot-form-group textarea { min-height: 100px; line-height: 1.4; }
.pot-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pot-form-row > .pot-form-group { flex: 1 1 200px; }
.pot-form-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92em;
}
.pot-form-checkbox input { width: auto; }
.pot-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.btn-cancel {
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    padding: 5px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}
.btn-cancel:hover { background: #ddd; }
.btn-save {
    background: #c8e6c9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
    padding: 5px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
}
.btn-save:hover { background: #a5d6a7; }

/* Vide */
.pot-vide {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 30px 20px;
}

/* Toaster */
#pot-toaster {
    position: fixed;
    top: 50px;
    left: 25%;
    width: 50%;
    padding: 10px 16px;
    background: #f8e5c5;
    color: #000;
    z-index: 2000;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: pot-toast-in 0.3s ease;
}
@keyframes pot-toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Liste ingrédients (modal "Gérer ingrédients") */
.pot-ing-mgr-row {
    display: grid;
    grid-template-columns: 60px 80px 1fr 30px;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}
.pot-ing-mgr-row input[type="text"],
.pot-ing-mgr-row select {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.88em;
}
.pot-ing-mgr-row .btn-save-ing {
    background: #c8e6c9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

/* Responsive */
@media (max-width: 650px) {
    .pot-sticky-header { top: 36px; }
    .pot-filtres { gap: 6px 8px; padding: 6px 10px; }
    .pot-recherche-wrap { flex-basis: 100%; }
    .pot-filtres select { font-size: 0.82em; }
    .btn-nouveau, .btn-gerer { padding: 4px 10px; font-size: 0.82em; }
    .pot-popup-infos { grid-template-columns: 1fr; }
    .pot-popup-box, .pot-form-card { width: 96vw; padding: 14px 16px; }
    .pot-form-row { flex-direction: column; }
}
