/*
    These CSS rules are used to style the printed version of the SIPFront.
 */

/* Hide elements */
.no-print,
#launcher {
    display: none;
}

/* Shows hidden elements, hide otherwise */
.only-print {
    display: block !important;
}

/* Shows hidden elements, but don't hide otherwise */
.always-print {
    display: block !important;
}

/* Classes that control page break */
.page-break-before {
    page-break-before: always;
    /* CSS 2.1 */
}

.page-break-avoid {
    page-break-inside: avoid;
    /* CSS 2.1 */
    -webkit-column-break-inside: avoid;
    /* For WebKit browsers */
    break-inside: avoid;
    /* Newer CSS property, recommended */
}

/* Make sure the background colors are printed regardless of browser settings */
.badge,
.badge-success,
.badge-danger,
.badge-primary,
.badge-secondary,
.badge-info,
.btn-primary,
.raw-sip-message .circle,
div.pointer {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
}

/* Page setup */
@page {
    size: A4 portrait;
}

html,
body,
.content-wrapper,
.main-footer {
    background-color: #FFFFFF;
}

/* IFrames */
iframe {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    /* Optional, to constrain their height */
}

.card-call-states {
    height: 400px;
}

.sipp-error-logs {
    height: 1200px;
}

/* General styles */
.section {
    width: 100%;
}

.section-header {
    font-size: x-large;
    text-align: left;
    padding-top: 32px;
    padding-bottom: 32px;
}

.card-title {
    font-size: large;
    font-weight: bold;
    float: left;
    text-align: left;
    padding-top: 20px;
    padding-bottom: 20px;
}

.card,
.info-box {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #CCCCCC;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.iframe-container {
    overflow: hidden !important;
}

.message {
    padding: 1.25rem;
}

.sf-siptrace-container div {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

#sipMessageList div.raw-sip-message {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1em;
    padding: 10px;
    word-break: break-word;
}

#sipMessageList .card,
#sipMessageList .info-box,
.no-print-border {
    border: none !important;
}

.sip-trace-diagram-row {
    page-break-inside: avoid;
    /* CSS 2.1 */
    -webkit-column-break-inside: avoid;
    /* For WebKit browsers */
    break-inside: avoid;
    /* Newer CSS property, recommended */
}

.sf-siptrace .circle span {
    color: #FFFFFF;
}

#print-title {
    font-size: x-large;
}

.artifact-download {
    font-size: large;
    font-weight: bold;
}

.col-lg-6,
.col-md-3 {
    width: 50%;
}

.col-lg-4 {
    width: 33%;
}

/* Voice AI report – print: full width, no forced page break before dimension details */
.voice-ai-report {
    width: 100%;
    max-width: 210mm;
    min-height: 0;
    height: auto;
    padding: 6mm 8mm;
    font-family: 'Poppins', sans-serif;
    color: rgba(58, 53, 65, 0.87);
    background: #fff;
}

.voice-ai-report .report-page-1 {
    min-height: 0;
}

.voice-ai-report .radar-wrap {
    margin-bottom: 8px;
}

@media print {
    .main-footer {
        max-width: 210mm;
        margin: 0 auto;
        padding: 0 10mm;
        text-align: center;
        font-size: 10px;
    }

    .main-footer a {
        text-decoration: none;
        color: inherit;
    }

    .voice-ai-report {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 6mm 10mm;
        box-sizing: border-box;
    }

    .voice-ai-report .report-page-1 {
        min-height: 0;
    }

    .voice-ai-report .radar-wrap {
        width: 100%;
    }

    .voice-ai-report #voice-ai-chart-radar {
        width: 100% !important;
        max-width: none !important;
        height: 340px !important;
    }

    /* Full-width single-column layout for dimension details: more space for chart + table side by side, findings below */
    .voice-ai-report .report-page-2 .segments {
        grid-template-columns: 1fr;
        max-width: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .voice-ai-report .segments-section-title {
        page-break-after: avoid;
    }

    /* Two equal columns: chart area | table area, balanced and full-width */
    .voice-ai-report .segment-body {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem 1.5rem;
        align-items: center;
        flex-wrap: unset;
    }

    .voice-ai-report .segment-body .segment-widget {
        grid-column: 1;
        align-self: center;
    }

    .voice-ai-report .segment-body .segment-widget:last-child {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }

    .voice-ai-report .segment-body .segment-widget {
        min-width: 0;
        width: 100%;
    }

    .voice-ai-report .segment-body .segment-widget:only-child {
        grid-column: 1 / -1;
    }

    /* Charts fill their column so they’re not left-weighted */
    .voice-ai-report .segment-body .voice-ai-echart {
        width: 100% !important;
        max-width: 100%;
        min-height: 100px;
        height: 100px;
    }

    .voice-ai-report .segment-body .voice-ai-echart.voice-ai-echart-line {
        min-width: 0;
        height: 72px;
    }

    .voice-ai-report .segment-body .voice-ai-echart.voice-ai-echart-gauge {
        width: 100%;
        max-width: 140px;
        height: 100px;
    }

    .voice-ai-report .segment-table {
        max-width: none;
        width: 100%;
    }

    /* Segment card: modern, balanced spacing */
    .voice-ai-report .segment {
        padding: 1rem 1.25rem;
        border-radius: 6px;
        border: 1px solid #dee2e6;
    }

    .voice-ai-report .segment-title {
        font-size: 10px;
    }

    .voice-ai-report .segment-findings {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e9ecef;
    }

    /* 100% ensure no page break inside any segment box */
    .voice-ai-report .segment {
        box-shadow: none;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        break-inside: avoid-page !important;
        -webkit-column-break-inside: avoid !important;
        -webkit-region-break-inside: avoid !important;
        display: inline-block;
        width: 100%;
        page-break-after: auto;
        page-break-before: auto;
    }

    .voice-ai-report .segment-body,
    .voice-ai-report .segment-findings,
    .voice-ai-report .segment-widget,
    .voice-ai-report .segment-table {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        break-inside: avoid-page !important;
        -webkit-column-break-inside: avoid !important;
    }

    .voice-ai-report .segment-table .pass,
    .voice-ai-report .segment-finding-good,
    .voice-ai-report .segment-finding-good .segment-finding-icon {
        color: #1e7e34 !important;
    }

    /* Force audio turn performance to start on a new page to avoid splitting */
    .voice-ai-report .segment-audio-turn-perf {
        page-break-before: always;
        break-before: page;
    }
}

.voice-ai-report .radar-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.voice-ai-report .segment {
    page-break-inside: avoid;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}