/* ========================================
   RECIPE PAGE STYLES
   Compatible with Bootstrap 5.0.2
   ======================================== */

/* Page Container - White background with top spacing */
.recipe-page-container {
    background-color: #ffffff !important;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Recipe Title */
.recipe-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.recipe-description {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Recipe Meta Information */
.recipe-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.recipe-meta-item {
    display: flex;
    flex-direction: column;
}

.recipe-meta-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.recipe-meta-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #556A46;
}

/* Ingredients Section */
.ingredients-section {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.ingredients-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #556A46;
}

.ingredient-subsection {
    margin-bottom: 1.5rem;
}

.ingredient-subsection:last-child {
    margin-bottom: 0;
}

.ingredient-subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #556A46;
    margin-bottom: 0.75rem;
}

.list-group.ingredients {
    border: none;
}

.list-group.ingredients .list-group-item {
    border: none;
    background-color: transparent;
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
}

.list-group.ingredients .form-check-input {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* Recipe Steps - More Compact */
.recipe-steps {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
    max-width: 800px;
}

.recipe-steps .section-header {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    color: #2c3e50;
}

.recipe-steps .section-header:first-child {
    margin-top: 0;
}

.recipe-steps .section-header::before {
    content: none;
}

/* Compact step styling */
.recipe-steps .single-preparation-step {
    counter-increment: step-counter;
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
    padding: 1rem; /* Reduced from 1.25rem */
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.recipe-steps .single-preparation-step:hover {
    background-color: #e9ecef;
}

/* Step number circle - aligned with text */
.recipe-steps .single-preparation-step::before {
    content: counter(step-counter);
    font-size: 1.25rem; /* Slightly smaller */
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #556A46 0%, #3d4d32 100%);
    border-radius: 50%;
    width: 2.25rem; /* Slightly smaller */
    height: 2.25rem; /* Slightly smaller */
    min-width: 2.25rem; /* Prevents shrinking */
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    line-height: 1;
}

.recipe-steps .single-preparation-step p {
    margin: 0;
    line-height: 1.5; /* Slightly more compact */
    font-size: 1rem;
    color: #495057;
    padding-top: 0.125rem; /* Fine-tune vertical alignment */
}

/* Print Button - Bootstrap 5.0.2 compatible */
.print-button-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050; /* Bootstrap 5 compatible z-index */
}

.btn-print {
    background-color: #556A46 !important;
    border-color: #556A46 !important;
    color: white !important;
    padding: 0.875rem 1.75rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 12px rgba(85, 106, 70, 0.3) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.btn-print:hover,
.btn-print:focus,
.btn-print:active {
    background-color: #3d4d32 !important;
    border-color: #3d4d32 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(85, 106, 70, 0.4) !important;
}

/* Print Styles - Classic Cookbook Style */
@media print {
    @page {
        margin: 0.5in;
        size: letter portrait;
    }

    body {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        font-size: 11pt;
        line-height: 1.3;
    }

    /* Hide elements not needed in print */
    nav,
    .menu,
    .footer,
    footer,
    .print-button-container,
    .no-print {
        display: none !important;
    }

    /* Override Bootstrap grid system in print */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .col-12,
    .col-lg-4,
    .col-lg-8,
    [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        float: none !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Compact Print Header */
    .print-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 0.25rem;
        border-bottom: 1px solid #556A46;
        margin-bottom: 0.5rem;
    }

    .print-logo {
        max-height: 30px;
        width: auto;
    }

    .print-url {
        font-size: 9pt;
        color: #556A46;
        font-weight: 500;
    }

    /* Remove container padding */
    .recipe-page-container,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Compact Recipe Title */
    .recipe-title {
        font-size: 16pt;
        font-weight: bold;
        margin: 0.25rem 0 0.25rem 0;
        page-break-after: avoid;
        color: black;
    }

    .recipe-description {
        font-size: 10pt;
        margin: 0 0 0.5rem 0;
        page-break-after: avoid;
        color: #333;
        font-style: italic;
    }

    /* Compact Recipe Meta - Single Line */
    .recipe-meta {
        background: none;
        border: none;
        padding: 0;
        margin: 0 0 0.5rem 0;
        display: flex;
        gap: 1rem;
        font-size: 9pt;
        page-break-after: avoid;
    }

    .recipe-meta-item {
        display: inline;
    }

    .recipe-meta-label {
        font-weight: normal;
        text-transform: none;
        letter-spacing: normal;
    }

    .recipe-meta-label::after {
        content: ": ";
    }

    .recipe-meta-value {
        color: black;
        font-weight: normal;
    }

    /* Two Column Layout - Ingredients Left, Directions Right */
    .print-layout,
    .row.print-layout {
        display: flex !important;
        gap: 0.75rem !important;
        align-items: flex-start !important;
        flex-direction: row !important;
    }

    .print-layout > .col-12,
    .print-layout > div {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    .print-ingredients,
    .col-12.print-ingredients {
        flex: 0 0 35% !important;
        width: 35% !important;
        max-width: 35% !important;
    }

    .print-directions,
    .col-12.print-directions {
        flex: 1 !important;
        width: 65% !important;
        max-width: 65% !important;
    }

    /* Compact Ingredients - Two Column Layout Inside */
    .ingredients-section {
        background: none;
        border: none;
        padding: 0;
        margin: 0;
        border-radius: 0;
    }

    .ingredients-section h3 {
        font-size: 11pt;
        font-weight: bold;
        margin: 0 0 0.25rem 0;
        padding: 0;
        border: none;
        color: black;
    }

    .ingredient-subsection {
        margin-bottom: 0.4rem;
    }

    .ingredient-subsection:last-child {
        margin-bottom: 0;
    }

    .ingredient-subsection-title {
        font-size: 10pt;
        font-weight: bold;
        margin: 0.2rem 0 0.2rem 0;
        color: black;
    }

    /* Single column ingredient lists (two-column is at page level) */
    .list-group.ingredients {
        margin: 0;
        padding: 0;
    }

    .list-group.ingredients .list-group-item {
        padding: 0.1rem 0 0.1rem 1rem;
        font-size: 9pt;
        line-height: 1.3;
        border: none;
        background: none;
    }

    /* Simple checkboxes */
    .form-check-input {
        width: 8px;
        height: 8px;
        margin-left: -1rem;
        margin-right: 0.2rem;
        margin-top: 0.2rem;
    }

    /* Classic Directions - Simple Numbers */
    .recipe-steps {
        margin: 0;
        padding: 0 0 0 1.5rem;
        counter-reset: step-counter;
        list-style: none;
    }

    .recipe-steps .section-header {
        font-size: 11pt;
        font-weight: bold;
        margin: 0.5rem 0 0.25rem -1.5rem;
        padding: 0;
        border: none;
        color: black;
        page-break-after: avoid;
    }

    .recipe-steps .section-header:first-child {
        margin-top: 0 !important;
    }

    .recipe-steps .section-header::before {
        content: none;
    }

    /* Simple numbered steps - no boxes or circles */
    .recipe-steps .single-preparation-step {
        counter-increment: step-counter;
        padding: 0;
        margin: 0;
        background: none;
        border: none;
        border-radius: 0;
        page-break-inside: avoid;
        display: list-item;
        list-style-position: outside;
    }

    .recipe-steps .single-preparation-step::before {
        content: counter(step-counter) ". ";
        font-weight: bold;
        font-size: 10pt;
        color: black;
        background: none;
        border-radius: 0;
        width: auto;
        height: auto;
        min-width: auto;
        min-height: auto;
        display: inline;
        margin: 0;
        padding: 0;
    }

    .recipe-steps .single-preparation-step p {
        display: inline;
        font-size: 10pt;
        line-height: 1.3;
        margin: 0;
        padding: 0;
        color: black;
    }

    .recipe-steps .single-preparation-step:hover {
        background: none;
    }

    /* Remove all color backgrounds and gradients */
    * {
        background-image: none !important;
        box-shadow: none !important;
    }
}

/* Screen-only print header (hidden by default) */
.print-header {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .recipe-title {
        font-size: 2rem;
    }

    .recipe-meta {
        gap: 1rem;
    }

    .ingredients-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .recipe-steps .single-preparation-step {
        padding: 0.875rem;
    }

    .print-button-container {
        bottom: 1rem;
        right: 1rem;
    }

    .btn-print {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.95rem !important;
    }
}

@media (max-width: 575.98px) {
    .recipe-page-container {
        padding-top: 1.5rem;
    }

    .recipe-title {
        font-size: 1.75rem;
    }

    .recipe-description {
        font-size: 1rem;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ingredients-section {
        padding: 1rem;
    }
}