/**
 * Alfred Cooking Panel — V0.8 phase 3 Sprint 2.
 *
 * Styles pour :
 *   - .alfred-cooking-chip      : chip discrète insérée dans renderStep()
 *                                 (cooking lightbox), au-dessus de la nav
 *   - .alfred-cooking-panel     : mini-panneau ancré en bas, ouvert par clic
 *
 * Mobile-first prioritaire : l'utilisateur a les mains occupées en cuisine,
 * zones tactiles ≥ 44×44px.
 *
 * Brand Book §3.1 (emoji ✨ uniquement) + §8.7 (sobre, pas de fioritures).
 *
 * @author  Savoor.fr
 * @version V0.8 phase 3 Sprint 2 (2026-04-27)
 */

/* ───────────── Chip Alfred dans cooking lightbox ───────────── */
.alfred-cooking-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.85rem auto 0.5rem;
    padding: 0.65rem 1.1rem;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    /* zone tap mobile */
    min-height: 44px;
    align-self: center;
}

.alfred-cooking-chip:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.85);
    transform: translateY(-1px);
}

.alfred-cooking-chip:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

.alfred-cooking-chip-spark {
    color: #fbbf24;
    font-size: 1.05em;
}

/* La chip s'auto-affiche en bloc dans le flow lightbox (par défaut inline-flex
   ne se centre pas — on enveloppe avec un conteneur flex). */
.cuisine-lb-step-desc + .alfred-cooking-chip,
.cuisine-lb-step-ingredients + .alfred-cooking-chip,
.cuisine-lb-timers + .alfred-cooking-chip {
    display: flex;
    width: max-content;
    margin-left: auto;
    margin-right: auto;
}

/* ───────────── Panneau Alfred (overlay au-dessus de la lightbox) ───────────── */
.alfred-cooking-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001; /* au-dessus de la cooking lightbox (z-index ~ 10000) */
    background: #1f2937;
    color: #f3f4f6;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    transform: translateY(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    max-height: 50vh;
    overflow: hidden;
}

.alfred-cooking-panel.is-open {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .alfred-cooking-panel {
        max-height: 40vh;
        max-width: 720px;
        margin: 0 auto;
        right: 0;
        left: 0;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
        bottom: 16px;
    }
}

/* Header */
.alfred-cooking-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
}

.alfred-cooking-panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fcd34d;
}

.alfred-cooking-panel-step {
    color: #9ca3af;
    font-weight: 400;
    margin-left: 0.2rem;
    font-size: 0.88rem;
}

.alfred-cooking-panel-spark {
    margin-right: 0.15rem;
}

.alfred-cooking-panel-close {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.alfred-cooking-panel-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
}
.alfred-cooking-panel-close:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Body */
.alfred-cooking-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Réponse Alfred (au-dessus de la saisie) */
.alfred-cooking-panel-response {
    background: rgba(245, 158, 11, 0.10);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #f3f4f6;
}

.alfred-cooking-panel-response.is-loading {
    background: transparent;
    border-left-color: transparent;
    color: #9ca3af;
    font-style: italic;
    padding: 0.4rem 0;
}

.alfred-cooking-panel-response.is-error {
    background: rgba(239, 68, 68, 0.10);
    border-left-color: #ef4444;
    color: #fecaca;
}

.alfred-cooking-panel-response strong { font-weight: 600; }

/* Form (champ + envoi) */
.alfred-cooking-panel-form {
    display: flex;
    gap: 0.5rem;
}

.alfred-cooking-panel-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: #111827;
    color: #f3f4f6;
    font-size: 0.95rem;
    font-family: inherit;
}

.alfred-cooking-panel-input::placeholder { color: #6b7280; }

.alfred-cooking-panel-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.20);
}

.alfred-cooking-panel-submit {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #f59e0b;
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}
.alfred-cooking-panel-submit:hover { background: #fbbf24; transform: translateY(-1px); }
.alfred-cooking-panel-submit:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}
.alfred-cooking-panel-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Chips d'amorce */
.alfred-cooking-panel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.alfred-cooking-panel-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    color: #f3f4f6;
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.alfred-cooking-panel-chip:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(245, 158, 11, 0.55);
}

.alfred-cooking-panel-chip:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}
