/* recipe_read.css - Styles spécifiques à la page de lecture de recette */

/* Header de la recette */
.recipe-header {
    position: relative;
    background: white;
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
}

.recipe-image {
    width: 100%;
    height: 400px;
    position: relative;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), 0 0 6px rgba(255, 255, 255, 0.6);
}

.recipe-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.recipe-image-placeholder {
    height: 100%;
    font-size: 24px;
}

.recipe-info {
    padding: 30px;
}

.recipe-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

/* Métadonnées de la recette */
.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-medium);
}

.meta-item i {
    color: var(--primary-gold);
    width: 20px;
}

.meta-value {
    font-weight: 600;
    color: #333;
}

/* Section Nutrition */
.nutrition-section {
    background: white;
    border-radius: var(--border-radius-large);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
}

.nutrition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.nutrition-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Section Ingrédients */
.ingredients-section {
    background: white;
    border-radius: var(--border-radius-large);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
}

.ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary-gold);
}

.ingredient-name {
    font-weight: 500;
    color: #333;
}

.ingredient-quantity {
    font-weight: 600;
    color: var(--primary-gold);
}

/* Section Étapes */
.steps-section {
    margin-bottom: 30px;
}

.step {
    background: white;
    border-radius: var(--border-radius-large);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.step-header {
    background: var(--primary-gold);
    color: white;
    padding: 15px 25px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-content {
    display: flex;
    gap: 25px;
    padding: 25px;
}

.step-image {
    flex: 0 0 200px;
    height: 150px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.step-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.step-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border-radius: var(--border-radius);
}

.step-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
}

/* Info timer (texte informatif) */
.step-timer-info {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ========== Utility classes ========== */

/* Navigation buttons container */
.nav-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
    width: 100%;
}

/* Floating back button */
.recipe-back-button {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-250);
    color: #4a4a4a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    z-index: 5;
    transition: background 0.2s ease, transform 0.2s ease;
}

.recipe-back-button:hover {
    background: var(--gray-300);
    color: #3a3a3a;
    transform: translateY(-1px);
}

.recipe-back-button i {
    font-size: 16px;
}

/* Mobile FAB menu */
.fab-button {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2f2f2f;
    color: white;
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-button i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.fab-button.active i {
    transform: rotate(90deg);
}

.fab-menu {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1002;
    flex-direction: column;
    gap: 10px;
}

.fab-menu.active {
    display: flex;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 16px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    animation: slideInRight 0.25s ease forwards;
    opacity: 0;
}

.fab-menu-item:nth-child(1) { animation-delay: 0.05s; }
.fab-menu-item:nth-child(2) { animation-delay: 0.1s; }
.fab-menu-item:nth-child(3) { animation-delay: 0.15s; }
.fab-menu-item:nth-child(4) { animation-delay: 0.2s; }
.fab-menu-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInRight {
    from {
        transform: translateX(80px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fab-menu-item i {
    color: var(--primary-gold);
    width: 20px;
    text-align: center;
}

.fab-menu-item span {
    font-weight: 600;
    color: #2f2f2f;
    white-space: nowrap;
}

.fab-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.fab-overlay.active {
    display: block;
}

/* Nav buttons: sober, neutral palette */
.nav-buttons .back-btn {
    background: var(--white);
    color: var(--gray-800);
    border: 1px solid var(--primary-gold);
}

.nav-buttons .back-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-buttons .back-btn.btn-primary,
.nav-buttons .back-btn.btn-secondary {
    background: var(--white);
    color: var(--gray-800);
    border: 1px solid var(--primary-gold);
}

.nav-buttons .back-btn.btn-primary:hover,
.nav-buttons .back-btn.btn-secondary:hover {
    background: var(--gray-100);
}

.nav-buttons .back-btn.btn-success {
    background: var(--primary-gold);
    color: var(--white);
    border: 1px solid var(--primary-gold-dark);
}

.nav-buttons .back-btn.btn-success:hover {
    background: var(--primary-gold-dark);
    border-color: var(--primary-gold-darker);
}

/* Large icon */
.icon-large {
    font-size: 3rem;
}

/* Recipe description */
.recipe-description {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Ingredient splitter */
.ingredient-splitter-wrapper {
    grid-column: 1/-1;
    margin: 15px 0;
}

.ingredient-splitter-title {
    color: #b8956d;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid #b8956d;
    padding-bottom: 5px;
}

/* Empty state messages */
.empty-message {
    color: #666;
    text-align: center;
    grid-column: 1/-1;
}

.step-empty {
    justify-content: center;
    text-align: center;
    color: #666;
}

/* Step repeat box */
.step-repeat-box {
    margin-top: 15px;
}

/* Step help URL */
.step-help-wrapper {
    margin-top: 15px;
}

.step-help-link {
    color: #b8956d;
    text-decoration: none;
}

.step-help-link:hover {
    text-decoration: underline;
}

/* ========== Modal "Ajouter au menu" ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius-large);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--primary-gold);
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.servings-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.servings-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-gold);
    background: white;
    color: var(--primary-gold);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.servings-btn:hover {
    background: var(--primary-gold);
    color: white;
}

.servings-input {
    flex: 1;
    text-align: center;
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 10px 20px;
    border: 1px solid var(--primary-gold);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    color: var(--gray-800);
}

.btn-primary {
    background: var(--white);
    color: var(--gray-800);
    border: 1px solid var(--primary-gold);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--gray-650);
    border: 1px solid var(--primary-gold);
}

.btn-secondary:hover {
    background: var(--gray-100);
}

/* Responsive spécifique */
@media (max-width: 768px) {
    .recipe-title {
        font-size: 2rem;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 15px;
    }

    .nutrition-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .ingredients-list {
        grid-template-columns: 1fr;
    }

    .step-content {
        flex-direction: column;
    }

    .step-image {
        flex: none;
        height: 200px;
    }

    .modal-content {
        width: 95%;
    }

    .nav-buttons {
        flex-wrap: wrap;
    }

    .nav-buttons {
        display: none;
    }

    .fab-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .recipe-back-button {
        left: 12px;
        top: -16px;
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 769px) {
    .fab-button,
    .fab-menu,
    .fab-overlay {
        display: none !important;
    }
}
