/* ========================================
   RECIPES - KitchenFlow
   Stili per la gestione ricette e ricettari
   ======================================== */

/* ========================================
   Recipe Cards - Miglioramenti 2025
   ======================================== */

/* Desktop Cards */
.recipe-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(var(--bs-black-rgb), 0.1);
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(var(--bs-black-rgb), 0.15);
}

.recipe-card-img {
    width: 100%;
    height: 180px;
    max-width: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
}

.recipe-card-placeholder {
    height: 180px;
    background: linear-gradient(135deg, var(--bs-tertiary-bg) 0%, var(--bs-secondary-bg) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4/3;
}

.recipe-card-placeholder i {
    font-size: 3.5rem;
    color: rgba(var(--bs-black-rgb), 0.2);
}

.recipe-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.recipe-info-grid div {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.recipe-info-grid i {
    font-size: 1rem;
}

/* Mobile Cards */
.recipe-card-mobile {
    box-shadow: 0 1px 3px rgba(var(--bs-black-rgb), 0.1);
    overflow: hidden;
}

.recipe-card-img-mobile {
    width: 100%;
    height: 100%;
    min-height: 120px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 0.25rem 0 0 0.25rem;
}

.recipe-card-placeholder-mobile {
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, var(--bs-tertiary-bg) 0%, var(--bs-secondary-bg) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem 0 0 0.25rem;
}

.recipe-card-placeholder-mobile i {
    font-size: 2.5rem;
    color: rgba(var(--bs-black-rgb), 0.2);
}

.recipe-info-mobile {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.recipe-info-mobile span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.recipe-info-mobile i {
    font-size: 0.9rem;
    color: var(--bs-primary);
}

.recipe-cost-mobile {
    font-weight: bold;
    color: var(--bs-primary);
    font-size: 1.1rem;
    background: rgba(var(--bs-primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ========== RICETTE: STILI MIGLIORATI ========== */

/* Card info base ricetta - Design moderno */
.recipe-info-card .card-body {
    padding: 1.5rem;
}

.recipe-info-card h2 {
    color: var(--bs-body-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.recipe-info-card .lead {
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Info grid con icone */
.recipe-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.recipe-info-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bs-tertiary-bg);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.recipe-info-item:hover {
    background: var(--bs-secondary-bg);
    transform: translateY(-2px);
}

.recipe-info-item i {
    font-size: 1.5rem;
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
}

/* Tabella ingredienti - Stile migliorato */
.ingredients-table {
    margin-bottom: 0;
}

.ingredients-table thead {
    background: var(--bs-tertiary-bg);
    border-bottom: 2px solid var(--bs-border-color);
}

.ingredients-table thead th {
    font-weight: 600;
    color: var(--bs-secondary-color);
    padding: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ingredients-table tbody tr {
    transition: background-color 0.15s ease;
}

.ingredients-table tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

.ingredients-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Colonna percentuali - Evidenziata */
.ingredients-table .percentage-col {
    font-weight: 600;
    color: var(--bs-primary);
    font-size: 1.05rem;
}

/* Footer tabella ingredienti */
.ingredients-table tfoot {
    background: linear-gradient(135deg, var(--bs-primary-bg-subtle), var(--bs-dark-bg-subtle));
    color: var(--bs-white);
    font-weight: 600;
}

.ingredients-table tfoot td {
    padding: 1rem 0.75rem;
    font-size: 1.05rem;
}

/* Badge ingredienti */
.ingredient-badge-optional {
    background: linear-gradient(135deg, var(--bs-info), color-mix(in srgb, var(--bs-info) 80%, black));
    color: var(--bs-white);
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
    border-radius: 0.25rem;
}

.ingredient-badge-custom {
    background: linear-gradient(135deg, var(--bs-secondary), color-mix(in srgb, var(--bs-secondary) 80%, black));
    color: var(--bs-white);
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
    border-radius: 0.25rem;
}

/* Cards mobile ingredienti - Design migliorato */
@media (max-width: 767.98px) {
    .ingredient-card-mobile {
        border-left: 4px solid var(--bs-primary);
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 4px rgba(var(--bs-black-rgb), 0.08);
        transition: all 0.2s ease;
    }
    
    .ingredient-card-mobile:hover {
        box-shadow: 0 4px 8px rgba(var(--bs-black-rgb), 0.12);
        transform: translateX(4px);
    }
    .ingredient-percentage-badge {
        background: var(--bs-primary);
        color: var(--bs-white);
        font-weight: 600;
        padding: 0.35em 0.65em;
        border-radius: 0.375rem;
        font-size: 0.85rem;
    }}

/* Convertitori - Card compatte */
.converter-card .card-header {
    padding: 0.75rem 1rem;
}

.converter-card .card-header h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.converter-card .card-body {
    padding: 1rem;
}

.converter-card label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

/* Foto ricetta - Bordo elegante */
.recipe-photo-card {
    border: none;
    box-shadow: 0 4px 12px rgba(var(--bs-black-rgb), 0.1);
    overflow: hidden;
    border-radius: 0.5rem;
}

.recipe-photo-card img {
    transition: transform 0.3s ease;
}

.recipe-photo-card:hover img {
    transform: scale(1.05);
}

/* Alert permanenti - Stile sottile */
.alert-permanent {
    border-radius: 0.5rem;
    border-left-width: 4px;
}

.alert-permanent.alert-info {
    background: var(--bs-info-bg-subtle);
    border-left-color: var(--bs-primary);
    color: var(--kf-info-text-emphasis);
}

.alert-permanent.alert-warning {
    background: var(--bs-warning-bg-subtle);
    border-left-color: var(--bs-warning);
    color: var(--kf-warning-text-emphasis);
}

/* Markdown content - Tipografia migliorata */
.markdown-content {
    line-height: 1.7;
    color: var(--bs-body-color);
}

.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--bs-body-color);
}

.markdown-content code {
    background: var(--bs-code-bg);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: var(--kf-code-color);
}

/* Responsive - Desktop */
@media (min-width: 992px) {
    .recipe-info-card {
        box-shadow: 0 2px 8px rgba(var(--bs-black-rgb), 0.08);
        border-radius: 0.75rem;
    }

    .ingredients-table {
        font-size: 0.95rem;
    }

    .converter-card {
        position: sticky;
        top: 1rem;
    }
}

/* ========================================
   Recipe Detail Page - Accordion Layout
   Refactoring 2025: Modern accordion-based sidebar
   ======================================== */







/* Detail item layout (icon + label) */
.detail-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.detail-label {
    font-weight: 500;
}

/* Accordion custom styling - Remove default caret & add custom chevron */
.accordion-button::after {
    display: none;
}

.accordion-button {
    gap: 0.5rem;
}

.accordion-button .chev {
    margin-left: auto;
    transition: transform 0.25s ease;
    color: var(--bs-secondary-color);
    font-size: 1rem;
}

.accordion-button:not(.collapsed) .chev {
    transform: rotate(180deg);
}

/* List-group zebra striping + hover effects */
.list-group-flush .list-group-item:nth-child(odd) {
    background: rgba(var(--bs-black-rgb), 0.02);
}

.list-group-item {
    transition: background 0.12s ease, transform 0.06s ease;
}

.list-group-item:hover {
    background: rgba(var(--bs-black-rgb), 0.035);
    transform: translateY(-1px);
}

/* Badge improvements */
.rounded-pill {
    padding: 0.35rem 0.6rem;
    font-weight: 600;
}

/* Card spacing helper */
.card + .card {
    margin-top: 0.75rem;
}

/* Recipe image styling */
.recipe-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.card-img-top-placeholder {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .icon-accent {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
        border-radius: 6px;
    }
}

/* Print optimization - Hide interactive controls */
@media print {
    .no-print {
        display: none !important;
    }

    /* Show all accordion content when printing */
    .accordion-collapse {
        display: block !important;
        height: auto !important;
    }

    /* Remove accordion button styling for print */
    .accordion-button {
        background: transparent !important;
        color: var(--bs-body-color) !important;
    }

    /* Optimize spacing for print */
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* --- Recipe Card Image-Focused (Design 2) --- */
.recipe-card-v2 {
    position: relative;
    border: none;
    overflow: hidden;
    border-radius: 0.5rem;
    color: var(--bs-white);
    box-shadow: 0 4px 12px rgba(var(--bs-black-rgb), 0.1);
    transition: all 0.3s ease;
}
.recipe-card-v2:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(var(--bs-black-rgb), 0.2);
}
.recipe-card-v2 img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.recipe-card-v2:hover img {
    transform: scale(1.05);
}
.recipe-card-v2 .card-img-overlay {
    background: linear-gradient(to top, rgba(var(--bs-black-rgb),0.85) 0%, rgba(var(--bs-black-rgb),0) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}
.recipe-card-v2 .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}
 .recipe-card-v2 .card-title a {
    text-decoration: none;
    color: var(--bs-white);
}
.recipe-card-v2 .recipe-info {
    font-size: 0.8rem;
    display: flex;
    gap: 1rem;
}
.recipe-card-v2 .recipe-info .bi {
    margin-right: 0.3rem;
}

/* --- Recipe Card v2 Image Placeholder --- */
.recipe-card-v2-placeholder {
    width: 100%;
    height: 350px; /* Match the img height in .recipe-card-v2 */
    background: linear-gradient(135deg, var(--bs-tertiary-bg) 0%, var(--bs-secondary-bg) 100%); /* Similar to old placeholder background */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem 0.5rem 0 0; /* Match card border-radius */
}

.recipe-card-v2-placeholder i {
    font-size: 3.5rem; /* Adjust size as needed */
    color: rgba(var(--bs-black-rgb), 0.2);
}
