/* Print Stylesheet for PizzaLogic Recipe Cards */

/* Reset and base styles for print */
@page {
    margin: 1cm;
    size: letter;
}

* {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff !important;
    padding: 0;
    margin: 0;
}

/* Hide non-essential elements */
.mode-toggle-container,
.theme-selector,
.mode-toggle,
.style-grid,
.time-options,
.preset-buttons,
.form-group,
.form-grid,
.form-grid-2col,
.stepper,
.affiliate-container,
.affiliate-disclosure,
.details-toggle,
.details-content,
.info-toggle,
.info-content,
.calc-info-section,
.modal-overlay,
.share-section,
.share-btn,
.app-footer,
.kitchen-scale-link,
#panSizeGroup,
#roundSizeGroup,
#presetSizeSection,
#presetDescription,
#doughDetailsToggle,
#doughDetailsContent,
#advCalcInfoToggle,
#advCalcInfoContent,
.alert-info:not(#altitudeNote):not(#climateNote),
#page-header,
.hidden {
    display: none !important;
}

/* Hide the h1 page title and intro section */
h1,
.recipe-intro {
    display: none !important;
}

/* Print recipe title (populated by JavaScript) */
.print-recipe-title {
    display: block !important;
    font-size: 20pt;
    font-weight: bold;
    color: #000;
    text-align: center;
    margin: 0 0 12pt 0;
    padding: 0;
    page-break-after: avoid;
}

/* Container reset */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Hide the mode sections entirely - they only contain form cards */
#simpleMode,
#advancedMode {
    display: none !important;
}

/* Card h2 as section header (excluding print title) */
.card h2:not(.print-recipe-title) {
    font-size: 14pt;
    font-weight: bold;
    color: #333;
    text-align: left;
    margin: 0 0 10pt 0;
    padding: 0 0 6pt 0;
    border-bottom: 1pt solid #ccc;
}

/* Card styling for print */
.card {
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 8pt 0;
    margin: 0;
    box-shadow: none;
    page-break-inside: avoid;
}

.card h2 {
    font-size: 13pt;
    font-weight: bold;
    color: #000;
    margin: 0 0 8pt 0;
    padding: 0 0 4pt 0;
    border-bottom: 1pt solid #ccc;
}

/* Results grid for print */
.results {
    display: block;
    width: 100%;
    margin-bottom: 15pt;
}

.result-item {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    background: none !important;
    color: #000;
    padding: 6pt 10pt;
    border-bottom: 1pt solid #ddd;
    border-radius: 0;
}

/* Respect JS-hidden items (oil/sugar when zero) */
.result-item[style*='display: none'],
.result-item[style*='display:none'] {
    display: none !important;
}

.result-item > * {
    display: inline;
    padding: 0;
    border-bottom: none;
    vertical-align: baseline;
}

.result-label {
    flex: 0 0 40%;
    font-size: 11pt;
    font-weight: bold;
    text-align: left;
    opacity: 1;
}

.result-value {
    flex: 1;
    font-size: 14pt;
    font-weight: bold;
    text-align: right;
}

.result-unit {
    font-size: 10pt;
    font-weight: normal;
    opacity: 1;
}

.result-tsp {
    flex-basis: 100%;
    font-size: 9pt;
    opacity: 1;
    display: block;
    text-align: right;
}

/* Alert boxes for print */
.alert {
    background: #f5f5f5 !important;
    border: 1pt solid #ccc;
    border-left: 3pt solid #666;
    border-radius: 0;
    padding: 8pt 10pt;
    margin: 10pt 0;
    font-size: 10pt;
    page-break-inside: avoid;
}

.alert-warning {
    border-left-color: #f0b429;
}

.alert-danger {
    border-left-color: #e53e3e;
}

#altitudeNote,
#climateNote,
#saltWarning {
    display: block !important;
}

#altitudeNote[style*='display: none'],
#climateNote[style*='display: none'],
#saltWarning[style*='display: none'] {
    display: none !important;
}

/* Timeline for print - horizontal layout */
.timeline-container {
    border: 1pt solid #ccc;
    border-radius: 0;
    padding: 8pt;
    margin: 10pt 0;
    box-shadow: none;
    page-break-inside: avoid;
}

.timeline-header {
    border-bottom: 1pt solid #ddd;
    margin-bottom: 8pt;
    padding-bottom: 6pt;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-toggle-icon {
    display: none;
}

.timeline-title {
    font-size: 11pt;
    font-weight: bold;
    color: #000;
}

.timeline-total {
    background: #f0f0f0;
    color: #333;
    padding: 2pt 6pt;
    border-radius: 0;
    font-size: 9pt;
}

.timeline-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    max-height: none !important;
    opacity: 1 !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4pt;
}

.timeline-event {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
}

.timeline-event:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-marker {
    width: 20pt;
    height: 20pt;
    background: #333 !important;
    border-radius: 50%;
    font-size: 10pt;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4pt;
    flex-shrink: 0;
}

.timeline-line {
    display: none;
}

.timeline-content {
    margin-left: 0;
}

.timeline-label {
    font-size: 8pt;
    font-weight: bold;
    color: #000;
    line-height: 1.2;
}

.timeline-time {
    font-size: 7pt;
    color: #333;
}

/* Instructions for print */
.instructions-container {
    margin-top: 15pt;
}

.instruction-phase {
    margin-bottom: 15pt;
}

.phase-header {
    font-size: 13pt;
    font-weight: bold;
    color: #000;
    border-bottom: 1pt solid #ccc;
    padding-bottom: 6pt;
    margin-bottom: 10pt;
    text-transform: uppercase;
}

.phase-icon {
    font-size: 12pt;
}

.instruction-step {
    font-size: 11pt;
    padding: 8pt 0;
    border-bottom: 1pt dotted #ddd;
    page-break-inside: avoid;
}

.instruction-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 20pt;
    height: 20pt;
    background: #333 !important;
    font-size: 9pt;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: bold;
    color: #000;
}

.step-tip {
    background: #f5f5f5;
    border-left: 2pt solid #666;
    font-style: italic;
    margin-top: 6pt;
    padding: 6pt 8pt;
}

.step-tip .video-link {
    display: none;
}

/* Warning steps */
.instruction-step.step-warning {
    background: #fff5f5 !important;
    border: 1pt solid #e53e3e;
    border-radius: 0;
}

.instruction-step.step-info {
    background: #f0f7ff !important;
    border: 1pt solid #667eea;
    border-radius: 0;
}

/* Print footer with URL */
@page {
    @bottom-center {
        content: 'Shared with love from pizzalogic.app';
        font-size: 9pt;
        color: #999;
    }
}

/* Add URL at bottom of printed page */
body::after {
    content: 'Shared with love from pizzalogic.app';
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #999;
    margin-top: 20pt;
    padding-top: 10pt;
    border-top: 1pt solid #ddd;
}

/* Page break hints */
#resultsCard {
    page-break-before: avoid;
}

.instruction-phase {
    page-break-before: auto;
}
