/* Recipe Styles Optimized - Cleaned & Scoped to avoid conflicts */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&family=Handlee:wght@400;700&display=swap');

:root {
    --primary-white: #ffffff;
    --primary-blue: #3b82f6;
    --primary-red: #ef4444;
    --accent-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-light: #e2e8f0;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --purple: #8b5cf6;
    --brand-primary: #00C851;
    --brand-secondary: #2196F3;
    --bounce-timing: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --smooth-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- SAFETY RESET SCOPED TO CONTAINER --- */
.recipe-container, 
.recipe-container * {
    box-sizing: border-box;
}

/* Base Styles Scoped to Recipe Container */
.recipe-container {
    font-family: 'Handlee', cursive;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--primary-white);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s var(--smooth-timing);
}

.recipe-container.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Headings Scoped */
.recipe-container h1, 
.recipe-container h2, 
.recipe-container h3, 
.recipe-container h4, 
.recipe-container h5, 
.recipe-container h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-top: 0;
}

/* --- COMPONENTS OUTSIDE CONTAINER (Fixed Elements) --- */

/* Loading Animation */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
    font-family: 'Poppins', sans-serif;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.cooking-animation {
    font-size: 4rem;
    animation: cooking 2s infinite ease-in-out;
}

@keyframes cooking {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 6px !important;
    height: 100% !important;
    background: rgba(0,0,0,0.15);
    z-index: 10000 !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scroll-progress-bar {
    width: 100%;
    background: linear-gradient(0deg, #3b82f6, #ef4444);
    height: 0%;
    transition: height 0.2s ease-out;
    box-shadow: 0 0 15px rgba(59,130,246,0.4);
    border-radius: 3px 3px 0 0;
    position: absolute;
    bottom: 0;
}

/* --- RECIPE HEADER --- */
.recipe-header-modern {
    background: white;
    padding: 20px;
    width: 100%;
    margin: 20px auto;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.breadcrumb-nav {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.breadcrumb-link {
    color: #e74c3c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #c0392b;
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb-current {
    color: #333;
    font-weight: 500;
}

/* Title and Rating */
.recipe-title-section {
    margin-bottom: 25px;
}

.recipe-title-modern {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.2;
    text-align: center;
}

.recipe-rating-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 5px;
}

.star {
    font-size: 1.2rem;
    color: #ddd;
    transition: color 0.3s ease;
}

.star.filled {
    color: #f39c12;
}

.star.half {
    background: linear-gradient(90deg, #f39c12 50%, #ddd 50%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rating-value {
    font-weight: 600;
    color: #2c3e50;
    margin-left: 8px;
}

.comments-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.comments-link:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* ========================================
   MAIN IMAGE + GALLERY — IDENTIQUE QC
   ========================================*/

.recipe-main-media {
    margin-bottom: 30px;
}

/* Conteneur image principale — centré, max-width comme QC, pas de 3D */
.main-image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 15px 35px rgba(0,200,81,0.15);
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid rgba(0,200,81,0.1);
}

/* Image principale — ratio naturel, pas de crop, pas de max-height */
.recipe-main-image-modern {
    width: 100%;
    height: auto !important;
    object-fit: contain !important;
    object-position: center center;
    transition: transform 0.3s ease;
    display: block;
}

/* Hover simple : zoom léger, pas de rotation */
.main-image-container:hover .recipe-main-image-modern {
    transform: scale(1.05);
}

/* Overlay actions sur l'image */
.image-overlay-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.main-image-container:hover .image-overlay-actions {
    opacity: 1;
}

.overlay-btn {
    background: rgba(255,255,255,0.95);
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    color: var(--text-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid var(--brand-primary);
}

.overlay-btn:hover {
    background: var(--brand-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,200,81,0.3);
}

/* Galerie miniatures — carrés arrondis comme QC, 80x80 */
.recipe-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.gallery-thumb:hover {
    border-color: var(--brand-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,200,81,0.3);
}

.gallery-thumb.active {
    border-color: var(--brand-secondary);
    box-shadow: 0 5px 15px rgba(33,150,243,0.4);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb.placeholder {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 24px;
    font-weight: bold;
}

.gallery-thumb.placeholder:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    border-color: #00A844;
}

.gallery-more {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, #26A69A, #3F51B5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-more:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(38,166,154,0.4);
}

/* Mobile — image pleine largeur, pas de 3D */
@media (max-width: 768px) {
    .main-image-container {
        max-width: 100%;
        border-radius: 12px;
    }

    .recipe-main-image-modern {
        width: 100%;
        height: auto !important;
        object-fit: contain !important;
    }

    .recipe-gallery {
        justify-content: flex-start;
        padding-left: 5px;
    }

    .image-overlay-actions {
        position: static;
        opacity: 1;
        flex-direction: row;
        justify-content: center;
        margin-top: 10px;
    }
}

/* Info Badges */
.recipe-info-badges {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid;
    min-width: 120px;
    transition: all 0.6s var(--bounce-timing);
    flex-shrink: 0;
}

.badge-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.time-badge { border-left-color: #3498db; }
.servings-badge { border-left-color: #2ecc71; }
.difficulty-badge { border-left-color: #f39c12; }
.cost-badge { border-left-color: #9b59b6; }
.calories-badge { border-left-color: #e74c3c; }

.badge-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.badge-item:hover .badge-icon {
    transform: scale(1.1);
}

.badge-content {
    display: flex;
    flex-direction: column;
}

.badge-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.badge-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Description */
.recipe-description-modern {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #e74c3c;
    text-align: center;
}

.recipe-description-modern p {
    margin: 0;
    line-height: 1.6;
    color: #2c3e50;
    font-size: 1rem;
}

/* Action Buttons */
.recipe-actions-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
}

.primary-action {
    background: #e74c3c;
    color: white;
    flex: 1;
    justify-content: center;
    min-width: 200px;
    max-width: 300px;
}

.primary-action:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

.secondary-action {
    background: white;
    color: #2c3e50;
    border: 2px solid #e74c3c;
}

.secondary-action:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231,76,60,0.2);
}

/* Main Grid */
.recipe-main-grid {
    display: block;
    width: 100%;
}

.ingredients-section,
.instructions-section {
    width: 100%;
    margin-bottom: 2rem;
}

/* Ingredients Section */
.ingredients-section {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

.portions-adjuster {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--accent-light);
    padding: 0.5rem 1rem;
    border-radius: 15px;
}

.portion-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--primary-blue);
    color: var(--primary-white);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s var(--bounce-timing);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portion-btn:hover {
    transform: scale(1.1);
    background: var(--primary-red);
}

.portion-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-dark);
    min-width: 40px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

/* Ingredients Grid Modern */
.ingredients-subtitle {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 600;
}

.ingredients-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ingredient-card-modern {
    text-align: center;
    cursor: pointer;
    transition: all 0.4s var(--bounce-timing);
    padding: 15px;
    background: var(--primary-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.ingredient-card-modern:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(59,130,246,0.15);
    border-color: var(--primary-blue);
}

.ingredient-card-modern img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.4s ease;
}

.ingredient-card-modern:hover img {
    transform: scale(1.1) rotate(2deg);
}

.ingredient-name-modern {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.affiliate-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--warning-orange);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.buy-hint {
    font-size: 0.7rem;
    color: var(--warning-orange);
    margin-top: 4px;
    font-weight: 600;
}

.ingredient-card-modern.checked {
    opacity: 0.6;
    filter: grayscale(80%);
}

.ingredient-card-modern.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--success-green);
    font-weight: bold;
    text-shadow: 0 0 5px white;
    z-index: 10;
}

/* Ingredients List */
.list-subtitle {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
}

.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--accent-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--smooth-timing);
    border-left: 4px solid var(--primary-blue);
}

.ingredient-item:hover {
    transform: translateX(5px);
    background: #e0f2fe;
}

.ingredient-item.checked {
    background: #dcfce7;
    border-left-color: var(--success-green);
    opacity: 0.7;
}

.ingredient-item.checked .ingredient-text {
    text-decoration: line-through;
    color: #6b7280;
}

.ingredient-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary-blue);
    border-radius: 6px;
    position: relative;
    flex-shrink: 0;
}

.ingredient-item.checked .ingredient-checkbox {
    background: var(--success-green);
    border-color: var(--success-green);
}

.ingredient-item.checked .ingredient-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.ingredients-tip {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 10px;
    font-style: italic;
}

/* Instructions Section */
.instructions-section {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid var(--border-light);
}

.instruction-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--accent-light);
    border-radius: 15px;
    transition: all 0.3s var(--smooth-timing);
}

.instruction-step:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
    color: var(--primary-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-family: 'Poppins', sans-serif;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-dark);
}

.step-done-btn {
    background: var(--success-green);
    color: var(--primary-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.step-done-btn:hover {
    background: #059669;
}

.step-done-btn.completed {
    background: #9ca3af;
}

/* Step Images — pleine largeur, ratio naturel comme QC */
.step-image-container {
    margin: 20px 0;
    text-align: center;
}

.step-image {
    max-width: 100%;
    width: 100%;
    height: auto !important;
    max-height: none !important;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: zoom-in;
    object-fit: contain !important;
    border: 2px solid rgba(33,150,243,0.1);
    display: block;
}

.step-image:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 40px rgba(33,150,243,0.25);
    border-color: var(--brand-secondary);
}

.step-image-caption {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Utensils Section */
.utensils-section {
    margin: 2rem 0;
}

.utensils-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.utensil-card-modern {
    text-align: center;
    cursor: pointer;
    transition: all 0.4s var(--bounce-timing);
    padding: 20px;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.utensil-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(234, 88, 12, 0.2);
    border-color: var(--warning-orange);
}

.utensil-card-modern img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.utensil-name-modern {
    font-size: 0.9rem;
    font-weight: 600;
    color: #92400e;
}

.utensils-list {
    list-style: none;
    counter-reset: utensil-counter;
    padding: 0;
}

.utensil-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid var(--warning-orange);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

.utensil-item::before {
    content: counter(utensil-counter);
    counter-increment: utensil-counter;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Section Cards */
.section-card {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.green-theme { border-left-color: var(--success-green); background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%); }
.green-theme::before { background: var(--success-green); }

.blue-theme { border-left-color: var(--primary-blue); background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%); }
.blue-theme::before { background: var(--primary-blue); }

.red-theme { border-left-color: var(--primary-red); background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%); }
.red-theme::before { background: var(--primary-red); }

.purple-theme { border-left-color: var(--purple); background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%); }
.purple-theme::before { background: var(--purple); }

.orange-theme { border-left-color: var(--warning-orange); background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%); }
.orange-theme::before { background: var(--warning-orange); }

.yellow-theme { border-left-color: #eab308; background: linear-gradient(135deg, #ffffff 0%, #fefce8 100%); }
.yellow-theme::before { background: #eab308; }

/* Numbered sections (Storing Grid) */
.storing-grid {
    counter-reset: item-counter;
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.storing-item {
    display: flex;
    gap: 15px;
    padding: 18px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    align-items: flex-start;
}

.storing-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.storing-icon::before {
    content: counter(item-counter);
    counter-increment: item-counter;
}

.storing-content {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
}

/* Section-specific colors for icons */
.utensils-section .storing-icon { background: #f97316; }
.tips-section .tip-icon { background: #eab308; }
.troubleshooting-section .storing-icon { background: #ef4444; }
.variations-section .storing-icon { background: #8b5cf6; }
.alternatives-section .storing-icon { background: #10b981; }
.diet-section .storing-icon { background: #22c55e; }
.garnish-section .storing-icon { background: #ec4899; }
.storing-tips-section .storing-icon { background: #6b7280; }
.leftovers-section .storing-icon { background: #ea580c; }
.common-mistakes-section .storing-icon { background: #dc2626; }

/* Tips Grid */
.tips-grid {
    counter-reset: tip-counter;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 15px;
}

.tip-card {
    background: #fff7ed;
    border: 2px solid #fed7aa;
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
}

.tip-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.tip-icon::before {
    content: counter(tip-counter);
    counter-increment: tip-counter;
}

/* Serving Suggestions */
.serving-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    counter-reset: serving-counter;
    margin-top: 15px;
}

.serving-card {
    background: #eff6ff;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #dbeafe;
    position: relative;
}

.serving-card::before {
    content: '🍴';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 2rem;
    opacity: 0.2;
}

.serving-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.serving-icon::before {
    content: counter(serving-counter);
    counter-increment: serving-counter;
}

/* Nutrition Grid */
.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 15px;
}

.nutrition-item {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--primary-white);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
}

.nutrition-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.nutrition-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* FAQ Section */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fefce8;
    border-left: 4px solid #eab308;
    transition: background 0.3s;
}

.faq-question:hover {
    background: #fef3c7;
}

.faq-question-text {
    font-weight: 600;
    color: #92400e;
    font-size: 1.1rem;
}

.faq-arrow {
    font-size: 1.2rem;
    color: #eab308;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-arrow {
    transform: rotate(90deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 20px;
    margin: 0;
    color: var(--text-dark);
    line-height: 1.6;
    border-top: 1px solid #fef3c7;
}

/* Reviews Section */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.review-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(59,130,246,0.1);
    position: relative;
}

.review-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 4rem;
    color: rgba(59,130,246,0.1);
    font-family: serif;
    line-height: 1;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.review-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
}

.review-rating {
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.review-date {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    width: 100%;
}

.review-comment {
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 1rem;
    position: relative;
    z-index: 2;
}

/* Timer Sidebar - Fixed Position */
.timer-sidebar {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 990;
}

.timer-card {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 2px solid var(--primary-blue);
    min-width: 200px;
    text-align: center;
}

.timer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-family: 'Poppins', monospace;
}

.custom-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1rem;
}

.custom-timer input {
    width: 70px;
    padding: 8px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.timer-set-btn {
    padding: 8px 12px;
    background: var(--success-green);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.timer-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.timer-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
}

.timer-btn.start { background: var(--success-green); color: white; }
.timer-btn.pause { background: var(--warning-orange); color: white; }
.timer-btn.reset { background: var(--primary-red); color: white; }

/* Floating Actions */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 995;
}

.floating-actions .recipe-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--primary-blue);
    color: var(--primary-white);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(59,130,246,0.3);
    transition: all 0.3s;
    position: relative;
}

.floating-actions .recipe-fab:hover {
    transform: scale(1.1);
    background: var(--primary-red);
}

.recipe-fab[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-dark);
    color: var(--primary-white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    cursor: pointer;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .timer-sidebar {
        position: static;
        transform: none;
        margin: 2rem auto;
        max-width: 400px;
    }
    
    .timer-card {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .recipe-container {
        max-width: 100%;
        padding: 0 10px;
    }

    .recipe-main-grid {
        padding: 0;
    }
    
    .recipe-header-modern {
        padding: 15px;
        margin-top: 20px;
    }
    
    .recipe-title-modern {
        font-size: 2rem;
    }
    
    .recipe-info-badges {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .badge-item {
        width: 100%;
        justify-content: center;
    }
    
    .recipe-actions-bar {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .floating-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .ingredients-grid-modern {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .utensils-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reviews-grid, .nutrition-grid, .serving-carousel, .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .instruction-step {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .step-number {
        align-self: flex-start;
    }

    .step-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .recipe-title-modern {
        font-size: 1.5rem;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
    
    .ingredients-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .utensils-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .section-card {
        margin-bottom: 1rem;
        padding: 1.5rem;
    }
    
    .storing-icon, .tip-icon, .serving-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .floating-actions,
    .timer-sidebar,
    .scroll-progress,
    .page-loader,
    .recipe-actions-bar,
    .image-overlay-actions {
        display: none !important;
    }
    
    .recipe-container {
        box-shadow: none;
        max-width: 100%;
    }
    
    .recipe-header-modern {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    
    body {
        background: white !important;
    }
    
    .section-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin: 1rem 0;
    }
}

/* Scroll Animations — sécurité : visible par défaut, animé si JS actif */
[data-scroll] {
    opacity: 1 !important; 
    transform: none !important;
    transition: opacity 0.6s, transform 0.6s;
}

body.js-active [data-scroll] {
    opacity: 0 !important;
    transform: translateY(30px) !important;
}

body.js-active [data-scroll].visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}