/**
 * =============================================================================
 * SILBERRADAR.EU - PRINT STYLES
 * =============================================================================
 * Optimierte Styles für Druckausgabe
 * Sprint: 8 (FINAL)
 * =============================================================================
 */

@media print {
    /* ==========================================================================
       RESET & BASE
       ========================================================================== */
    
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    html {
        font-size: 11pt;
    }
    
    body {
        font-family: Georgia, "Times New Roman", serif;
        line-height: 1.5;
        margin: 0;
        padding: 0;
    }
    
    /* ==========================================================================
       HIDE ELEMENTS
       ========================================================================== */
    
    /* Navigation & Interactive Elements */
    header,
    footer,
    nav,
    .nav,
    .btn,
    .btn-icon,
    .form-actions,
    .quick-actions,
    .chart-actions,
    .table-filters,
    .period-filter,
    .price-badge,
    .print-bar,
    .export-buttons,
    .sidebar-card,
    .settings-sidebar,
    .breadcrumb,
    .alert,
    [data-animate],
    .toggle-switch,
    .chart-toggle,
    .empty-state a,
    a[href^="javascript"],
    a[href^="#"] {
        display: none !important;
    }
    
    /* ==========================================================================
       LAYOUT
       ========================================================================== */
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    section {
        page-break-inside: avoid;
        margin-bottom: 20pt;
    }
    
    /* ==========================================================================
       TYPOGRAPHY
       ========================================================================== */
    
    h1 {
        font-size: 18pt;
        margin-bottom: 10pt;
        padding-bottom: 5pt;
        border-bottom: 1pt solid #ccc;
    }
    
    h2 {
        font-size: 14pt;
        margin-top: 15pt;
        margin-bottom: 8pt;
    }
    
    h3 {
        font-size: 12pt;
        margin-top: 12pt;
        margin-bottom: 6pt;
    }
    
    p {
        margin-bottom: 8pt;
        orphans: 3;
        widows: 3;
    }
    
    /* ==========================================================================
       LINKS
       ========================================================================== */
    
    a {
        text-decoration: none;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666 !important;
    }
    
    a[href^="/"]::after,
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
    
    /* ==========================================================================
       TABLES
       ========================================================================== */
    
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        page-break-inside: auto;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    th,
    td {
        padding: 6pt 8pt;
        text-align: left;
        border: 1pt solid #ccc;
    }
    
    th {
        background: #f0f0f0 !important;
        font-weight: bold;
    }
    
    /* Show hidden columns */
    .profit-table th,
    .profit-table td {
        display: table-cell !important;
    }
    
    /* ==========================================================================
       KPI CARDS
       ========================================================================== */
    
    .kpi-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10pt;
        margin-bottom: 15pt;
    }
    
    .kpi-card {
        flex: 1;
        min-width: 150pt;
        padding: 10pt;
        border: 1pt solid #ccc;
    }
    
    .kpi-icon {
        display: none;
    }
    
    .kpi-label {
        font-size: 9pt;
        color: #666 !important;
    }
    
    .kpi-value {
        font-size: 14pt;
        font-weight: bold;
    }
    
    .kpi-sub {
        font-size: 9pt;
    }
    
    /* ==========================================================================
       PROFIT DISPLAY
       ========================================================================== */
    
    .profit-hero {
        padding: 15pt;
        border: 2pt solid #000;
        margin-bottom: 15pt;
    }
    
    .profit-hero-value {
        font-size: 24pt;
        font-weight: bold;
        text-align: center;
    }
    
    .profit-hero-percent {
        font-size: 14pt;
        text-align: center;
    }
    
    .profit-hero-details {
        display: flex;
        flex-wrap: wrap;
        gap: 10pt;
        margin-top: 10pt;
    }
    
    .detail-item {
        flex: 1;
        padding: 8pt;
        border: 1pt solid #ccc;
    }
    
    /* Status colors in print */
    .status-profit .profit-hero-value,
    .status-profit .profit-value,
    .status-profit .profit-percent,
    .profit {
        color: #006600 !important;
    }
    
    .status-loss .profit-hero-value,
    .status-loss .profit-value,
    .status-loss .profit-percent,
    .loss {
        color: #cc0000 !important;
    }
    
    /* ==========================================================================
       CHARTS - REPLACE WITH PLACEHOLDER
       ========================================================================== */
    
    .chart-card {
        page-break-inside: avoid;
        border: 1pt solid #ccc;
        padding: 10pt;
        margin-bottom: 10pt;
    }
    
    .chart-header {
        border-bottom: 1pt solid #ccc;
        padding-bottom: 5pt;
        margin-bottom: 10pt;
    }
    
    .chart-body {
        min-height: 100pt;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .chart-body canvas {
        display: none;
    }
    
    .chart-body::after {
        content: "[Chart - Siehe digitale Version]";
        font-style: italic;
        color: #666 !important;
    }
    
    /* ==========================================================================
       FORMS & SETTINGS
       ========================================================================== */
    
    .settings-card,
    .form-card {
        border: 1pt solid #ccc;
        padding: 15pt;
    }
    
    .settings-section {
        margin-bottom: 15pt;
        padding-bottom: 10pt;
        border-bottom: 1pt solid #eee;
    }
    
    .form-group {
        margin-bottom: 10pt;
    }
    
    label {
        display: block;
        font-weight: bold;
        margin-bottom: 3pt;
    }
    
    input,
    select,
    textarea {
        border: 1pt solid #ccc;
        padding: 5pt;
        width: 100%;
    }
    
    /* ==========================================================================
       DETAIL PAGES
       ========================================================================== */
    
    .profit-detail-card,
    .detail-section {
        border: 1pt solid #ccc;
        padding: 10pt;
        margin-bottom: 10pt;
        page-break-inside: avoid;
    }
    
    .detail-list {
        margin: 0;
    }
    
    .detail-row {
        display: flex;
        justify-content: space-between;
        padding: 5pt 0;
        border-bottom: 1pt dotted #ccc;
    }
    
    .detail-row:last-child {
        border-bottom: none;
    }
    
    /* ==========================================================================
       PAGE BREAKS
       ========================================================================== */
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    table, figure, img {
        page-break-inside: avoid;
    }
    
    /* ==========================================================================
       PRINT HEADER & FOOTER
       ========================================================================== */
    
    @page {
        size: A4;
        margin: 15mm 20mm;
    }
    
    @page :first {
        margin-top: 20mm;
    }
    
    /* Add print header */
    .page-header::before {
        content: "SilberRadar.eu - Portfolio-Übersicht";
        display: block;
        font-size: 10pt;
        color: #666 !important;
        margin-bottom: 10pt;
    }
    
    /* Add print footer with page numbers handled by browser */
    
    /* ==========================================================================
       SPECIFIC PAGE TYPES
       ========================================================================== */
    
    /* Dashboard */
    .dashboard .kpi-grid {
        margin-bottom: 20pt;
    }
    
    /* Profit Overview */
    .profit-table-card {
        page-break-before: auto;
    }
    
    /* Purchase Details */
    .value-comparison {
        display: flex;
        justify-content: space-around;
        margin: 15pt 0;
    }
    
    .value-box {
        padding: 10pt;
        border: 1pt solid #ccc;
        text-align: center;
        width: 40%;
    }
    
    .value-arrow {
        display: flex;
        align-items: center;
        font-size: 20pt;
    }
}
