/* ==========================================================================
   Premium 4-Page Printable Report Template (A4 PDF Optimized)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@400;500;600&display=swap');

:root {
    --pr-bg: #FAF6F0; /* Elegant light cream */
    --pr-text: #33312E; /* Charcoal */
    --pr-text-light: #8A857D;
    --pr-gold: #B48A53; /* Elegant muted gold */
    --pr-gold-light: #F0E8D9;
    --pr-border: #E8E3DA;
    --pr-card-bg: #F3EFE8;
}

.print-report-wrapper {
    width: 210mm;
    color: var(--pr-text);
    font-family: 'Outfit', sans-serif;
}

.print-page {
    background-color: var(--pr-bg);
    width: 100%;
    height: 1122px; /* floor(297mm at 96dpi); avoids html2pdf rounding blank pages */
    padding: 60px 70px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* =======================================
   Header & Footer
   ======================================= */
.print-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.print-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pr-gold);
    letter-spacing: 3px;
}

.print-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 70px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
    border-top: 1px solid var(--pr-border);
    border-radius: 40px 40px 0 0;
}

.footer-left strong {
    font-size: 0.9rem;
    color: var(--pr-gold);
    letter-spacing: 2px;
}

.footer-left span {
    font-size: 0.85rem;
    color: var(--pr-text);
    font-weight: 500;
}

.footer-right {
    font-size: 0.75rem;
    color: var(--pr-text-light);
    letter-spacing: 2px;
}

/* =======================================
   Page 1: Cover
   ======================================= */
.cover-page {
    text-align: center;
    justify-content: space-between;
    padding-bottom: 150px; /* Keep the summary above the absolute footer. */
}

.print-cover-titles {
    margin-top: 32px;
    margin-bottom: 40px;
}

.print-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--pr-text);
    font-weight: 500;
    margin-bottom: 10px;
}

.print-sub-subtitle {
    font-size: 0.8rem;
    letter-spacing: 4px;
    color: var(--pr-text-light);
    text-transform: uppercase;
}

.print-profile {
    margin-bottom: 40px;
}

.print-name {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    overflow-wrap: anywhere;
    font-weight: 600;
    color: var(--pr-text);
    margin: 0 0 10px 0;
    line-height: 1.1;
}

.print-dob {
    font-size: 1rem;
    color: var(--pr-text-light);
    font-weight: 500;
}

.print-core-circles {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.print-circle-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.print-circle {
    width: 120px;
    height: 120px;
    border: 2px solid var(--pr-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-circle span {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 600;
    color: var(--pr-gold);
}

.print-circle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pr-text);
    letter-spacing: 1px;
    line-height: 1.4;
}

.print-circle-label span {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--pr-text-light);
    letter-spacing: 0px;
}

.print-cover-summary {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--pr-text-light);
    max-width: 500px;
    margin: 0 auto;
}

/* =======================================
   Section Headers (Pages 2,3,4)
   ======================================= */
.print-section-header {
    margin-bottom: 24px;
}

.print-section-sup {
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--pr-text-light);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.print-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--pr-gold);
    margin: 0 0 15px 0;
    font-weight: 600;
}

.print-section-desc {
    font-size: 0.95rem;
    color: var(--pr-text-light);
    line-height: 1.5;
    max-width: 600px;
}

/* =======================================
   Page 2: Core Numbers Cards
   ======================================= */
.print-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.print-number-card {
    background: var(--pr-card-bg);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.print-number-card .card-circle {
    width: 54px;
    height: 54px;
    border: 1px solid var(--pr-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--pr-gold);
    flex-shrink: 0;
}

.print-number-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.print-number-card .print-card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--pr-text);
}

.print-number-card .card-subtitle {
    font-size: .65rem;
    color: var(--pr-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.print-number-card .card-planet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--pr-gold-light);
    color: var(--pr-gold);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    width: fit-content;
}

.print-compound { color: var(--pr-gold); font-size: 10px; max-width: 180px; line-height: 1.6; }
.print-number-ledger { margin-top: 20px; }
.print-number-ledger h3 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 500; color: var(--pr-gold); margin: 0 0 10px; }
.print-number-ledger table { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: 10px; line-height: 1.5; color: var(--pr-text); }
.print-number-ledger th, .print-number-ledger td { padding: 4px 7px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--pr-border); overflow-wrap: anywhere; }
.print-number-ledger thead { background: var(--pr-gold-light); color: var(--pr-text); }
.print-number-ledger th:first-child { width: 29%; }
.print-number-ledger th:last-child { width: 9%; }
.print-number-ledger td:last-child { color: var(--pr-gold); font-weight: 600; }
.print-number-ledger small { display: block; font-size: 8px; line-height: 1.5; font-weight: 400; color: var(--pr-text-light); }
.print-master-summary { background: var(--pr-gold-light); padding: 12px 14px; border-radius: 8px; margin-top: 14px; font-size: 10px; line-height: 1.6; }
.print-master-summary strong { color: var(--pr-gold); }
.print-master-summary p { margin: 5px 0 0; }
.number-page { padding: 36px 56px 125px; }
.number-page > * { flex-shrink: 0; }
.number-page .print-header { margin-bottom: 18px; }
.number-page .print-section-header { margin-bottom: 18px; }
.number-page .print-section-sup { font-size: 10px; margin-bottom: 6px; }
.number-page .print-section-title { font-size: 28px; line-height: 1.2; margin-bottom: 10px; }
.number-page .print-section-desc { font-size: 13px; line-height: 1.5; margin: 0; }

/* =======================================
   Page 3: Birth Grid
   ======================================= */
.print-grid-container {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
}

.print-loshu-grid {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 2px;
    background: var(--pr-border);
    border: 2px solid var(--pr-border);
}

.print-loshu-cell {
    background: var(--pr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--pr-text-light);
    position: relative;
}

.print-loshu-cell.present {
    background: #FFFFFF;
    color: var(--pr-gold);
    font-weight: 600;
}

.print-loshu-cell.repeated {
    background: var(--pr-gold-light);
    color: var(--pr-gold);
    font-weight: 700;
}

.print-loshu-cell .cell-count {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.65rem;
    font-family: 'Outfit', sans-serif;
    color: var(--pr-text);
    background: rgba(255,255,255,0.7);
    padding: 2px 5px;
    border-radius: 4px;
}

.print-grid-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--pr-text-light);
}

.legend-item strong {
    color: var(--pr-text);
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--pr-border);
}
.legend-icon.present { background: #FFFFFF; border-color: var(--pr-gold); }
.legend-icon.repeated { background: var(--pr-gold-light); border-color: var(--pr-gold); }
.legend-icon.missing { background: var(--pr-bg); }

.print-grid-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.stats-box {
    padding: 20px;
    border-radius: 12px;
}

.stats-box.repeated-box {
    background: #E8F0EA; /* Light sage */
}

.stats-box.missing-box {
    background: var(--pr-card-bg);
}

.stats-box strong {
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--pr-text-light);
}

.stats-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--pr-text);
    margin: 8px 0;
    font-weight: 600;
}

.stats-box p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--pr-text-light);
}

/* Planes & Arrows */
.print-planes-section h3, .print-arrows-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--pr-text);
    margin-bottom: 15px;
}

.planes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 16px;
}

.plane-card {
    background: #FFFFFF;
    border: 1px solid var(--pr-border);
    padding: 15px;
    border-radius: 8px;
}

.plane-card h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: var(--pr-text);
}

.plane-card p {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: var(--pr-text-light);
}

.plane-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.plane-status.steady {
    background: #E8F0EA;
    color: #2F6B45;
}

.plane-status.gap {
    background: var(--pr-gold-light);
    color: var(--pr-gold);
}

.print-arrows-section p {
    font-size: 0.85rem;
    color: var(--pr-text-light);
    line-height: 1.4;
}

/* =======================================
   Page 4: Remedies
   ======================================= */
.remedies-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.remedy-card-wrap {
    background: var(--pr-card-bg);
    border-radius: 12px;
    padding: 25px;
}

.remedy-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.remedy-icon {
    width: 40px;
    height: 40px;
    background: var(--pr-gold);
    color: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: bold;
}

.remedy-title-group h4 {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--pr-gold);
    text-transform: uppercase;
}

.remedy-title-group h3 {
    margin: 5px 0 0 0;
    font-size: 1.4rem;
    color: var(--pr-text);
    font-family: 'Playfair Display', serif;
}

.remedy-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.remedy-row {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
}

.remedy-row strong {
    color: var(--pr-text-light);
    width: 70px;
}

.remedy-row span {
    color: var(--pr-text);
    font-weight: 500;
}

.remedy-crystal-card, .remedy-mantra-card {
    background: #FFFFFF;
    border: 1px solid var(--pr-border);
    border-radius: 12px;
    padding: 20px;
}

.remedy-crystal-card h4, .remedy-mantra-card h4 {
    margin: 0 0 5px 0;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--pr-text-light);
    text-transform: uppercase;
}

.remedy-crystal-card p {
    margin: 0;
    font-size: 1rem;
    color: var(--pr-text);
    font-weight: 500;
}

.remedy-crystal-card small {
    display: block;
    margin-top: 5px;
    color: var(--pr-text-light);
    font-size: 0.85rem;
}

.mantra-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--pr-text);
    text-align: center;
    margin: 15px 0;
}

.mantra-count {
    text-align: center;
    font-size: 0.85rem;
    color: var(--pr-text-light);
}
