/* Print Styles for Capital Gains Tax Calculator */
@media print {
    /* Hide unnecessary elements when printing */
    nav, .navbar, 
    .hamburger,
    footer,
    .hero-section,
    .calculator-form,
    .results-actions,
    .newsletter-widget,
    .sidebar,
    .notification,
    .save-success-message,
    button:not(.print-keep) {
        display: none !important;
    }

    /* Optimize page for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000 !important;
        background: white !important;
        margin: 0;
        padding: 20px;
    }

    /* Print header */
    .print-header {
        display: block !important;
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    .print-title {
        font-size: 18pt;
        font-weight: bold;
        margin: 0;
    }

    .print-subtitle {
        font-size: 12pt;
        color: #666;
        margin: 5px 0 0 0;
    }

    /* Results container */
    .results-container {
        display: block !important;
        page-break-inside: avoid;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        box-shadow: none !important;
    }

    .results-header h3 {
        font-size: 16pt;
        font-weight: bold;
        color: #000 !important;
        margin: 0 0 15px 0;
        text-align: center;
    }

    /* Results grid */
    .results-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .result-card {
        border: 1px solid #ccc !important;
        padding: 15px !important;
        background: white !important;
        page-break-inside: avoid;
    }

    .result-label {
        font-size: 11pt;
        font-weight: bold;
        color: #333 !important;
        margin-bottom: 5px;
    }

    .result-value {
        font-size: 14pt;
        font-weight: bold;
        color: #000 !important;
    }

    /* Detailed breakdown */
    .detailed-breakdown {
        page-break-inside: avoid;
        margin-top: 20px;
    }

    .breakdown-section {
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .breakdown-section h4 {
        font-size: 13pt;
        font-weight: bold;
        color: #000 !important;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    .breakdown-items {
        margin-left: 15px;
    }

    .breakdown-item {
        display: flex;
        justify-content: space-between;
        padding: 3px 0;
        border-bottom: 1px dotted #ccc;
    }

    .breakdown-item.highlight {
        font-weight: bold;
        border-bottom: 1px solid #000;
    }

    /* Print footer */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 10pt;
        color: #666;
        border-top: 1px solid #ccc;
        padding: 10px;
        background: white;
    }

    /* Page breaks */
    .page-break-before {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    /* Print metadata */
    .print-metadata {
        display: block !important;
        margin-bottom: 20px;
        font-size: 11pt;
        line-height: 1.3;
    }

    .print-metadata table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 15px;
    }

    .print-metadata td {
        padding: 3px 8px;
        border: 1px solid #ccc;
    }

    .print-metadata .label {
        font-weight: bold;
        background: #f5f5f5;
        width: 40%;
    }

    /* Ensure colors are print-friendly */
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Print-specific elements (hidden by default) */
.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block !important;
    }
}