/**
 * RAZ Invoice Studio - Paper Preview Styling
 * Overrides for realistic paper preview appearance
 */

/* Preview container - dark background to show paper contrast */
.invoice-preview {
    background: #4a4a4a !important;
    padding: 20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    min-height: 600px !important;
    border-radius: 0.5rem;
    overflow: auto;
}

/* Preview panel - full width container */
.preview-panel {
    width: 100%;
}

.preview-panel .panel {
    height: 100%;
}

/* Invoice Paper - Realistic paper look with shadow */
.invoice-paper {
    background: white !important;
    color: #333 !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
    transform-origin: top center;
    flex-shrink: 0;
}

/* Totals section styling */
.totals {
    width: 280px;
    margin-left: auto;
    margin-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #f0f0f0;
}

.total-row:last-child {
    border-bottom: none;
}

.grand-total {
    font-weight: bold;
    font-size: 1.1em !important;
    border-top: 2px solid;
    padding-top: 10px !important;
    margin-top: 8px;
    border-bottom: none !important;
}

/* Header layout */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
}

.header-left h1 {
    font-size: 1.4em;
    margin-bottom: 5px;
}

.header-left p {
    font-size: 0.85em;
    color: #666;
    margin: 2px 0;
}

.header-right {
    text-align: right;
}

.header-right h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.header-right p {
    font-size: 0.85em;
    color: #555;
    margin: 3px 0;
}

/* ========== RESPONSIVE SCALING ========== */

/* Large screens */
@media screen and (max-width: 1400px) {
    .invoice-paper {
        transform: scale(0.75);
    }
}

/* Medium screens */
@media screen and (max-width: 1100px) {
    .invoice-paper {
        transform: scale(0.6);
    }

    .invoice-preview {
        min-height: 450px !important;
    }
}

/* Tablet / Small laptop */
@media screen and (max-width: 900px) {
    .invoice-paper {
        transform: scale(0.5);
        transform-origin: top center;
    }

    .invoice-preview {
        min-height: 350px !important;
        padding: 15px !important;
    }

    /* Preview panel takes more space on mobile */
    .preview-panel {
        order: 1;
    }
}

/* Mobile - Landscape */
@media screen and (max-width: 768px) {
    .invoice-paper {
        transform: scale(0.45);
        transform-origin: top center;
    }

    .invoice-preview {
        min-height: 320px !important;
        padding: 12px !important;
    }
}

/* Mobile - Portrait */
@media screen and (max-width: 600px) {
    .invoice-paper {
        transform: scale(0.38);
        transform-origin: top left;
    }

    .invoice-preview {
        justify-content: flex-start !important;
        padding: 10px !important;
        min-height: 280px !important;
    }

    /* Make panel header smaller */
    .preview-panel .panel-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Very small mobile */
@media screen and (max-width: 480px) {
    .invoice-paper {
        transform: scale(0.32);
        transform-origin: top left;
    }

    .invoice-preview {
        min-height: 250px !important;
        padding: 8px !important;
    }
}

/* Extra small screens */
@media screen and (max-width: 380px) {
    .invoice-paper {
        transform: scale(0.28);
        transform-origin: top left;
    }

    .invoice-preview {
        min-height: 220px !important;
        padding: 6px !important;
    }
}

/* ========== PRINT ========== */
@media print {
    .invoice-paper {
        transform: none !important;
        box-shadow: none !important;
        width: 100% !important;
        min-height: auto !important;
        border: none !important;
    }

    .invoice-preview {
        background: white !important;
        padding: 0 !important;
        border: none !important;
    }

    .totals {
        width: 250px;
    }
}