/*
 * DISC Rapport Styling - PDF Optimeret (A4 Fixed)
 */

.final-report {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #fff;
    width: 100%;
    max-width: 800px; /* Visning på skærm */
    margin: 0 auto;
    color: #333;
}

/* --- PDF Side-struktur --- */
.pdf-page {
    /* A4 dimensioner ca. 595pt x 842pt */
    /* Vi bruger padding til at skabe "papiret" */
    width: 100%;
    min-height: 1000px; /* Sikrer at siden fylder ud */
    padding: 40px;
    box-sizing: border-box;
    position: relative;
    background: #fff;
    page-break-after: always;
    overflow: hidden; /* Ingen scrollbars i PDF */
}

/* --- SIDE 1: FORSIDE --- */
.cover-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.cover-logo { max-width: 220px; margin-bottom: 60px; }
.cover-title { 
    font-size: 42px; font-weight: bold; color: #000; 
    margin-bottom: 80px; letter-spacing: 1px;
}
.cover-details strong { font-size: 26px; display: block; margin-bottom: 15px; }
.cover-details p { font-size: 18px; margin: 5px 0; color: #555; }
.cover-date { margin-top: 40px !important; color: #888; font-size: 14px; }


/* --- SIDE 2: INDHOLD --- */
.page-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 30px;
    display: flex; justify-content: space-between; align-items: center;
}
.header-logo { height: 30px; }
.header-name { font-weight: bold; color: #999; text-transform: uppercase; font-size: 12px; }

/* Diagrammer */
.chart-container {
    position: relative; 
    height: 350px; /* Fast højde er vigtig! */
    width: 100%; 
    margin: 0 auto 20px auto;
}
h2 { text-align: center; font-size: 24px; margin-bottom: 30px; }
.profile-highlight { color: #007cba; }

/* Søjlediagram (Tabel-baseret for stabilitet) */
.scores-bar-container {
    display: table; width: 100%; height: 200px;
    table-layout: fixed; margin-bottom: 0; position: relative; z-index: 2;
}
.score-column { display: table-cell; vertical-align: bottom; text-align: center; height: 100%; padding: 0 10px; }
.score-bar { display: inline-block; width: 40px; height: 100%; position: relative; }

/* Søjle-fyld */
.bar-fill {
    position: absolute; left: 0; width: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: bold; font-size: 12px; border-radius: 3px;
}
.bar-fill.pos { bottom: 50%; align-items: flex-start; padding-top: 4px; }
.bar-fill.neg { top: 50%; align-items: flex-end; padding-bottom: 4px; }

/* Midterlinje */
.zero-line {
    border-top: 1px dashed #ccc; width: 100%; height: 1px;
    position: relative; top: -120px; /* Juster så den rammer midten af 200px + labels */
    z-index: 1; margin-bottom: 40px;
}

.bar-label { font-weight: bold; font-size: 16px; margin-top: 8px; display: block; }

/* Farver */
.c-d { background: #E53935; } .c-i { background: #FDD835; color: #333 !important; }
.c-s { background: #43A047; } .c-c { background: #1E88E5; }

/* Tekstboks */
.profile-text-box {
    background: #f8f9fa; padding: 25px; border-radius: 8px;
    font-size: 14px; line-height: 1.6; color: #444;
    border-left: 4px solid #007cba;
    page-break-inside: avoid; /* Prøv at holde teksten samlet */
}

/* Skjul knap når vi genererer PDF */
.printing-mode #mg-download-pdf-btn { display: none !important; }

/* ==========================================================================
   VISUAL SUMMARY CARD & MODAL STYLING
   ========================================================================== */

.mg-summary-card-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 25px;
}

.mg-summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.mg-summary-user-info h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1e293b;
    font-weight: 700;
}

.mg-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #64748b;
    font-size: 13px;
}

.mg-summary-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mg-summary-badge {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mg-badge-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.mg-badge-code {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 1px;
}

.mg-summary-card-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: center;
    padding-bottom: 20px;
}

@media (max-width: 768px) {
    .mg-summary-card-body {
        grid-template-columns: 1fr;
    }
}

.mg-summary-title {
    font-size: 20px;
    color: #0f172a;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.mg-summary-text {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.mg-summary-scores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 320px;
}

.mg-score-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 5px;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.mg-score-pill .pill-letter { font-size: 12px; opacity: 0.9; }
.mg-score-pill .pill-value { font-size: 18px; margin-top: 2px; }

.pill-d { background-color: #E53935; }
.pill-i { background-color: #FDD835; color: #333333 !important; }
.pill-s { background-color: #43A047; }
.pill-c { background-color: #1E88E5; }

.mg-summary-chart-wrapper {
    height: 280px;
    position: relative;
    display: flex;
    justify-content: center;
}

.mg-summary-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.mg-action-btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.mg-action-btn:hover {
    transform: translateY(-1px);
}

/* Modal Styling */
.mg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.mg-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.mg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.mg-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}

.mg-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-modal-close-icon {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.mg-modal-close-icon:hover {
    color: #0f172a;
}

.mg-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f1f5f9;
}