/* MoneyKit Dashboard - Receipt Generator Styles */

/* ============================================
   RECEIPT GENERATOR CONTAINER
   ============================================ */
.receipt-generator-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.generator-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-border, #e0e0e0);
}

.generator-header h1 {
    margin: 0 0 0.5rem 0;
    color: var(--color-primary, #2c3e50);
}

.generator-header .subtitle {
    margin: 0;
    color: var(--color-text-muted, #666);
    font-size: 1.1rem;
}

/* ============================================
   TWO-PANEL WORKSPACE LAYOUT
   ============================================ */
.receipt-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .receipt-workspace {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LEFT PANEL: FORM
   ============================================ */
.receipt-form-panel {
    background: var(--color-background, #fff);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.receipt-form-panel h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--color-primary, #2c3e50);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text, #333);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary, #2c3e50);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--color-text-muted, #666);
    font-size: 0.875rem;
}

.input-group {
    position: relative;
    display: flex;
}

.input-prefix {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted, #666);
    font-weight: 600;
}

.input-group input {
    padding-left: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary, #2c3e50);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark, #1a252f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--color-secondary, #95a5a6);
    color: white;
}

.btn-secondary:hover {
    background: var(--color-secondary-dark, #7f8c8d);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   RIGHT PANEL: LIVE PREVIEW
   ============================================ */
.receipt-preview-panel {
    position: sticky;
    top: 2rem;
}

.receipt-preview-panel h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--color-primary, #2c3e50);
}

.receipt-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RECEIPT DOCUMENT STYLES
   ============================================ */
.receipt-document {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: 'Georgia', 'Times New Roman', serif;
}

.receipt-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #2c3e50;
    margin-bottom: 1.5rem;
}

.receipt-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 1rem;
}

.business-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    color: #2c3e50;
}

.business-address,
.business-contact {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.receipt-title {
    text-align: center;
    margin: 1.5rem 0;
}

.receipt-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
    letter-spacing: 2px;
}

.receipt-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.meta-row {
    display: flex;
    gap: 0.5rem;
}

.receipt-details {
    margin: 2rem 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-label {
    color: #2c3e50;
}

.detail-value {
    color: #333;
}

.receipt-total {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #2c3e50;
    color: white;
    border-radius: 4px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-amount {
    font-size: 2rem;
    font-weight: bold;
}

.receipt-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #2c3e50;
}

.thank-you {
    text-align: center;
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.signature-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.signature-box {
    text-align: center;
}

.signature-line {
    border-bottom: 2px solid #333;
    margin-bottom: 0.5rem;
    height: 60px;
}

.signature-box p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.receipt-footer-text {
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    margin: 1rem 0 0 0;
}

/* ============================================
   PRINT STYLES - Professional Letterhead
   ============================================ */
@media print {
    /* Force white background on page chrome */
    * {
        box-shadow: none !important;
    }

    /* Clean white background */
    html, body {
        background: white !important;
        color: #000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Override dark mode for page structure */
    .layout-zone, .zone-content,
    .receipt-generator-container,
    .receipt-workspace,
    .receipt-preview-panel,
    .receipt-preview {
        background: white !important;
    }

    /* Hide ALL page chrome */
    header, footer, nav,
    .site-header, .site-footer, .site-nav,
    .layout-zone--slider,
    .layout-zone--cards,
    #zone-slider, #zone-cards, #zone-footer {
        display: none !important;
    }

    /* Hide zone layout wrappers */
    .layout-zone,
    .zone-content {
        all: unset !important;
        display: block !important;
        background: white !important;
    }

    /* Hide everything except receipt */
    .receipt-generator-container > *:not(.receipt-workspace) {
        display: none !important;
    }

    .receipt-form-panel,
    .generator-header {
        display: none !important;
    }

    .receipt-workspace {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .receipt-preview-panel {
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .receipt-preview-panel h2 {
        display: none !important;
    }

    .receipt-preview {
        background: white !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    /* Professional letterhead styling */
    .receipt-document {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100%;
        max-width: 100%;
        font-family: 'Georgia', 'Times New Roman', serif;
        color: #000;
        background: white;
    }

    /* Professional header - Letterhead style */
    .receipt-header {
        text-align: center;
        padding: 1.5cm 0 1cm 0;
        border-bottom: 3px double #000;
        margin-bottom: 1.5cm;
    }

    .receipt-logo {
        max-width: 140px;
        max-height: 80px;
        margin-bottom: 0.5cm;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .business-name {
        font-size: 18pt;
        font-weight: bold;
        color: #000;
        margin: 0.3cm 0;
        letter-spacing: 0.5px;
    }

    .business-address,
    .business-contact {
        font-size: 10pt;
        color: #333;
        margin: 0.1cm 0;
        line-height: 1.4;
    }

    /* Receipt title */
    .receipt-title {
        text-align: center;
        margin: 1cm 0 0.8cm 0;
    }

    .receipt-title h2 {
        font-size: 16pt;
        font-weight: bold;
        color: #000;
        letter-spacing: 3px;
        margin: 0;
        border-bottom: 2px solid #000;
        display: inline-block;
        padding-bottom: 0.2cm;
    }

    /* Receipt metadata */
    .receipt-meta {
        display: flex;
        justify-content: space-between;
        margin-bottom: 1cm;
        padding: 0.4cm;
        background: #f5f5f5;
        border: 1px solid #ccc;
        border-radius: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .meta-row {
        font-size: 10pt;
        color: #000;
    }

    /* Receipt details */
    .receipt-details {
        margin: 1cm 0;
    }

    .detail-row {
        display: grid;
        grid-template-columns: 180px 1fr;
        gap: 0.5cm;
        padding: 0.3cm 0;
        border-bottom: 1px solid #ddd;
        font-size: 11pt;
        line-height: 1.5;
    }

    .detail-label {
        color: #000;
        font-weight: bold;
    }

    .detail-value {
        color: #000;
    }

    /* Total amount - Professional highlight */
    .receipt-total {
        margin: 1cm 0;
        padding: 0.6cm;
        background: #000;
        color: white;
        border-radius: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .total-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 12pt;
    }

    .total-amount {
        font-size: 20pt;
        font-weight: bold;
    }

    /* Footer section */
    .receipt-footer {
        margin-top: 1.5cm;
        padding-top: 0.8cm;
        border-top: 3px double #000;
    }

    .thank-you {
        text-align: center;
        font-size: 12pt;
        font-style: italic;
        color: #000;
        margin-bottom: 1cm;
    }

    /* Signature area */
    .signature-area {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2cm;
        margin: 1cm 0 1.5cm 0;
    }

    .signature-box {
        text-align: center;
    }

    .signature-line {
        border-bottom: 2px solid #000;
        margin-bottom: 0.3cm;
        height: 1.5cm;
    }

    .signature-box p {
        margin: 0;
        color: #666;
        font-size: 9pt;
        font-weight: bold;
    }

    /* Footer text */
    .receipt-footer-text {
        text-align: center;
        color: #666;
        font-size: 8pt;
        margin: 1cm 0 0 0;
        line-height: 1.6;
    }

    /* Ensure receipt fits on one page */
    .receipt-document {
        page-break-inside: avoid;
        orphans: 3;
        widows: 3;
    }

    /* Page settings for professional letterhead */
    @page {
        size: letter;
        margin: 1.5cm 2cm;
    }

    /* Force black text for all elements */
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .receipt-document {
        padding: 1rem;
    }

    .receipt-logo {
        max-width: 100px;
    }

    .business-name {
        font-size: 1.5rem;
    }

    .receipt-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .total-amount {
        font-size: 1.5rem;
    }

    .signature-area {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .receipt-generator-container {
        color: #e8e8e8;
    }

    .generator-header {
        border-bottom-color: #555;
    }

    .generator-header h1,
    .receipt-form-panel h2,
    .receipt-preview-panel h2 {
        color: #f0f0f0 !important;
    }

    .generator-header .subtitle {
        color: #b0b0b0 !important;
    }

    .receipt-form-panel {
        background: #1e1e1e;
        border: 1px solid #404040;
    }

    .form-group label {
        color: #f0f0f0 !important;
    }

    .form-group small {
        color: #a0a0a0 !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #2a2a2a;
        color: #f0f0f0;
        border-color: #505050;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        background: #333;
        border-color: #6a9fb5;
        box-shadow: 0 0 0 3px rgba(106, 159, 181, 0.2);
    }

    .input-prefix {
        color: #b0b0b0 !important;
    }

    .btn-primary {
        background: #4a7c9d;
    }

    .btn-primary:hover {
        background: #5a8fad;
    }

    .btn-secondary {
        background: #606060;
    }

    .btn-secondary:hover {
        background: #707070;
    }

    /* Keep receipt preview always light for accurate preview */
    .receipt-preview {
        background: #e8e8e8;
    }

    .receipt-document {
        background: white;
        color: #333;
    }
}
