/* Print-specific CSS for ROPA Management */

@media print {
    /* Page setup */
    @page {
        margin: 1in;
        size: letter;
    }
    
    /* Body and typography */
    body {
        font-family: "Times New Roman", serif !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Hide elements that shouldn't be printed */
    .no-print,
    nav,
    .navbar,
    .sidebar,
    button,
    .btn,
    .dropdown,
    .modal,
    .tooltip,
    .popover,
    .alert,
    .badge,
    .print-actions,
    .export-actions,
    .action-buttons,
    .breadcrumb,
    .pagination,
    .htmx-indicator,
    #loading-indicator,
    .dropdown-menu,
    .dropdown-toggle,
    form,
    input,
    select,
    textarea,
    .form-actions,
    .bulk-actions,
    .search-form,
    .filter-form {
        display: none !important;
    }
    
    /* Page breaks */
    .page-break {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .avoid-break {
        page-break-inside: avoid;
    }
    
    /* Headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000 !important;
        font-weight: bold !important;
    }
    
    h1 {
        font-size: 20pt !important;
        margin-bottom: 20pt !important;
        text-align: center;
    }
    
    h2 {
        font-size: 16pt !important;
        margin-top: 20pt !important;
        margin-bottom: 12pt !important;
        border-bottom: 2pt solid #000 !important;
        padding-bottom: 4pt !important;
    }
    
    h3 {
        font-size: 14pt !important;
        margin-top: 16pt !important;
        margin-bottom: 8pt !important;
    }
    
    h4 {
        font-size: 12pt !important;
        margin-top: 12pt !important;
        margin-bottom: 6pt !important;
    }
    
    /* Paragraphs and text */
    p {
        margin-bottom: 8pt !important;
        text-align: justify;
    }
    
    /* Lists */
    ul, ol {
        margin-bottom: 12pt !important;
    }
    
    li {
        margin-bottom: 4pt !important;
    }
    
    /* Tables */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 12pt !important;
        font-size: 11pt !important;
    }
    
    th, td {
        border: 1pt solid #000 !important;
        padding: 6pt !important;
        text-align: left !important;
        vertical-align: top !important;
    }
    
    th {
        background: #f5f5f5 !important;
        font-weight: bold !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Specific ROPA styles */
    .ropa-header {
        text-align: center;
        margin-bottom: 30pt !important;
    }
    
    .ropa-section {
        margin-bottom: 20pt !important;
        page-break-inside: avoid;
    }
    
    .ropa-section-title {
        font-weight: bold !important;
        font-size: 14pt !important;
        margin-bottom: 8pt !important;
        border-bottom: 1pt solid #000 !important;
        padding-bottom: 4pt !important;
    }
    
    .ropa-field-label {
        font-weight: bold !important;
        margin-top: 8pt !important;
        margin-bottom: 4pt !important;
    }
    
    .ropa-field-value {
        margin-bottom: 8pt !important;
        padding-left: 12pt !important;
    }
    
    /* Tags and badges (convert to simple text) */
    .tag,
    .badge,
    .status-badge,
    .inline-flex {
        display: inline !important;
        background: none !important;
        border: 1pt solid #ccc !important;
        padding: 2pt 6pt !important;
        margin: 2pt !important;
        font-size: 10pt !important;
        color: #000 !important;
    }
    
    /* Status indicators */
    .status-active::before {
        content: "✓ ";
    }
    
    .status-inactive::before {
        content: "✗ ";
    }
    
    /* Remove background colors and shadows */
    * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        color: #000 !important;
    }
    
    /* Links */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
    
    /* Cards and containers */
    .card,
    .container,
    .shadow,
    .rounded,
    .bg-white,
    .bg-gray-50,
    .bg-gray-100 {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    /* Grid layouts - convert to single column */
    .grid,
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .lg\:grid-cols-2,
    .lg\:grid-cols-3,
    .sm\:grid-cols-2,
    .sm\:grid-cols-3 {
        display: block !important;
    }
    
    .grid > * {
        display: block !important;
        width: 100% !important;
        margin-bottom: 12pt !important;
    }
    
    /* Flex layouts */
    .flex,
    .inline-flex {
        display: block !important;
    }
    
    .flex > *,
    .inline-flex > * {
        display: block !important;
        margin-bottom: 4pt !important;
    }
    
    /* Statistics cards */
    .stat-card {
        border: 1pt solid #000 !important;
        padding: 12pt !important;
        margin-bottom: 12pt !important;
        page-break-inside: avoid;
    }
    
    .stat-value {
        font-size: 16pt !important;
        font-weight: bold !important;
    }
    
    .stat-label {
        font-size: 10pt !important;
        font-weight: normal !important;
    }
    
    /* Footer */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt !important;
        border-top: 1pt solid #000 !important;
        padding-top: 6pt !important;
        background: #fff !important;
    }
    
    /* Document metadata */
    .document-meta {
        font-size: 10pt !important;
        color: #666 !important;
        text-align: right;
        margin-bottom: 20pt !important;
    }
    
    /* Compliance information */
    .compliance-info {
        border: 2pt solid #000 !important;
        padding: 12pt !important;
        margin: 20pt 0 !important;
        font-size: 10pt !important;
        text-align: center;
        page-break-inside: avoid;
    }
    
    /* Processing activity specific styles */
    .activity-header {
        border-bottom: 2pt solid #000 !important;
        padding-bottom: 8pt !important;
        margin-bottom: 16pt !important;
    }
    
    .activity-name {
        font-size: 18pt !important;
        font-weight: bold !important;
        margin-bottom: 4pt !important;
    }
    
    .activity-meta {
        font-size: 10pt !important;
        color: #666 !important;
    }
    
    /* Data categories display */
    .data-categories {
        margin: 8pt 0 !important;
    }
    
    .data-category {
        display: inline-block !important;
        border: 1pt solid #000 !important;
        padding: 2pt 4pt !important;
        margin: 1pt !important;
        font-size: 9pt !important;
    }
    
    /* Legal basis and security measures */
    .legal-section {
        border: 1pt solid #000 !important;
        padding: 8pt !important;
        margin: 12pt 0 !important;
        page-break-inside: avoid;
    }
    
    /* Ensure important content is visible */
    .print-important {
        font-weight: bold !important;
        font-size: 12pt !important;
    }
    
    /* Page numbering */
    .page-number::after {
        content: counter(page);
    }
    
    /* Orphans and widows control */
    p, li {
        orphans: 2;
        widows: 2;
    }
    
    /* Specific overrides for Tailwind classes that might interfere */
    .text-gray-500,
    .text-gray-600,
    .text-gray-700,
    .text-gray-800,
    .text-gray-900,
    .text-blue-600,
    .text-green-600,
    .text-red-600,
    .text-yellow-600,
    .text-purple-600 {
        color: #000 !important;
    }
    
    .bg-blue-100,
    .bg-green-100,
    .bg-red-100,
    .bg-yellow-100,
    .bg-purple-100,
    .bg-gray-100,
    .bg-gray-50 {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
