/* =========================================================
   resume.css  –  ATS-friendly Printable Resume Styling (Exact 2-Page Fit)
   ========================================================= */

/* CSS Variables */
:root {
    --text-color: #1e293b;
    --text-light: #475569;
    --primary-color: #0f172a;
    --accent-color: #2563eb;
    --border-color: #cbd5e1;
    --bg-screen: #f1f5f9;
    --bg-sheet: #ffffff;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-screen);
    color: var(--text-color);
    line-height: 1.35;
    font-size: 9.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Action Bar (Top Navigation) */
.action-bar {
    background-color: #0f172a;
    padding: 10px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-bar-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-btn {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn {
    color: #94a3b8;
    background-color: transparent;
}

.back-btn:hover {
    color: #f8fafc;
    background-color: rgba(255, 255, 255, 0.05);
}

.print-btn {
    color: #ffffff;
    background-color: var(--accent-color);
}

.print-btn:hover {
    background-color: #1d4ed8;
}

/* Page Layout for Preview */
.resume-wrapper {
    padding: 24px 12px;
    display: flex;
    justify-content: center;
}

.resume-container {
    background-color: var(--bg-sheet);
    width: 210mm; /* A4 width */
    min-height: 297mm;
    padding: 12mm 15mm;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.loading-state {
    text-align: center;
    padding: 50px;
    font-weight: 500;
    color: var(--text-light);
}

/* Resume Document Structure */
.resume-header {
    text-align: center;
    margin-bottom: 3.5mm;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 2.5mm;
}

.resume-name {
    font-size: 20pt;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 0.8mm;
    text-transform: uppercase;
}

.resume-title {
    font-size: 10.5pt;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5mm;
}

.resume-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2mm 4.5mm;
    font-size: 8.2pt;
    color: var(--text-light);
}

.resume-contact a {
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.resume-contact a:hover {
    color: var(--accent-color);
}

/* Section Common Styling */
.resume-section {
    margin-bottom: 3mm;
}

.section-title {
    font-size: 10pt;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8mm;
    margin-bottom: 2mm;
}

/* Summary */
.summary-text {
    font-size: 8.5pt;
    color: var(--text-color);
    line-height: 1.38;
    text-align: justify;
}

/* Skills */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1.1mm;
}

.skills-row {
    display: flex;
    font-size: 8.5pt;
    line-height: 1.25;
}

.skills-category {
    font-weight: 700;
    width: 44mm;
    color: var(--primary-color);
    flex-shrink: 0;
}

.skills-list {
    color: var(--text-color);
    flex: 1;
}

/* Experience & Projects */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 2.6mm;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6mm;
}

.item-title {
    font-size: 9pt;
    font-weight: 700;
    color: var(--primary-color);
}

.item-meta {
    font-size: 8.2pt;
    font-weight: 500;
    color: var(--text-light);
}

.item-subtitle {
    font-size: 8.2pt;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1mm;
}

.item-tech-stack {
    font-size: 8pt;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 1mm;
}

.item-bullet-list {
    padding-left: 4mm;
    font-size: 8.2pt;
    color: var(--text-color);
    line-height: 1.32;
}

.item-bullet-list li {
    margin-bottom: 0.5mm;
}

/* Certifications & Education */
.edu-cert-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2mm;
}

.edu-cert-item {
    font-size: 8.5pt;
}

.edu-cert-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.edu-cert-name {
    font-weight: 700;
    color: var(--primary-color);
}

.edu-cert-date {
    font-weight: 500;
    color: var(--text-light);
    font-size: 8.2pt;
}

.edu-cert-inst {
    font-size: 8.2pt;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 0.3mm;
}

/* Screen Page Break Divider */
@media screen {
    .page-break {
        border-top: 2px dashed #cbd5e1;
        margin: 6mm 0;
        position: relative;
    }
    .page-break::after {
        content: "--- PAGE 2 BEGINS HERE ---";
        position: absolute;
        top: -9px;
        right: 10px;
        background: #ffffff;
        color: #94a3b8;
        font-size: 7.5pt;
        padding: 0 8px;
        font-family: monospace;
        letter-spacing: 0.5px;
    }
}

/* =========================================================
   PRINT MEDIA RULES (STRICT 2-PAGE FIT)
   ========================================================= */
@media print {
    /* Hide Screen Elements */
    .action-bar {
        display: none !important;
    }

    body {
        background-color: #ffffff;
        color: #000000;
        font-size: 8.5pt;
    }

    .resume-wrapper {
        padding: 0;
    }

    .resume-container {
        width: 100%;
        min-height: 0;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    @page {
        size: A4 portrait;
        margin: 8mm 10mm 8mm 10mm;
    }

    /* Page breaks enforcement */
    .page-break {
        page-break-before: always !important;
        break-before: page !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .section-title {
        page-break-after: avoid;
        break-after: avoid;
    }

    .timeline-list > div {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .edu-cert-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    a {
        text-decoration: none;
        color: inherit !important;
    }
}
