/* Check Form Styling - Based on print layout with input fields */

/* MICR Font Definition - Bulletproof @font-face */
@font-face {
    font-family: 'MICRCHEK';
    src: url('../fonts/MICRCHEK.eot');
    src: url('../fonts/MICRCHEK.eot?#iefix') format('embedded-opentype'),
         url('../fonts/MICRCHEK.woff2') format('woff2'),
         url('../fonts/MICRCHEK.woff') format('woff'),
         url('../fonts/MICRCHEK.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Open Sans Font - Bulletproof @font-face */
@font-face {
    font-family: 'OpenSans';
    src: url('../fonts/OpenSans.eot');
    src: url('../fonts/OpenSans.eot?#iefix') format('embedded-opentype'),
         url('../fonts/OpenSans.woff2') format('woff2'),
         url('../fonts/OpenSans.woff') format('woff'),
         url('../fonts/OpenSans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Open Sans - UI Elements Only (NOT check fields) */
.form-container,
header,
h1,
.header-buttons,
.btn,
.btn-primary,
.btn-secondary,
.message,
.error-message,
.print-modal-container,
.select-payor-btn,
.payor-modal-container,
.btn-icon {
    font-family: 'OpenSans', Arial, sans-serif;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 20px;
}

.form-container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: #2D4492;
    font-size: 24px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #2D4492;
    color: white;
}

.btn-primary:hover {
    background-color: #1e2f5f;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: none;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.error-message {
    color: #dc3545;
    font-size: 10pt;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 2px;
}

/* Check Form Wrapper */
.check-form-wrapper {
    width: 8.5in;
    height: 3.5in;
    background: white;
    position: relative;
    border: 2px solid #2D4492;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Field Base Styles - Input Fields */
.field {
    position: absolute;
    font-family: Arial, sans-serif;
    color: #000;
    border: 1px solid #ccc;
    padding: 2px 4px;
    background: white;
}

.field:focus {
    outline: 2px solid #2D4492;
    outline-offset: -1px;
    border-color: #2D4492;
    background: #ffffd6;
    box-shadow: 0 0 8px rgba(45, 68, 146, 0.3);
}

.field::placeholder {
    color: #999;
    font-style: italic;
}

/* Disabled fields (for Copy Check mode) */
.field.disabled-field,
.field:disabled {
    background-color: #e9e9e9;
    color: #666;
    cursor: not-allowed;
    border-color: #ccc;
}

/* Editable fields in Copy Check mode - light yellow highlight */
.field.copy-editable {
    background-color: #ffffd6;
    border-color: #e6e600;
}

.field.copy-editable:focus {
    background-color: #ffffb3;
    border-color: #2D4492;
}

/* Payor Information (Top Left - reduced spacing) */
.payor-name {
    top: 0.2in;
    left: 0.3in;
    font-size: 14pt;
    font-weight: bold;
    width: 2.5in;
}

.payor-address {
    top: 0.4in;
    left: 0.3in;
    font-size: 9pt;
    width: 2.5in;
}

.payor-city-state-zip {
    top: 0.55in;
    left: 0.3in;
    font-size: 9pt;
    width: 2.5in;
}

.payor-phone {
    top: 0.7in;
    left: 0.3in;
    font-size: 8pt;
    width: 2.5in;
}

/* Bank Information (Same line as Payor, moved left 3/8") */
.bank-name {
    top: 0.2in;
    left: 3.175in;
    font-size: 11pt;
    font-weight: bold;
    width: 2.5in;
}

.bank-address {
    top: 0.4in;
    left: 3.175in;
    font-size: 8pt;
    width: 2.5in;
}

.bank-city-state-zip {
    top: 0.55in;
    left: 3.175in;
    font-size: 8pt;
    width: 2.5in;
}

.bank-phone {
    top: 0.7in;
    left: 3.175in;
    font-size: 8pt;
    width: 2.5in;
}

/* Transit Number (Top Right Area - XX-XX/XXXX format) */
.transit-number {
    top: 0.3in;
    left: 5.3in;
    font-size: 10pt;
    font-weight: bold;
    width: 1.2in;
}

/* Check Number (Top Right - reduced 25% from 24pt) */
.check-number {
    top: 0.3in;
    right: 0.75in;
    font-size: 18pt;
    font-weight: bold;
    width: 1in;
    text-align: right;
}

/* Date (Right Side - moved up 1/8") */
.date {
    top: 0.85in;
    right: 0.5in;
    font-size: 11pt;
    width: 1.2in;
}

/* Pay To The Order Of (moved up 1/8") */
.pay-to-label {
    top: 1.125in;
    left: 0.3in;
    font-size: 9pt;
    border: none;
    background: transparent;
    padding: 0;
    pointer-events: none;
}

.pay-to-label-2 {
    top: 1.275in;
    left: 0.3in;
    font-size: 9pt;
    border: none;
    background: transparent;
    padding: 0;
    pointer-events: none;
}

.payee-name {
    top: 1.125in;
    left: 1.05in;
    font-size: 12pt;
    font-weight: bold;
    min-width: 3in;
    width: 3.5in;
}

.payee-address {
    top: 1.325in;
    left: 1.05in;
    font-size: 9pt;
    width: 3.5in;
}

.payee-city-state-zip {
    top: 1.475in;
    left: 1.05in;
    font-size: 9pt;
    width: 3.5in;
}

.payee-phone {
    top: 1.625in;
    left: 1.05in;
    font-size: 8pt;
    width: 3.5in;
}

/* Amount (Numeric) - Right Side (reduced 25%, moved down 0.25") */
.amount-numeric {
    top: 1.375in;
    right: 1.0in;
    font-size: 13.5pt;
    font-weight: bold;
    text-align: right;
    width: 1.5in;
}

/* The Sum Of Label (moved down 1/8") */
.sum-of-label {
    top: 1.975in;
    left: 0.3in;
    font-size: 10pt;
    font-weight: bold;
    border: none;
    background: transparent;
    padding: 0;
    pointer-events: none;
}

/* Amount Written (Text - moved left 0.5", prevent wrapping) */
.amount-written {
    top: 1.975in;
    left: 1.3in;
    font-size: 10pt;
    min-width: 5in;
    max-width: 6in;
    width: 5.5in;
    white-space: nowrap;
    background: #f8f8f8;
    cursor: not-allowed;
}

/* Memo Line (moved up 0.5") */
.memo-label {
    top: 2.5in;
    left: 0.3in;
    font-size: 9pt;
    font-weight: bold;
    border: none;
    background: transparent;
    padding: 0;
    pointer-events: none;
}

.memo {
    top: 2.5in;
    left: 1.0in;
    font-size: 10pt;
    width: 4in;
}

/* MICR Line Inputs (Bottom - where MICR line would be) */
.micr-inputs-label {
    bottom: 0.5in;
    left: 0.3in;
    font-size: 9pt;
    font-weight: bold;
    border: none;
    background: transparent;
    padding: 0;
    pointer-events: none;
    color: #666;
}

.micr-routing-input {
    bottom: 0.25in;
    left: 2.3in;
    font-size: 10pt;
    font-weight: bold;
    width: 1.2in;
    font-family: Arial, sans-serif;
}

.micr-account-input {
    bottom: 0.25in;
    left: 4.5in;
    font-size: 10pt;
    font-weight: bold;
    width: 1.5in;
    font-family: Arial, sans-serif;
}

.micr-code-input {
    bottom: 0.25in;
    left: 6.2in;
    font-size: 10pt;
    font-weight: bold;
    width: 0.5in;
    font-family: Arial, sans-serif;
    text-align: center;
}

/* Print Modal Styles (same as register) */
.print-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.print-modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    width: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.print-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #2D4492;
    background-color: #f8f9fa;
}

.print-modal-header h2 {
    color: #2D4492;
    font-size: 20px;
    margin: 0;
}

.print-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.print-modal-close:hover {
    color: #000;
}

.print-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: #f5f5f5;
}

.print-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: #f8f9fa;
}

/* Print styles - hide modal UI, show only check content */
@media print {
    .print-modal-overlay {
        background: white;
        position: static;
    }
    
    .print-modal-container {
        box-shadow: none;
        max-width: 100%;
        max-height: none;
        width: 100%;
    }
    
    .print-modal-header,
    .print-modal-actions,
    .print-modal-close {
        display: none !important;
    }
    
    .print-modal-content {
        padding: 0;
        background: white;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }
    
    .print-checks-container {
        display: block;
    }
    
    .check {
        page-break-after: always;
        page-break-inside: avoid;
        margin: 0;
    }
    
    .check:last-child {
        page-break-after: auto;
    }
    
    body {
        background: white;
        padding: 0;
    }
    
    .form-container {
        display: none;
    }
}

/* Select Payor Button */
.select-payor-btn {
    position: absolute;
    top: -45px;
    left: 0.3in;
    background: #2D4492;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.select-payor-btn:hover {
    background: #1e2f5f;
}

/* Payor Modal Styles */
.payor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.payor-modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.payor-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #2D4492;
    background-color: #f8f9fa;
}

.payor-modal-header h2 {
    color: #2D4492;
    font-size: 20px;
    margin: 0;
}

.payor-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.payor-modal-close:hover {
    color: #000;
}

.payor-modal-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.payor-search-box {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.payor-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.payor-search-input:focus {
    outline: none;
    border-color: #2D4492;
}

.payor-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.payor-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background-color 0.2s, border-color 0.2s;
}

.payor-list-item:hover {
    background-color: #f8f9fa;
    border-color: #aaa;
}

.payor-item-info {
    flex: 1;
    cursor: pointer;
    padding: 4px 0;
}

.payor-item-info:hover {
    background-color: #e7f3ff;
    border-radius: 4px;
}

.payor-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: #6c757d;
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background: #5a6268;
}

.btn-icon-danger {
    background: #dc3545;
}

.btn-icon-danger:hover {
    background: #c82333;
}

.payor-item-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.payor-item-bank {
    font-size: 14px;
    color: #666;
}

.payor-item-account {
    font-size: 13px;
    color: #999;
    margin-left: 15px;
    white-space: nowrap;
}

.payor-list-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.payor-list-empty p {
    margin-bottom: 10px;
}

.payor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: #f8f9fa;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1000px) {
    .check-form-wrapper {
        transform: scale(0.8);
        transform-origin: top center;
    }
    
    .print-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .payor-modal-container {
        width: 95%;
        max-height: 90vh;
    }
}

