/* ==================================================
   ðŸ“– PROPOKIT ABOUT PAGE STYLING
   ================================================== */

/* Footer styling – matches Quote Summary with side margins */
#page-content footer:not(.ps-footer),
.a4-page footer:not(.ps-footer),
footer:not(.ps-footer) {
    position: relative;
    margin-top: auto;
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 0;
    padding: 12px 15px;
    box-sizing: border-box;
    max-width: calc(100% - 16px);
    min-width: 0;
    overflow: visible;
    background-color: var(--brand-primary, #2063BE);
    color: white;
    text-align: center;
    border-radius: 0 0 4px 4px;
    width: auto;
    font-size: 11px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    display: block;
}

footer p {
    margin: 0;
}

#page-content footer a,
.a4-page footer a,
footer a {
    color: white;
    text-decoration: underline;
}

#page-content footer #footerContent,
.a4-page footer #footerContent,
footer #footerContent {
    margin: 0;
    padding: 0;
    color: white;
    font-size: 11px;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
}

#page-content footer #footerContent p,
.a4-page footer #footerContent p,
footer #footerContent p {
    margin: 0;
    color: white;
    font-size: 11px;
    line-height: 1.5;
    display: block;
    width: 100%;
}

#page-content footer #footerContent p:last-child,
.a4-page footer #footerContent p:last-child,
footer #footerContent p:last-child {
    margin-bottom: 0;
}

/* Blue strip styling */
.blue-strip {
    height: 12.7mm;
    /* Removed blue line - was blocking QR code area */
    display: none;
}

/* Image placeholder when no company image uploaded */
.company-intro-image-placeholder {
    width: 100%;
    max-width: 650px;
    height: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    color: #6b7280;
    font-family: 'Roboto', sans-serif;
}

.company-intro-image-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.company-intro-image-placeholder p {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 500;
}

.company-intro-image-placeholder small {
    font-size: 12px;
    opacity: 0.8;
}

/* Image caption below company image */
.company-intro-image-caption {
    margin: 8px auto 0;
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    max-width: 650px;
    text-align: center;
    line-height: 1.4;
}

/* Image frame */
#imageFrame {
    width: 100%;
    max-width: 650px;
    height: 420px;
    /* CRITICAL: No border or shadow - clean image display */
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

#previewImage {
    width: 100% !important;
    max-width: 650px !important;
    height: 420px !important;
    object-fit: contain !important; /* Show full image - no top or bottom cut off */
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    margin: 0 auto !important;
    /* CRITICAL: Exact dimensions match canvas in modal for pixel-perfect preview */
}

/* Main content layout */
.a4-page .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Image area - consistent padding */
.a4-page .text-center {
    padding: 0 12mm 0 12mm;
    box-sizing: border-box;
}

/* Spacing above about section */
.a4-page .about-section {
    margin-top: 24px;
}

/* ==================================================
   ABOUT SECTION STYLING
   ================================================== */

.about-section {
    text-align: justify;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    line-height: 1.5;
    padding: 5px;
    margin-left: 5mm;
    margin-right: 5mm;
}

/* About section - professional proposal typography */
.about-section {
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    padding: 0 12mm !important;
    max-width: 100%;
    box-sizing: border-box;
}

.about-section h2 {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #E74B32;
    margin-bottom: 20px;
}

.about-section p {
    margin-bottom: 10px;
    page-break-inside: avoid;
}

.about-section .company-intro-section p {
    min-height: 0;
}

.about-section .company-intro-section p:after {
    display: none;
}

/* ==================================================
   RESPONSIVE DESIGN FOR ABOUT PAGE
   ================================================== */

@media (max-width: 768px) {
    #imageFrame {
        width: 100%;
        height: 420px;
    }

    #previewImage {
        height: 420px !important;
    }

    .about-section {
        font-size: 17px !important;
        padding: 12px;
    }

    .about-section h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    #imageFrame {
        height: 380px;
    }

    #previewImage {
        height: 380px !important;
    }

    .about-section {
        font-size: 16px !important;
    }

    .about-section h2 {
        font-size: 20px;
    }
}

/* ==================================================
   PRINT STYLES FOR ABOUT PAGE / COMPANY INTRO
   ================================================== */

@media print {
    /* A4 page (Company Intro): natural height, no forced min – prevents blank space or cut-off */
    #page-content .a4-page,
    .a4-page {
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        padding: 8mm 5mm 18mm 5mm !important; /* top right bottom left - added bottom padding for fixed footer */
        box-sizing: border-box !important;
        display: block !important;
        visibility: visible !important;
        overflow: visible !important;
        page-break-inside: avoid !important;
    }

    .a4-page .main-content {
        min-height: 0 !important;
        display: block !important;
        visibility: visible !important;
    }

    /* Hide upload UI so it doesn’t appear in print */
    .a4-page #uploadSpinner,
    .a4-page #uploadProgressBar,
    .a4-page #imagePlaceholder {
        display: none !important;
    }

    /* Ensure text and image areas are visible */
    .a4-page .text-center,
    .a4-page .about-section,
    .a4-page h2 {
        visibility: visible !important;
        display: block !important;
    }

    /* Image area: nice margins, fills space */
    .a4-page .text-center {
        margin: 0 0 5mm 0 !important;
        padding: 0 !important;
    }

    .a4-page #imageFrame {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 100mm !important;
        overflow: hidden !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border: none !important;
    }

    .a4-page #previewImage {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 100mm !important;
        object-fit: contain !important;
        display: block !important;
    }

    /* About section - print */
    .a4-page .about-section {
        font-size: 11pt !important;
        line-height: 1.5 !important;
        margin: 4mm 0 0 0 !important;
        padding: 0 !important;
    }

    .a4-page .about-section .company-intro-section {
        margin-bottom: 4mm !important;
        padding: 0 0 4mm 0 !important;
    }

    .a4-page .about-section .company-intro-section h3 {
        font-size: 10pt !important;
        margin-bottom: 2mm !important;
    }

    .a4-page .about-section p {
        min-height: 0 !important;
        margin-bottom: 0 !important;
        font-size: 11pt !important;
    }

    .a4-page .about-section p:after {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        margin: 8mm auto 0 auto !important;
    }

    .a4-page .about-section .company-intro-section p:after {
        display: none !important;
    }

    .a4-page .company-intro-image-caption {
        font-size: 11pt !important;
    }

    /* Footer: compact styling matching product list footer - sits at bottom with no margins */
    .a4-page footer,
    #page-content .a4-page footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 3mm 5mm !important;
        background-color: var(--brand-primary, #2063BE) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        display: block !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        z-index: 99999 !important;
    }

    .a4-page #footerContent,
    #page-content .a4-page #footerContent {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 2px !important;
        display: block !important;
        visibility: visible !important;
        color: #ffffff !important;
        font-size: 8pt !important;
        line-height: 1.3 !important;
    }

    .a4-page footer p,
    .a4-page #footerContent p,
    #page-content .a4-page footer p {
        font-size: 8pt !important;
        margin: 0 0 3px 0 !important;
        padding: 0 2px !important;
        line-height: 1.3 !important;
        color: #ffffff !important;
        visibility: visible !important;
        display: block !important;
        width: 100% !important;
    }
    
    .a4-page footer p:last-child,
    .a4-page #footerContent p:last-child,
    #page-content .a4-page footer p:last-child {
        margin-bottom: 0 !important;
    }

    .a4-page footer p:last-child,
    .a4-page #footerContent p:last-child {
        margin-bottom: 0 !important;
    }
}

/* ==================================================
   PDF EXPORT STYLES FOR COMPANY INTRO
   ================================================== */

body.pdf-exporting .a4-page,
body.pdf-exporting #page-content .a4-page {
    width: 206mm !important;
    max-width: 206mm !important;
    min-height: 293mm !important;
    height: 293mm !important;
    padding: 8mm 12mm 0 12mm !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    visibility: visible !important;
    overflow: visible !important;
    margin: 0 !important;
}

body.pdf-exporting .a4-page footer,
body.pdf-exporting #page-content .a4-page footer {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin: auto 0 0 0 !important;
    padding: 3mm 5mm !important;
    background-color: var(--brand-primary, #2063BE) !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    opacity: 1 !important;
    filter: none !important;
    display: block !important;
    visibility: visible !important;
    page-break-inside: avoid !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

body.pdf-exporting .a4-page footer p,
body.pdf-exporting .a4-page #footerContent p,
body.pdf-exporting #page-content .a4-page footer p {
    font-size: 8pt !important;
    margin: 0 0 2px 0 !important;
    padding: 0 2px !important;
    line-height: 1.3 !important;
    color: #ffffff !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
}

body.pdf-exporting .a4-page footer p:last-child,
body.pdf-exporting .a4-page #footerContent p:last-child,
body.pdf-exporting #page-content .a4-page footer p:last-child {
    margin-bottom: 0 !important;
}

body.pdf-exporting .a4-page #footerContent,
body.pdf-exporting #page-content .a4-page #footerContent {
    color: #ffffff !important;
    font-size: 8pt !important;
    line-height: 1.3 !important;
    padding: 0 2px !important;
    display: block !important;
}

/* PDF Export: Hide image placeholder, reduce spacing */
body.pdf-exporting .a4-page #imagePlaceholder {
    display: none !important;
}

body.pdf-exporting .a4-page .text-center {
    margin-bottom: 4mm !important;
}

body.pdf-exporting .a4-page #imageFrame,
body.pdf-exporting .a4-page #previewImage {
    max-height: 100mm !important;
}

body.pdf-exporting .a4-page .about-section {
    font-size: 11pt !important;
    line-height: 1.5 !important;
    padding: 0 !important;
}

body.pdf-exporting .a4-page .about-section .company-intro-section {
    margin-bottom: 4mm !important;
    padding: 0 0 4mm 0 !important;
}

body.pdf-exporting .a4-page .about-section .company-intro-section h3 {
    font-size: 10pt !important;
    margin-bottom: 2mm !important;
}

body.pdf-exporting .a4-page .about-section p {
    margin-bottom: 0 !important;
    font-size: 11pt !important;
}

body.pdf-exporting .a4-page .main-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}
