/* =========================================================
   resume.css  –  ATS-friendly Printable Resume Styling
   ========================================================= */

/* 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.4;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Action Bar (Top Navigation) */
.action-bar {
    background-color: #0f172a;
    padding: 12px 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.9rem;
    font-weight: 600;
    padding: 8px 16px;
    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: 30px 15px;
    display: flex;
    justify-content: center;
}

.resume-container {
    background-color: var(--bg-sheet);
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    padding: 16mm 18mm;
    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: 5mm;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 4mm;
}

.resume-name {
    font-size: 22pt;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 1mm;
}

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

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

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

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

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

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

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

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

.skills-row {
    display: flex;
    font-size: 9pt;
    line-height: 1.3;
}

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

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

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

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

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

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

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

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

.item-bullet-list {
    padding-left: 4.5mm;
    font-size: 8.5pt;
    color: var(--text-color);
    line-height: 1.4;
}

.item-bullet-list li {
    margin-bottom: 0.8mm;
    text-align: justify;
}

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

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

.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.5pt;
}

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

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

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

    .resume-wrapper {
        padding: 0;
    }

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

    @page {
        size: A4;
        margin: 10mm 12mm 10mm 12mm;
    }

    /* Page breaks protection */
    .resume-section {
        page-break-inside: avoid;
    }

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

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

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

    a {
        text-decoration: none;
        color: var(--text-color) !important;
    }
}
