/* Print-Specific Styles */

@media print {
    /* Hide navigation and non-essential elements */
    .sidebar,
    .header,
    .search-bar,
    .user-profile,
    .dark-mode-toggle,
    .notification-bell-container,
    .btn-primary,
    .btn-secondary,
    .btn-cancel,
    .btn-danger,
    .close-modal,
    button.btn,
    .form-actions,
    .print-hide,
    .no-print,
    footer {
        display: none !important;
    }

    /* Reset body and main content */
    body {
        margin: 0;
        padding: 0;
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.5;
    }

    body.dark-mode {
        background: white !important;
        color: black !important;
    }

    .container {
        display: block;
        width: 100%;
    }

    .main-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .content {
        width: 100%;
        padding: 20px;
    }

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

    .print-header h1 {
        margin: 0;
        font-size: 24pt;
        color: #000;
    }

    .print-header p {
        margin: 5px 0 0 0;
        font-size: 11pt;
        color: #666;
    }

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

    /* Modal content - print modals as full page */
    .modal {
        display: block !important;
        position: static !important;
        background: white !important;
        overflow: visible !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
    }

    .modal-header {
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    .modal-header h2 {
        color: #000;
        font-size: 20pt;
    }

    /* Cards and containers */
    .card,
    .stat-card,
    .chart-container {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }

    .card-header {
        border-bottom: 1px solid #ddd;
    }

    /* Tables */
    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: auto;
        font-size: 11pt;
    }

    table, th, td {
        border: 1px solid #333 !important;
        color: #000 !important;
    }

    th {
        background: #f5f5f5 !important;
        color: #000 !important;
        font-weight: bold;
        padding: 8px !important;
    }

    td {
        padding: 6px 8px !important;
        background: white !important;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    /* Badges and status indicators */
    .badge,
    .status-badge,
    .priority-badge {
        border: 1px solid #333 !important;
        padding: 2px 6px !important;
        background: white !important;
        color: #000 !important;
    }

    .badge-success {
        border-color: #28a745 !important;
        color: #28a745 !important;
    }

    .badge-warning {
        border-color: #ffc107 !important;
        color: #856404 !important;
    }

    .badge-danger {
        border-color: #dc3545 !important;
        color: #dc3545 !important;
    }

    /* Form groups for printing filled forms */
    .form-group {
        margin-bottom: 15px;
        page-break-inside: avoid;
    }

    .form-group label {
        font-weight: bold;
        color: #000;
        display: block;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        border: 1px solid #999 !important;
        padding: 5px;
        background: white !important;
        color: #000 !important;
    }

    /* Lists */
    .list-item {
        border-bottom: 1px solid #ddd !important;
        padding: 10px 0;
        page-break-inside: avoid;
    }

    /* Timeline for case details */
    .timeline-item {
        page-break-inside: avoid;
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #ddd;
    }

    /* Stats grid */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 10px;
    }

    /* Hide interactive elements */
    a[href]:not(.print-link)::after {
        content: none !important;
    }

    button,
    .btn,
    input[type="button"],
    input[type="submit"] {
        display: none !important;
    }

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

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

    .no-break {
        page-break-inside: avoid;
    }

    /* Headings */
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
    }

    h1 {
        font-size: 20pt;
    }

    h2 {
        font-size: 18pt;
    }

    h3 {
        font-size: 16pt;
    }

    /* Print-specific classes */
    .print-only {
        display: block !important;
    }

    .print-inline {
        display: inline !important;
    }

    .print-section {
        margin-bottom: 30px;
        page-break-inside: avoid;
    }

    .print-title {
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 15px;
        border-bottom: 2px solid #333;
        padding-bottom: 5px;
    }

    /* Invoice-specific styles */
    .invoice-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #333;
    }

    .invoice-details {
        background: #f9f9f9 !important;
        padding: 15px;
        margin-bottom: 20px;
        border: 1px solid #ddd;
    }

    .invoice-items table {
        margin-bottom: 20px;
    }

    .invoice-total {
        text-align: left;
        font-size: 14pt;
        font-weight: bold;
        margin-top: 20px;
        padding-top: 15px;
        border-top: 2px solid #333;
    }

    /* Case details specific */
    .case-details-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }

    .case-detail-item {
        padding: 10px;
        background: #f9f9f9 !important;
        border: 1px solid #ddd;
    }

    .case-detail-item strong {
        display: block;
        margin-bottom: 5px;
        color: #000;
    }

    /* Client details specific */
    .client-info-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }

    .client-info-item {
        padding: 10px;
        background: #f9f9f9 !important;
        border: 1px solid #ddd;
    }

    /* Notes section */
    .notes-section {
        margin-top: 20px;
        padding-top: 15px;
        border-top: 1px solid #ddd;
    }

    .note-item {
        margin-bottom: 15px;
        padding: 10px;
        background: #f9f9f9 !important;
        border-right: 3px solid #3498db;
        page-break-inside: avoid;
    }

    /* Signature area */
    .signature-area {
        margin-top: 50px;
        padding-top: 20px;
        border-top: 1px dashed #999;
        display: flex;
        justify-content: space-between;
    }

    .signature-box {
        width: 200px;
        text-align: center;
    }

    .signature-line {
        border-bottom: 1px solid #333;
        margin-bottom: 5px;
        height: 50px;
    }

    /* Company logo placeholder */
    .print-logo {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
    }

    /* Date and time stamps */
    .print-date {
        display: block !important;
        text-align: left;
        font-size: 10pt;
        color: #666;
        margin-bottom: 20px;
    }

    /* QR code or barcode placeholder */
    .print-qr {
        display: block !important;
        text-align: center;
        margin-top: 20px;
    }

    /* Optimize for black and white printing */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Ensure good contrast */
    .text-muted,
    .secondary-text {
        color: #666 !important;
    }

    /* Grid layouts */
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Remove margins for cleaner print */
    @page {
        margin: 1.5cm;
        size: A4 portrait;
    }

    @page :first {
        margin-top: 2cm;
    }

    /* Landscape orientation for wide tables */
    @page landscape {
        size: A4 landscape;
    }

    .landscape {
        page: landscape;
    }
}

/* Print utility classes (can be used in HTML) */
.print-only {
    display: none;
}

.print-hide {
    display: block;
}

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

