/* FileMaker Print Forms CSS */

/* Screen styles for print controls */
.print-controls {
    background: #f8f9fa;
    border: 2px solid #007cba;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.print-button, .close-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.print-button:hover {
    background: #005a87;
}

.close-button {
    background: #666;
}

.close-button:hover {
    background: #444;
}

.print-instructions {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    text-align: left;
}

.print-instructions ul {
    margin: 10px 0;
    padding-left: 20px;
}

.print-instructions li {
    margin: 5px 0;
}

/* SIMPLIFIED Print-specific styles */
@media print {
    /* A4 page setup */
    @page {
        size: A4;
        margin: 15mm;
    }
    
    /* Hide WordPress admin and navigation elements */
    #wpadminbar,
    .admin-bar,
    .wp-toolbar,
    .site-header,
    .site-footer,
    .navigation,
    .breadcrumbs,
    .sidebar,
    .comments,
    .post-navigation,
    .entry-meta,
    .print-controls {
        display: none !important;
    }
    
    /* Fix admin bar margin issues for logged-in users */
    html.wp-toolbar,
    body.admin-bar {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Basic print styling */
    html, body {
        font-family: Arial, sans-serif !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: black !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ensure print container is visible and well-formatted */
    .filemaker-print-container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
    }
    
    /* Print header */
    .filemaker-print-header {
        margin-bottom: 20pt;
        padding-bottom: 10pt;
        border-bottom: 2pt solid black;
    }
    
    .print-form-title {
        font-size: 18pt;
        font-weight: bold;
        margin-bottom: 8pt;
        color: black;
    }
    
    .print-meta {
        font-size: 10pt;
        color: #666;
    }
    
    .print-meta span {
        margin-right: 15pt;
    }
    
    /* FIXED Page breaks - no page break before first page */
    .filemaker-print-page {
        margin-bottom: 15pt;
        page-break-inside: avoid;
    }
    
    .filemaker-print-page.page-break:not(:first-child) {
        page-break-before: always;
    }
    
    /* Page titles */
    .page-title {
        font-size: 16pt;
        font-weight: bold;
        margin-bottom: 15pt;
        padding-bottom: 5pt;
        border-bottom: 1pt solid black;
        color: black;
    }
    
    /* Form fields */
    .print-field {
        margin-bottom: 8pt;
        break-inside: avoid;
    }
    
    .print-label {
        font-weight: bold;
        font-size: 11pt;
        color: black;
        margin-bottom: 2pt;
        display: block;
    }
    
    .print-value {
        font-size: 11pt;
        color: black;
        padding: 2pt 0;
        border-bottom: 1pt dotted #999;
        min-height: 12pt;
    }
    
    /* Images */
    .print-image-field {
        margin-bottom: 20pt;
        break-inside: avoid;
    }
    
    .print-image img {
        max-width: 100% !important;
        height: auto !important;
        max-height: 400pt !important;
        display: block;
        margin: 5pt 0;
    }
    
    /* Headings */
    .print-heading h1,
    .print-heading h2,
    .print-heading h3,
    .print-heading h4,
    .print-heading h5,
    .print-heading h6 {
        margin: 10pt 0 5pt 0;
        color: black;
        break-after: avoid;
        font-weight: bold;
    }
    
    .print-heading h1 { font-size: 18pt; }
    .print-heading h2 { font-size: 16pt; }
    .print-heading h3 { font-size: 14pt; }
    .print-heading h4 { font-size: 13pt; }
    .print-heading h5 { font-size: 12pt; }
    .print-heading h6 { font-size: 11pt; }
}

/* Screen styles for print preview */
@media screen {
    .filemaker-print-container {
        max-width: 210mm; /* A4 width */
        margin: 0 auto;
        padding: 20px;
        background: white;
        border: 1px solid #ddd;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
        font-family: 'Arial', 'Helvetica', sans-serif;
    }
    
    .filemaker-print-page {
        min-height: 250mm; /* Approximate A4 height */
        padding: 20px;
        margin-bottom: 20px;
        border-bottom: 2px dashed #ccc;
    }
    
    .filemaker-print-page:last-child {
        border-bottom: none;
    }
    
    .filemaker-print-header {
        margin-bottom: 30px;
        border-bottom: 2px solid #333;
        padding-bottom: 15px;
    }
    
    .print-form-title {
        font-size: 24px;
        font-weight: bold;
        margin: 0 0 10px 0;
        color: #000;
    }
    
    .print-meta {
        font-size: 14px;
        color: #666;
    }
    
    .print-meta span {
        margin-right: 20px;
    }
    
    .page-title {
        font-size: 20px;
        font-weight: bold;
        margin: 0 0 20px 0;
        padding-bottom: 5px;
        border-bottom: 1px solid #ccc;
        color: #000;
    }
    
    .print-field {
        margin-bottom: 15px;
    }
    
    .print-field.inline-field {
        display: inline-block;
        width: 48%;
        margin-right: 2%;
        vertical-align: top;
    }
    
    .print-field.inline-field:nth-child(even) {
        margin-right: 0;
    }
    
    .print-label {
        font-weight: bold;
        color: #000;
        display: block;
        margin-bottom: 5px;
    }
    
    .print-value {
        color: #333;
        padding: 5px 0;
        border-bottom: 1px dotted #ccc;
        min-height: 20px;
    }
    
    .print-heading h1,
    .print-heading h2,
    .print-heading h3,
    .print-heading h4,
    .print-heading h5,
    .print-heading h6 {
        margin: 20px 0 10px 0;
        padding: 0;
        color: #000;
    }
    
    .print-info {
        margin: 10px 0;
        color: #666;
        font-style: italic;
    }
    
    .print-divider {
        margin: 15px 0;
    }
    
    .print-divider hr {
        border: 0;
        height: 1px;
        background: #ccc;
        margin: 0;
    }
    
    .print-image-field {
        margin-bottom: 20px;
    }
    
    .print-image img {
        max-width: 100%;
        height: auto;
        max-height: 300px;
        display: block;
        margin: 5px 0;
        border: 1px solid #ddd;
    }
    
    .print-checkbox-field .checkbox-list {
        list-style: none;
        padding: 0;
        margin: 5px 0;
    }
    
    .print-checkbox-field .checkbox-list li {
        margin-bottom: 3px;
        color: #333;
    }
    
    .print-actions {
        margin: 20px 0;
        padding: 15px;
        background: #f8f9fa;
        border: 1px solid #ddd;
        border-radius: 5px;
    }
    
    .print-button {
        background: #007cba;
        color: white;
        border: none;
        padding: 10px 20px;
        margin: 0 5px;
        border-radius: 3px;
        cursor: pointer;
    }
    
    .print-button:hover {
        background: #005a87;
    }
} 