/* Styles for both popup and print */
.print-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.print-header .logo img {
    max-height: 60px;
}

.print-header .company-info {
    text-align: right;
    font-size: 14px;
    line-height: 1.5;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.print-table th,
.print-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.print-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.print-table td:last-child {
    text-align: right;
}

.print-total {
    text-align: right;
    font-size: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #000;
}

.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

.watermark img {
    max-width: 400px;
}

/* Print-specific styles */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        margin: 0;
        padding: 0;
    }

    /* Hide all elements except print container */
    body > *:not(.print-container) {
        display: none !important;
    }

    .print-container {
        display: block !important;
        padding: 0;
        width: 100%;
    }

    /* Ensure table fits on page */
    .print-table {
        page-break-inside: auto;
    }

    .print-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .print-table thead {
        display: table-header-group;
    }

    .print-table tfoot {
        display: table-footer-group;
    }

    /* Remove background colors for better printing */
    .print-table th {
        background-color: transparent !important;
        border: 1px solid #000;
    }

    .print-table td {
        border: 1px solid #000;
    }

    /* Ensure total stays with the table */
    .print-total {
        page-break-before: avoid;
    }

    /* Hide any remaining buttons or controls */
    button,
    .button,
    [class*="btn"],
    [id*="button"],
    .control,
    .controls {
        display: none !important;
    }

    /* Ensure links print properly */
    a {
        text-decoration: none;
        color: #000;
    }

    a[href]:after {
        content: none !important;
    }

    /* Hide non-essential elements */
    .pc-builder-header,
    .compatibility-notes,
    .component-actions,
    .action-buttons {
        display: none !important;
    }
}

/* Popup-specific styles */
@media screen {
    .print-container {
        background: white;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        border-radius: 5px;
    }

    .print-table th {
        background-color: #f5f5f5;
    }

    .print-header .company-info {
        font-size: 14px;
    }

    .print-total {
        font-weight: bold;
    }

    /* Additional styles for PC Builder specific elements */
    .component-specs {
        font-size: 12px;
        color: #666;
        margin-top: 4px;
    }

    .compatibility-status {
        margin-top: 20px;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
}
