/* ============================================================
   Mes Fiches Recettes - CSS
   Design moderne & chaleureux
   ============================================================ */

:root {
    --cream:     #fdf8f0;
    --warm-bg:   #fff9f2;
    --gold:      #c8973a;
    --gold-light:#e8b86d;
    --gold-dark: #a07828;
    --terracota: #c0623a;
    --green:     #4a7c59;
    --green-light:#6aad7a;
    --brown:     #5c3d2e;
    --text:      #2d2013;
    --text-muted:#8b7355;
    --border:    #e8dcc8;
    --white:     #ffffff;
    --shadow-sm: 0 2px 8px rgba(90,60,20,.08);
    --shadow-md: 0 4px 20px rgba(90,60,20,.12);
    --shadow-lg: 0 8px 40px rgba(90,60,20,.16);
    --radius:    16px;
    --radius-sm: 8px;
    --transition: .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- HEADER / NAV ---- */
.site-header { position: relative; overflow: hidden; }

.header-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #2d1b0e 0%, #5c3d2e 40%, #8b5e3c 70%, #c8973a 100%);
    z-index: 0;
}
.header-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.navbar {
    position: relative; z-index: 10;
    display: flex; align-items: center; gap: 24px;
    padding: 18px 32px;
}

.nav-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--white);
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-icon { font-size: 1.5rem; }

.nav-links {
    display: flex; align-items: center; gap: 8px;
    list-style: none;
    margin-left: auto;
}
.nav-links a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 50px;
    font-size: .9rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--white);
    background: rgba(255,255,255,.15);
}
.btn-nav {
    background: var(--gold) !important;
    color: var(--white) !important;
    font-weight: 700 !important;
}
.btn-nav:hover { background: var(--gold-dark) !important; }

.nav-toggle {
    display: none;
    background: none; border: none; color: white;
    font-size: 1.5rem; cursor: pointer; margin-left: auto;
}

.hero {
    position: relative; z-index: 5;
    text-align: center;
    padding: 80px 32px 100px;
    color: var(--white);
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.15;
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero-title em { color: var(--gold-light); }
.hero-subtitle {
    font-size: 1.15rem;
    opacity: .85;
    margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- BOUTONS ---- */
.btn {
    display: inline-block; padding: 12px 28px;
    border-radius: 50px; font-weight: 700;
    text-decoration: none; font-size: .95rem;
    transition: var(--transition); border: 2px solid transparent;
    cursor: pointer; font-family: inherit;
}
.btn-primary {
    background: var(--gold); color: var(--white);
    border-color: var(--gold);
}
.btn-primary:hover {
    background: var(--gold-dark); border-color: var(--gold-dark);
    transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: rgba(255,255,255,.15); color: var(--white);
    border-color: rgba(255,255,255,.4); backdrop-filter: blur(4px);
}
.btn-secondary:hover { background: rgba(255,255,255,.25); }
.btn-outline {
    background: transparent; color: var(--gold);
    border-color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--white); }
.btn-danger {
    background: #dc3545; color: var(--white); border-color: #dc3545;
}
.btn-danger:hover { background: #b02a37; }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn-icon { padding: 8px 12px; }

/* ---- FLASH ---- */
.flash {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; margin: 16px auto; max-width: 900px;
    border-radius: var(--radius-sm); font-weight: 500;
}
.flash button { background: none; border: none; cursor: pointer; font-size: 1.1rem; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error   { background: #fee2e2; color: #991b1b; }
.flash-info    { background: #dbeafe; color: #1e40af; }

/* ---- STATS ---- */
.stats-section { padding: 50px 0; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.stat-number {
    display: block; font-size: 2.5rem; font-weight: 700;
    color: var(--gold); font-family: 'Playfair Display', serif;
    line-height: 1;
}
.stat-label { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

/* ---- SECTIONS ---- */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem; color: var(--brown);
    margin-bottom: 32px;
    position: relative; padding-bottom: 12px;
}
.section-title::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    width: 60px; height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
}
.section-footer { text-align: center; margin-top: 40px; }

/* ---- CATEGORIES ---- */
.categories-section { padding: 20px 0 60px; }
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.category-card {
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute; inset: 0;
    background: inherit;
    filter: brightness(1.05);
    transition: var(--transition);
    opacity: 0;
}
.category-card:hover::before { opacity: 1; }
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.category-entree  { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); color: #2e7d32; }
.category-plat    { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #e65100; }
.category-dessert { background: linear-gradient(135deg, #fce4ec, #f8bbd9); color: #880e4f; }
.category-icon { font-size: 3rem; display: block; margin-bottom: 12px; position: relative; z-index: 1; }
.category-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem; margin-bottom: 6px; position: relative; z-index: 1;
}
.category-count { font-size: .85rem; opacity: .7; position: relative; z-index: 1; }

/* ---- GRILLE RECETTES ---- */
.recentes-section { background: var(--warm-bg); padding: 60px 0; }
.recettes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.recette-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex; flex-direction: column;
}
.recette-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.recette-img {
    height: 200px;
    position: relative; overflow: hidden;
    background: var(--cream);
}
.recette-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.recette-card:hover .recette-img img { transform: scale(1.06); }
.recette-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--cream), var(--border));
}
.recette-badge {
    position: absolute; top: 12px; right: 12px;
    padding: 4px 10px; border-radius: 50px;
    font-size: .75rem; font-weight: 700;
    backdrop-filter: blur(8px);
}
.badge-entree        { background: rgba(76,175,80,.85); color: white; }
.badge-plat_cuisiner { background: rgba(255,152,0,.85);  color: white; }
.badge-dessert       { background: rgba(233,30,99,.85);  color: white; }
.recette-info {
    padding: 18px 20px;
    flex: 1; display: flex; flex-direction: column; gap: 6px;
}
.recette-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem; color: var(--brown);
    line-height: 1.3;
}
.recette-info time { color: var(--text-muted); font-size: .8rem; }

/* ---- PAGE LISTE RECETTES ---- */
.page-header {
    background: linear-gradient(135deg, #2d1b0e, #5c3d2e);
    color: white; padding: 50px 0;
}
.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem; margin-bottom: 8px;
}
.page-header p { opacity: .8; }

.filters-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.filters-inner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filter-btn {
    padding: 7px 18px; border-radius: 50px;
    border: 2px solid var(--border);
    background: transparent; cursor: pointer;
    font-size: .9rem; font-weight: 500;
    color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    border-color: var(--gold); color: var(--gold);
    background: rgba(200,151,58,.08);
}
.filter-search {
    margin-left: auto;
    display: flex; align-items: center; gap: 8px;
}
.filter-search input {
    padding: 8px 16px; border: 2px solid var(--border);
    border-radius: 50px; font-size: .9rem;
    outline: none; width: 220px; transition: var(--transition);
}
.filter-search input:focus { border-color: var(--gold); }

.recettes-page { padding: 40px 0 80px; }
.recettes-list { display: flex; flex-direction: column; gap: 16px; }
.recette-row {
    background: var(--white);
    border-radius: var(--radius);
    display: flex; align-items: center; gap: 20px;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-decoration: none; color: inherit;
    transition: var(--transition);
}
.recette-row:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}
.recette-row-thumb {
    width: 70px; height: 70px;
    border-radius: 12px; overflow: hidden;
    flex-shrink: 0;
    background: var(--cream);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}
.recette-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recette-row-info { flex: 1; }
.recette-row-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem; color: var(--brown);
}
.recette-row-info .meta { color: var(--text-muted); font-size: .85rem; }
.recette-row-actions { display: flex; gap: 8px; }

/* ---- FICHE RECETTE ---- */
.fiche-header {
    background: linear-gradient(135deg, #2d1b0e 0%, #5c3d2e 100%);
    color: white; padding: 50px 0 30px;
}
.fiche-header-inner {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
}
.fiche-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 3vw, 3rem);
    margin-bottom: 8px;
}
.fiche-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.meta-tag {
    background: rgba(255,255,255,.15);
    padding: 5px 14px; border-radius: 50px;
    font-size: .85rem; backdrop-filter: blur(4px);
}
.fiche-actions-top { display: flex; gap: 10px; flex-shrink: 0; }

.fiche-body { padding: 40px 0 80px; }
.fiche-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 768px) { .fiche-grid { grid-template-columns: 1fr; } }

.fiche-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.fiche-card h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold-dark); font-size: 1.3rem;
    margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.ingredients-list { list-style: none; }
.ingredients-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    display: flex; align-items: center; gap: 8px;
    font-size: .95rem;
}
.ingredients-list li::before { content: '•'; color: var(--gold); font-size: 1.2rem; }
.ingredients-list li:last-child { border-bottom: none; }

.preparation-text {
    line-height: 1.9; color: var(--text);
    white-space: pre-wrap;
}
.preparation-steps { list-style: none; counter-reset: step; }
.preparation-steps li {
    counter-increment: step;
    padding: 12px 0 12px 52px;
    border-bottom: 1px solid var(--border);
    position: relative; font-size: .95rem; line-height: 1.7;
}
.preparation-steps li::before {
    content: counter(step);
    position: absolute; left: 0; top: 10px;
    width: 32px; height: 32px;
    background: var(--gold);
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
}

/* ---- GALERIE PHOTOS ---- */
.gallery-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.gallery-section h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold-dark); font-size: 1.3rem;
    margin-bottom: 20px; padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.photo-item {
    position: relative; border-radius: 10px; overflow: hidden;
    aspect-ratio: 1; cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.photo-item:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: 0; transition: var(--transition);
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-btn {
    background: rgba(255,255,255,.9);
    border: none; border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem; transition: var(--transition);
}
.photo-btn:hover { background: white; transform: scale(1.1); }
.photo-btn.del { background: rgba(220,53,69,.85); color: white; }
.photo-btn.del:hover { background: #dc3545; }

/* ---- DRAG & DROP UPLOAD ---- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--cream);
    position: relative;
}
.upload-zone.drag-over {
    border-color: var(--gold);
    background: rgba(200,151,58,.05);
    transform: scale(1.01);
}
.upload-zone input[type="file"] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.upload-zone p { color: var(--text-muted); }
.upload-zone strong { color: var(--gold); }

/* ---- FORMULAIRE ---- */
.form-page { padding: 40px 0 80px; }
.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    max-width: 800px; margin: 0 auto;
}
.form-title {
    font-family: 'Playfair Display', serif;
    color: var(--brown); font-size: 1.8rem;
    margin-bottom: 28px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
    font-weight: 700; font-size: .9rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
input[type="text"], input[type="email"],
select, textarea {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem;
    color: var(--text); background: var(--cream);
    transition: var(--transition); width: 100%;
    resize: vertical;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(200,151,58,.15);
}
textarea { min-height: 150px; }
.form-actions {
    display: flex; gap: 12px; margin-top: 28px;
    justify-content: flex-end; flex-wrap: wrap;
}

/* ---- RECHERCHE ---- */
.search-hero {
    background: linear-gradient(135deg, #2d1b0e, #5c3d2e);
    padding: 50px 0;
    text-align: center;
}
.search-hero h1 {
    font-family: 'Playfair Display', serif;
    color: white; font-size: 2rem; margin-bottom: 24px;
}
.search-box {
    display: flex; gap: 0; max-width: 600px; margin: 0 auto;
    background: white; border-radius: 50px;
    overflow: hidden; box-shadow: var(--shadow-lg);
}
.search-box input {
    flex: 1; padding: 14px 24px;
    border: none; background: transparent;
    font-size: 1rem; outline: none; color: var(--text);
}
.search-box button {
    padding: 14px 28px;
    background: var(--gold); color: white;
    border: none; cursor: pointer; font-weight: 700;
    font-size: 1rem; transition: var(--transition);
}
.search-box button:hover { background: var(--gold-dark); }
.search-results { padding: 40px 0 80px; }
.search-count {
    color: var(--text-muted); margin-bottom: 20px;
    font-size: .95rem;
}

/* ---- CTA ---- */
.cta-section { padding: 60px 0; }
.cta-card {
    background: linear-gradient(135deg, var(--brown), #8b5e3c);
    border-radius: var(--radius);
    padding: 50px 40px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    color: white;
}
.cta-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem; margin-bottom: 8px;
}
.cta-content p { opacity: .8; margin-bottom: 20px; }
.cta-illustration { font-size: 5rem; }

/* ---- FOOTER ---- */
.site-footer {
    background: var(--brown); color: rgba(255,255,255,.65);
    padding: 24px 0; text-align: center; font-size: .9rem;
}

/* ---- LIGHTBOX ---- */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img {
    max-width: 90vw; max-height: 90vh;
    border-radius: 8px; object-fit: contain;
    box-shadow: 0 20px 80px rgba(0,0,0,.5);
}
.lightbox-close {
    position: absolute; top: 20px; right: 24px;
    background: rgba(255,255,255,.2); border: none;
    color: white; font-size: 1.5rem;
    width: 44px; height: 44px; border-radius: 50%;
    cursor: pointer; transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.4); }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: white; border-radius: var(--radius);
    padding: 32px; max-width: 500px; width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(.95); transition: transform .3s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 12px; font-size: 1.4rem;
}
.modal-actions { display: flex; gap: 12px; margin-top: 20px; justify-content: flex-end; }

/* ---- PAGINATION ---- */
.pagination {
    display: flex; justify-content: center; gap: 8px; margin-top: 40px;
}
.page-link {
    padding: 8px 14px; border-radius: 8px;
    border: 2px solid var(--border);
    color: var(--text-muted); text-decoration: none;
    font-weight: 500; transition: var(--transition);
}
.page-link:hover, .page-link.active {
    border-color: var(--gold); color: var(--gold);
    background: rgba(200,151,58,.08);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 100%; left: 0; right: 0;
        background: #2d1b0e;
        padding: 16px; gap: 4px; z-index: 50;
    }
    .nav-toggle { display: block; }
    .navbar { position: relative; }
    .cta-card { flex-direction: column; text-align: center; }
    .cta-illustration { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .fiche-header-inner { flex-direction: column; }
    .recette-row-actions { flex-direction: column; }
}

@media (max-width: 500px) {
    .hero { padding: 50px 16px 70px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- DRAG & DROP ORDRE ---- */
.photo-item.dragging {
    opacity: .4; transform: scale(.98);
}
.sortable-ghost { opacity: .4; }
