/* ============================= */
/* AI Career Report – Print/Screen */
/* ============================= */
:root {
    --brand-gold: #B8860B;
    --brand-gold-light: #DAA520;
    --brand-gold-dark: #8B6914;
    --brand-dark: #1F2937;
    --brand-bg: #FFFDF7;
    --brand-light: #F3F4F6;
}

body.report-body {
    background-color: #F3F1EC;
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.report-page {
    width: 210mm;
    min-height: auto;
    padding: 20mm 20mm 25mm;
    margin: auto;
    background: white;
    box-shadow: none;
    position: relative;
    box-sizing: border-box;
}

.report-main-wrapper {
    width: 100%;
    overflow: hidden;
    background: #F3F1EC;
    min-height: 100vh;
    padding: 20px 0;
}

@media screen {
    .report-page {
        width: 210mm;
        box-shadow: none;
        border-radius: 0;
        margin: auto;
    }

    .page-footer {
        display: none !important;
    }
}

@media print {
    @page {
        margin-top: 15mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body.report-body {
        background: white;
        margin: 0;
        padding: 0;
    }

    .report-page {
        margin: 0;
        width: 210mm;
        padding: 15mm 20mm 20mm;
    }

    .report-main-wrapper {
        background: transparent !important;
        padding: 0 !important;
        min-height: auto !important;
    }

    /* Aggressively hide global layout elements and opacity artifacts */
    .page-footer,
    header,
    footer,
    nav,
    .mud-appbar,
    .mud-drawer,
    .mud-main-content>header,
    .global-header,
    .top-nav,
    .bottom_menu,
    .sara-teaser-bubble,
    .scholariq-chat-bubble,
    .scholariq-chat-panel,
    .brand-watermark,
    .cover-bg-pattern {
        display: none !important;
    }

    .cover-page {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
        justify-content: flex-start !important;
        padding-top: 80mm !important;
    }

    .no-print {
        display: none !important;
    }

    .print-page-break {
        page-break-before: always;
        break-before: page;
    }

    /* Prevent awkward page breaks inside all logical blocks */
    .metric-card,
    .role-detail-card,
    .phase-card,
    .education-card,
    .snapshot-grid,
    table,
    .info-group,
    .skills-badges,
    .gap-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--brand-dark);
    font-family: 'Outfit', sans-serif;
    margin-top: 0;
    page-break-after: avoid;
}

h2.section-heading {
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-light) 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

h3.subsection-heading {
    color: var(--brand-gold-dark);
    border-left: 5px solid var(--brand-gold);
    padding-left: 20px;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 15px;
}

.text-gold {
    color: var(--brand-gold);
}

.text-dark {
    color: var(--brand-dark);
}

/* Logo Header */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #FFFDF7 0%, #FFF8E1 100%);
    border-radius: 12px;
    border: 2px solid var(--brand-gold);
    box-shadow: 0 2px 10px rgba(184, 134, 11, 0.1);
}

.logo-img {
    height: 55px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.iso-badge {
    font-size: 11px;
    color: #666;
    background: white;
    border: 2px solid var(--brand-gold);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.15);
}

.company-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-gold-dark);
    font-family: 'Outfit', sans-serif;
}

/* Cover Page */
.cover-page {
    background: radial-gradient(circle at top right, #fff8e1 0%, #fff 40%), white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cover-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(#B8860B 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
    z-index: 0;
}

.brand-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 80px;
    font-weight: 900;
    color: rgba(184, 134, 11, 0.03);
    z-index: 0;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 10px;
}

.cover-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.cover-title {
    font-size: 56px;
    font-weight: 900;
    line-height: 1.1;
    margin: 20px 0 10px;
    letter-spacing: -1px;
}

.cover-tagline {
    font-size: 18px;
    color: #666;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.student-badge {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    display: inline-block;
    min-width: 60%;
}

.beta-badge {
    font-size: 1.2em;
    margin-left: 8px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    vertical-align: super;
}

/* Metric Cards */
.metric-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #fff 0%, #FFFDF7 100%);
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chart-container {
    display: flex;
    align-items: flex-end;
    height: 100px;
    gap: 10px;
    margin-top: 15px;
}

.chart-bar {
    flex: 1;
    background: #eee;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.chart-bar.active {
    background: var(--brand-gold);
}

.chart-label {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: #888;
}

/* Profile Snapshot */
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.info-group {
    margin-bottom: 15px;
}

.info-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.info-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-dark);
}

.skill-tag {
    display: inline-block;
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Primary Path */
.role-detail-card {
    background: linear-gradient(135deg, #FFFDF7 0%, #FFF 100%);
    border: 2px solid var(--brand-gold);
    border-radius: 15px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.1);
}

/* Skill Gap Table */
.gap-table {
    width: 100%;
    border-collapse: collapse;
}

.gap-table tr {
    border-bottom: 1px solid #eee;
}

.gap-table td {
    padding: 18px 12px;
    vertical-align: middle;
}

.progress-bg {
    background: #eee;
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #B8860B 0%, #DAA520 100%);
    height: 100%;
    border-radius: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-gap {
    background: #FEE2E2;
    color: #991B1B;
}

.status-needs-focus {
    background: #FEF3C7;
    color: #92400E;
}

.status-good-base {
    background: #D1FAE5;
    color: #065F46;
}

/* Roadmap Phases */
.phase-card {
    background: linear-gradient(135deg, #FFFDF7 0%, #F9FAFB 100%);
    border: 3px solid var(--brand-gold);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.12);
}

.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.phase-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-gold);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--brand-gold);
}

.phase-timeline {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.phase-focus {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--brand-gold);
}

.roadmap-section {
    margin-bottom: 25px;
}

.roadmap-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-gold-dark);
    margin-bottom: 18px;
    padding: 12px 20px;
    background: linear-gradient(90deg, #FFF9E6 0%, transparent 100%);
    border-left: 4px solid var(--brand-gold);
    border-radius: 5px;
}

.education-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.education-type {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.priority-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.priority-high {
    background: #FEE2E2;
    color: #991B1B;
}

.priority-medium {
    background: #FEF3C7;
    color: #92400E;
}

.priority-low {
    background: #E5E7EB;
    color: #374151;
}

.education-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 8px;
}

.education-note {
    font-size: 12px;
    color: #666;
    background: #FFF9E6;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.skill-chip {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-chip i {
    color: var(--brand-gold);
    font-size: 12px;
}

.experience-list {
    list-style: none;
    padding: 0;
}

.experience-list li {
    background: white;
    border: 1px solid #eee;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

/* Floating Print Button */
.floating-action-bar {
    position: fixed;
    z-index: 9999;
    right: 24px;
    top: 100px;
}

.fab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

/* Preloader */
.page-preloader {
    position: fixed;
    inset: 0;
    background: #F3F1EC;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-content {
    text-align: center;
    color: #555;
}

.preloader-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(184, 134, 11, 0.2);
    border-top-color: #B8860B;
    border-radius: 50%;
    animation: rpt-spin 0.9s linear infinite;
    margin: 0 auto 16px;
}

.preloader-text {
    font-size: 14px;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

@keyframes rpt-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Scaling */
.report-scale-wrapper {
    width: 210mm;
    margin: 0 auto;
    /* centers the A4 column on desktop */
    display: block;
    text-align: left;
}

@media (max-width: 768px) {

    /* Hide horizontal overflow while JS applies the scale transform */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Push button above the ~70px bottom navbar + safe area */
    .floating-action-bar {
        left: 50%;
        right: auto;
        bottom: calc(80px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
    }

    .fab-btn {
        padding: 14px 26px;
        font-size: 14px;
    }
}

@media print {
    .report-scale-wrapper {
        transform: none !important;
        width: 210mm !important;
        margin: 0 auto !important;
    }

    .floating-action-bar,
    .page-preloader {
        display: none !important;
    }
}

table,
th,
td {
    border: 0 !important;
}