:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-soft: #fbfbfd;
    --border: #e7e9f1;
    --text: #1f2430;
    --muted: #6b7280;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #e9ecff;
    --secondary-text: #3443b8;
    --danger: #dc3545;
    --danger-hover: #b92d3a;
    --warning: #f59e0b;
    --warning-hover: #d88706;
    --success: #16a34a;
    --shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #f9faff 0%, var(--bg) 100%);
    color: var(--text);
    margin: 0;
    font-family: Arial, sans-serif;
}

h1 {
    text-align: center;
    margin-bottom: 25px;
}

/* Conteneur principal centré */
.container {
    max-width: 1000px;
    margin: 40px auto; /* centre horizontal + espace haut/bas */
    padding: 0 20px;
}

.app-shell {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    border-right: 1px solid var(--border);
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    padding: 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    padding: 32px;
}

.help {
    margin: 20px 0px 20px 20px;
    text-align: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: var(--shadow);
}

.brand-title {
    font-weight: 800;
    font-size: 20px;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.sidebar-card,
.hero-card,
.form-card,
.card-lite,
.recipe-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    display: flex;
    align-items: center; /* 🔥 centrage vertical */
    gap: 20px;
    padding: 20px;
}

/* Image responsive */
.hero-img {
    width: 30vw;          /* taille relative à la fenêtre */
    max-width: 300px;     /* limite pour éviter trop grand */
    height: auto;         /* conserve les proportions */
    border-radius: 10px;  /* optionnel */
}

/* Titre */
.hero-title {
    font-size: 2rem;
    margin: 0;
    padding-top: 20px;
}

.hero-fond {
    border-radius: 15px 15px 15px 15px;
    -webkit-border-radius: 15px 15px 15px 15px;
    -moz-border-radius: 15px 15px 15px 15px;
    border: 1px solid #AF9AFF;
    background-color: #DFEFFA;
    /*border-color: #AF9AFF;*/
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px; /* espace entre blocs */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card:hover {
    transform: translateY(-2px);
    transition: 0.2s;
}

.sidebar-card {
    padding: 18px;
}

.sidebar-title {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.history-search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.history-search-form input[type="text"],
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.history-search-form input[type="text"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
    background: #fff;
}

.favorites-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.history-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn,
.primary-btn,
.secondary-btn,
.ghost-btn,
.mini-btn {
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.12s ease, opacity 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.icon-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.mini-btn:hover {
    transform: translateY(-1px);
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    padding: 12px 18px;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.secondary-btn {
    background: var(--secondary);
    color: var(--secondary-text);
    padding: 12px 18px;
}

.ghost-btn {
    background: #eef1f7;
    color: #495266;
    padding: 12px 18px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    background: #eef1f7;
    color: #344054;
    font-size: 18px;
}

.mini-btn {
    padding: 8px 10px;
    font-size: 13px;
    background: #eef1f7;
    color: #344054;
}

.mini-btn.warning {
    background: #fff4d6;
    color: #8a5a00;
}

.mini-btn.warning:hover {
    background: #ffe9b0;
}

.mini-btn.danger {
    background: #ffe5e8;
    color: var(--danger);
}

.mini-btn.danger:hover {
    background: #ffd6db;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    border: 1px solid var(--border);
    background: #fcfcff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 15px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(31, 36, 48, 0.06);
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.history-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.history-title {
    font-weight: 700;
    line-height: 1.35;
}

.history-item button {
    background: #2563eb;
    color: white;
    font-size: 12px;
    padding: 6px 10px;
}

.history-item button:hover {
    background: #1e4ed8;
}

/* supprimer en rouge */
.history-delete-btn {
    background: #ef4444 !important;
}

.history-delete-btn:hover {
    background: #dc2626 !important;
}
.favorite-badge {
    font-size: 14px;
}

.history-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-input {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.history-date {
    margin-top: 8px;
    font-size: 12px;
    color: #98a2b3;
}

.hero-card {
    padding: 26px;
    margin-bottom: 20px;
}

.hero-header h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    line-height: 1.15;
}

.hero-header p {
    margin: 0 0 20px 0;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.55;
}

.form-card {
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}

.field-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 700;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.field-help {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.section-label {
      font-size: 11px;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: #888;
      margin: 1.2rem 0 8px;
}

/*.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}*/
.suggestions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3949ab;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease, background 0.2s ease;
}

.chip:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}
.chip.selected {
      background: #3949ab;
      color: #fff;
}

.main-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.result-zone {
    margin-top: 20px;
}

.result-placeholder {
    text-align: center;
    padding: 36px 24px;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.result-placeholder h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.result-placeholder p {
    margin: 0;
    color: var(--muted);
}

.recipe-card {
    padding: 24px;
    animation: fadeInUp 0.25s ease;
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.recipe-header h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.copy-btn {
    background: #111827;
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f8;
    color: #3f4758;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
}

#recipeContent h3 {
    margin-top: 22px;
    margin-bottom: 10px;
    font-size: 18px;
}

#recipeContent ul,
#recipeContent ol {
    padding-left: 22px;
    margin: 0;
}

#recipeContent li + li {
    margin-top: 8px;
}

.loading {
    text-align: center;
    padding: 28px 20px;
    font-size: 16px;
}

.error {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #fecdd3;
    border-radius: 14px;
    padding: 16px;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 18px 12px;
}

.empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

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

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 700px) {
    .main-content,
    .sidebar {
        padding: 18px;
    }

    .hero-header h1 {
        font-size: 26px;
    }

    .recipe-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-actions {
        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn,
    .ghost-btn {
        width: 100%;
    }

    .history-item-top {
        flex-direction: column;
    }

    .history-actions {
        width: 100%;
    }
}
button {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

/* bouton principal */
#generateBtn {
    background: #2563eb;
    color: white;
}

#generateBtn:hover {
    background: #1e4ed8;
}

/* bouton secondaire */
#regenBtn {
    background: #3b82f6;
    color: white;
}

#regenBtn:hover {
    background: #2563eb;
}

/* bouton neutre */
#clearBtn {
    background: #e5e7eb;
    color: #374151;
}

#clearBtn:hover {
    background: #d1d5db;
}
.actions {
    margin: 15px 15px 15px 0px;
    display: flex;
    gap: 10px;
}
.dgen{
    font-weight: bold;
}
