@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto:wght@300;400;500&display=swap');

@font-face {
    font-family: 'MICR';
    src: url('micrenc.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background: #667eea;
    min-height: 100vh;
    padding: 20px;
}

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

.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Form Section */
.form-section {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.form-section h2, .form-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

.form-section h3 {
    margin-top: 25px;
    font-size: 1.2rem;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-controls {
    margin-top: 25px;
    display: flex;
    gap: 10px;
}

.clear-btn, .print-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.clear-btn {
    background: #e74c3c;
    color: white;
}

.print-btn {
    background: #3498db;
    color: white;
}

.clear-btn:hover, .print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Preview Section */
.preview-section {
    flex: 1.5;
    min-width: 400px;
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }
    
    .main-layout {
        gap: 20px;
    }
    
    h1 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .main-layout {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-section {
        min-width: auto;
        order: 2;
        flex: none;
        width: 100%;
    }
    
    .preview-section {
        min-width: auto;
        order: 1;
        flex: none;
        width: 100%;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .check {
        max-width: 100%;
        min-width: 600px;
        height: auto;
        min-height: 300px;
        overflow-x: auto;
    }
    
    .check-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .form-section {
        padding: 15px;
        width: 100%;
        flex: none;
    }
    
    .preview-section {
        width: 100%;
        flex: none;
    }
    
    .check {
        padding: 15px;
        font-size: 12px;
        min-height: 280px;
        min-width: 600px;
        overflow-x: hidden;
    }
    
    .check-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    .form-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .clear-btn, .print-btn {
        width: 100%;
    }
}

.preview-section h2 {
    color: white;
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    text-align: center;
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
}

.check-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.check-container:hover {
    transform: translateY(-5px);
}

.check {
    width: 100%;
    max-width: 800px;
    height: 300px;
    border-radius: 0;
    padding: 20px;
    background: white;
    position: relative;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Bank Info */
.bank-info {
    position: absolute;
    top: 15px;
    left: 320px;
    width: 300px;
}

.bank-name {
    font-weight: 600;
    font-size: 16px;
    border: none;
    background: transparent;
    width: 100%;
    margin-bottom: 5px;
    font-family: 'Playfair Display', serif;
    color: #1a252f;
}

.bank-address input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 12px;
    color: #34495e;
}

/* Check Header */
.check-header {
    position: absolute;
    top: 15px;
    right: 15px;
    text-align: right;
}

.check-number {
    margin-bottom: 10px;
}

.date-section {
    margin-bottom: 15px;
}

.check-number label, .date-section label {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
    color: #2c3e50;
    font-weight: 500;
}

.check-number input, .date-section input {
    border: none;
    border-bottom: 1px solid #000;
    background: transparent;
    text-align: center;
    width: 100px;
}

/* Pay To Section */
.pay-to-section {
    position: absolute;
    top: 110px;
    left: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pay-to-section label {
    font-size: 12px;
    white-space: nowrap;
    color: #2c3e50;
    font-weight: 500;
}

.payee-field {
    flex: 1;
    border: none;
    border-bottom: 1px solid #000;
    background: transparent;
    padding: 2px;
}

.amount-box {
    display: flex;
    align-items: center;
    border: 2px solid #7f8c8d;
    border-radius: 8px;
    padding: 8px 12px;
    background: white;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.amount-box:hover {
    transform: scale(1.05);
}

.amount-box span {
    color: #7f8c8d;
    font-weight: bold;
    font-size: 18px;
}

.amount-numbers {
    border: none;
    background: transparent;
    width: 100px;
    text-align: left;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: #1a252f;
}

/* Amount in Words */
.amount-words-section {
    position: absolute;
    top: 150px;
    left: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.amount-words {
    flex: 1;
    border: none;
    border-bottom: 1px solid #000;
    background: transparent;
    padding: 2px;
}

.dollars {
    font-weight: bold;
    font-size: 12px;
    color: #2c3e50;
}

/* Bottom Section */
.bottom-section {
    position: absolute;
    bottom: 60px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.memo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.memo-section label {
    font-size: 12px;
    color: #2c3e50;
    font-weight: 500;
}

.memo-field {
    border: none;
    border-bottom: 1px solid #000;
    background: transparent;
    width: 150px;
}

.qr-code-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qr-code {
    width: 60px;
    height: 60px;
}

.signature-section {
    position: relative;
}

.signature-field {
    border: none;
    border-bottom: 1px solid #000;
    background: transparent;
    width: 200px;
    text-align: center;
}

.signature-section::after {
    content: "X";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #666;
}

/* Account Info */
.account-info {
    position: absolute;
    bottom: 20px;
    left: 15px;
    right: 15px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
}

.routing-account {
    display: flex;
    align-items: center;
    font-family: 'MICR', 'Courier New', monospace;
    font-size: 18px;
    font-weight: normal;
    letter-spacing: 1px;
}

.symbol {
    font-size: 18px;
    color: #000;
    font-family: 'MICR', 'Courier New', monospace;
    margin: 0 1px;
}

.micr-spaces {
    font-family: 'MICR', 'Courier New', monospace;
    font-size: 18px;
}

.account-fields-labels {
    position: absolute;
    bottom: 70px;
    left: 15px;
    right: 15px;
    display: flex;
    gap: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

.field-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.field-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
    font-weight: 500;
}

.routing-input, .account-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: white;
}

.routing-display, .account-display {
    font-family: 'MICR', 'Courier New', monospace;
    font-size: 18px;
    font-weight: normal;
    color: #000;
    margin: 0 1px;
}

.routing, .account {
    border: none;
    background: transparent;
    font-family: 'MICR', 'Courier New', monospace;
    font-size: 18px;
    font-weight: normal;
    color: #000;
    margin: 0;
    padding: 0 3px;
}

.routing {
    width: 120px;
}

.account {
    width: 150px;
}

.check-num-bottom {
    color: #000;
    font-weight: normal;
    font-family: 'MICR', 'Courier New', monospace;
    margin: 0 3px;
}

/* Account Holder Info */
.account-holder-info {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 280px;
}

.holder-name, .holder-address, .holder-city {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 11px;
    margin-bottom: 2px;
    color: #34495e;
}

/* Preview elements */
.payee-preview {
    flex: 1;
    min-height: 20px;
    border-bottom: 1px solid #000;
    padding: 2px 0;
    color: #1a252f;
    font-weight: 500;
}

.memo-preview {
    min-height: 20px;
    border-bottom: 1px solid #000;
    padding: 2px 0;
    width: 150px;
    color: #1a252f;
    font-weight: 500;
}

.signature-preview {
    min-height: 20px;
    border-bottom: 1px solid #000;
    padding: 2px 0;
    width: 200px;
}

.amount-numbers {
    text-align: left;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: #2c3e50;
    min-width: 100px;
}

#checkNumberPreview, #checkDatePreview {
    border-bottom: 1px solid #000;
    min-height: 20px;
    text-align: center;
    padding: 2px;
    color: #1a252f;
    font-weight: 500;
}

.amount-words {
    flex: 1;
    border-bottom: 1px solid #000;
    padding: 2px;
    min-height: 20px;
}

/* Preview element colors */
#bankNamePreview {
    color: #1a252f;
    font-weight: 600;
}

#bankAddressPreview, #holderNamePreview, #holderAddressPreview, #holderCityPreview {
    color: #34495e;
    font-weight: 500;
}

#amountPreview {
    color: #1a252f;
    font-weight: bold;
}

#amountWordsPreview {
    color: #1a252f;
    font-weight: 500;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container h1,
    .controls {
        display: none;
    }
    
    .check-container {
        box-shadow: none;
        padding: 0;
        background: transparent;
    }
    
    .check {
        border-radius: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .screen-only {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

.print-only {
    display: none;
}

.micr-line {
    font-family: 'MICR', 'Courier New', monospace;
    font-size: 24px;
    font-weight: normal;
    color: #000;
    letter-spacing: 1px;
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    text-align: center;
}

@media print {
    .form-section {
        display: none !important;
    }
    
    .main-layout {
        display: block;
    }
    
    .preview-section {
        width: 100%;
        min-width: auto;
    }
    
    .preview-section h2 {
        display: none;
    }
    
    .account-info {
        background: transparent;
        border-radius: 0;
        padding: 0;
        margin-top: 0;
    }
}

/* Enhanced Input Styles */
input {
    transition: all 0.3s ease;
    position: relative;
}

input:focus {
    outline: none;
    transform: scale(1.02);
    background: rgba(52, 152, 219, 0.05);
    border-radius: 4px;
    border: 2px solid rgba(52, 152, 219, 0.3);
}

input:hover {
    background: rgba(52, 152, 219, 0.02);
    border-radius: 4px;
}

/* Signature field special effect */
.signature-field:focus {
    background: rgba(52, 152, 219, 0.1);
    font-style: italic;
}
