/* ==========================================================================
   Diäthelfer - Druckansicht
   ========================================================================== */

@media print {
    /* Grundlegendes Reset für Druck */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        margin: 0;
        padding: 0;
    }

    /* Unnötige Elemente ausblenden */
    .site-header,
    .site-footer,
    .header-nav,
    .btn,
    .btn-primary,
    #calculateBtn,
    .macro-profiles,
    .no-print,
    .print-btn-container {
        display: none !important;
    }

    /* Formular ausblenden (nur Ergebnisse drucken) */
    #calculator-form {
        display: none !important;
    }

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

    .site-main {
        padding: 0;
    }

    /* Versteckte Sektionen im Druck anzeigen */
    .section.hidden {
        display: none !important;
    }

    .section:not(.hidden) {
        display: block !important;
        animation: none !important;
        padding: 15pt 0;
        page-break-inside: avoid;
    }

    /* Druck-Header */
    .section:first-of-type:not(.hidden)::before {
        content: "Diäthelfer - Kalorienbedarf Rechner";
        display: block;
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 5pt;
        padding-bottom: 10pt;
        border-bottom: 2pt solid #000;
    }

    .section:first-of-type:not(.hidden)::after {
        content: "Erstellt am " attr(data-print-date);
        display: block;
        font-size: 9pt;
        text-align: center;
        color: #666 !important;
        margin-bottom: 15pt;
    }

    /* Ergebnis-Karten */
    .results-grid {
        display: flex;
        gap: 20pt;
    }

    .result-card {
        border: 1pt solid #ccc;
        padding: 10pt;
        flex: 1;
        text-align: center;
    }

    .result-card--highlight {
        border-width: 2pt;
        border-color: #000;
    }

    .result-value {
        font-size: 24pt;
        font-weight: bold;
    }

    .result-label {
        font-size: 10pt;
        text-transform: uppercase;
    }

    .result-unit {
        font-size: 9pt;
    }

    /* Erklärungstexte */
    .results-explanation {
        border-left: 3pt solid #000;
        padding: 8pt;
        margin-top: 10pt;
        font-size: 10pt;
    }

    /* Diätziel-Karten */
    .goal-cards {
        display: flex;
        gap: 15pt;
    }

    .goal-card {
        border: 1pt solid #ccc;
        padding: 10pt;
        flex: 1;
        text-align: center;
    }

    .goal-card--active {
        border-width: 2pt;
        border-color: #000;
    }

    .goal-calories {
        font-size: 18pt;
        font-weight: bold;
    }

    .goal-description {
        font-size: 9pt;
    }

    /* Prognose */
    .diet-prognosis {
        border-left: 3pt solid #666;
        padding: 8pt;
        margin-top: 10pt;
        font-size: 10pt;
    }

    /* Makros */
    .macros-grid {
        display: flex;
        gap: 15pt;
    }

    .macro-card {
        border: 1pt solid #ccc;
        border-top: 3pt solid #666;
        padding: 10pt;
        flex: 1;
        text-align: center;
    }

    .macro-card--protein {
        border-top-color: #000;
    }

    .macro-card--carbs {
        border-top-color: #666;
    }

    .macro-card--fat {
        border-top-color: #999;
    }

    .macro-value {
        font-size: 18pt;
        font-weight: bold;
    }

    .macro-bar {
        height: 6pt;
        background: #eee !important;
        border: 1pt solid #ccc;
        margin: 5pt 0;
    }

    .macro-bar-fill {
        background: #000 !important;
        height: 100%;
    }

    /* Chart im Druck */
    .macro-chart-container {
        text-align: center;
        margin-bottom: 15pt;
    }

    #macroChart {
        width: 150pt;
        height: 150pt;
    }

    #macroChart circle {
        stroke: #000 !important;
    }

    .macro-chart-legend {
        margin-top: 5pt;
    }

    .legend-item {
        font-size: 9pt;
    }

    .legend-color {
        border: 1pt solid #000;
    }

    /* Seitenumbruch-Kontrolle */
    .section-title {
        page-break-after: avoid;
    }

    .results-grid,
    .goal-cards,
    .macros-grid {
        page-break-inside: avoid;
    }

    /* Footer-Info im Druck */
    .site-main::after {
        content: "Die Berechnungen dienen nur zur Orientierung und ersetzen keine professionelle Ernährungsberatung. | diaethelfer.github.io";
        display: block;
        font-size: 8pt;
        text-align: center;
        color: #999 !important;
        margin-top: 20pt;
        padding-top: 10pt;
        border-top: 1pt solid #ccc;
    }

    /* Links im Druck */
    a[href]::after {
        content: none;
    }
}
