/**
 * Print Styles untuk Sistem Surat Keterangan Sekolah
 */

@media print {
    /* Reset untuk print */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Hide elements yang tidak perlu di print */
    .sidebar,
    .btn,
    .alert,
    nav,
    .navbar,
    .card-header,
    .floating-shapes,
    .no-print,
    .d-print-none,
    .toast-container,
    .modal,
    .dropdown-menu,
    .pagination,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        display: none !important;
    }
    
    /* Body styling */
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Page setup */
    @page {
        size: A4;
        margin: 2cm 1.5cm;
    }
    
    /* Container adjustments */
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Card styling for print */
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: white !important;
        margin-bottom: 1rem !important;
        page-break-inside: avoid;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Table styling */
    .table {
        background: white !important;
        color: black !important;
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #333 !important;
        padding: 8px !important;
        font-size: 10pt !important;
    }
    
    .table thead th {
        background: #f8f9fa !important;
        color: black !important;
        font-weight: bold !important;
    }
    
    /* Typography */
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }
    
    h1 { font-size: 18pt !important; }
    h2 { font-size: 16pt !important; }
    h3 { font-size: 14pt !important; }
    h4 { font-size: 12pt !important; }
    h5 { font-size: 11pt !important; }
    h6 { font-size: 10pt !important; }
    
    p {
        orphans: 3;
        widows: 3;
    }
    
    /* Links */
    a {
        color: black !important;
        text-decoration: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    /* Page breaks */
    .page-break {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .no-page-break {
        page-break-inside: avoid;
    }
    
    /* Header untuk print */
    .print-header {
        text-align: center;
        margin-bottom: 2rem;
        border-bottom: 2px solid #333;
        padding-bottom: 1rem;
    }
    
    .print-header h1 {
        margin: 0;
        font-size: 16pt;
        font-weight: bold;
    }
    
    .print-header p {
        margin: 0.5rem 0 0 0;
        font-size: 10pt;
    }
    
    /* Footer untuk print */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        color: #666;
        border-top: 1px solid #ddd;
        padding-top: 0.5rem;
    }
    
    /* Specific untuk surat */
    .surat-header {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .surat-header img {
        max-height: 80px;
        margin-bottom: 1rem;
    }
    
    .surat-content {
        line-height: 1.6;
        text-align: justify;
    }
    
    .surat-signature {
        margin-top: 3rem;
        text-align: right;
    }
    
    .surat-signature img {
        max-height: 60px;
        margin: 1rem 0;
    }
    
    /* Data siswa table */
    .student-data {
        margin: 1rem 0;
    }
    
    .student-data table {
        width: 100%;
        border: none !important;
    }
    
    .student-data td {
        border: none !important;
        padding: 0.25rem 0.5rem !important;
        vertical-align: top;
    }
    
    .student-data td:first-child {
        width: 30%;
        font-weight: bold;
    }
    
    .student-data td:nth-child(2) {
        width: 5%;
        text-align: center;
    }
    
    /* Statistics untuk dashboard */
    .print-stats {
        display: flex;
        justify-content: space-around;
        margin: 1rem 0;
        border: 1px solid #ddd;
        padding: 1rem;
    }
    
    .print-stat-item {
        text-align: center;
    }
    
    .print-stat-number {
        font-size: 18pt;
        font-weight: bold;
        color: #333;
    }
    
    .print-stat-label {
        font-size: 10pt;
        color: #666;
    }
    
    /* QR Code atau barcode */
    .print-qr {
        text-align: center;
        margin: 1rem 0;
    }
    
    .print-qr img {
        max-width: 100px;
        max-height: 100px;
    }
    
    /* Watermark untuk print */
    .print-watermark {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 48pt;
        color: rgba(0, 0, 0, 0.1);
        z-index: -1;
        pointer-events: none;
    }
    
    /* Form elements */
    input, select, textarea {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: 10pt !important;
    }
    
    /* Badges dan labels */
    .badge {
        border: 1px solid #333 !important;
        background: white !important;
        color: black !important;
        padding: 2px 6px !important;
        font-size: 9pt !important;
    }
    
    /* Progress bars */
    .progress {
        display: none !important;
    }
    
    /* Responsive adjustments untuk print */
    .row {
        margin: 0 !important;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
    .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
    .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
    .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
    .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12,
    .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6,
    .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 {
        padding: 0 !important;
    }
    
    /* Utility classes untuk print */
    .d-print-block {
        display: block !important;
    }
    
    .d-print-inline {
        display: inline !important;
    }
    
    .d-print-inline-block {
        display: inline-block !important;
    }
    
    .d-print-none {
        display: none !important;
    }
    
    .print-break-before {
        page-break-before: always;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    .print-break-inside-avoid {
        page-break-inside: avoid;
    }
}