/*
 * Professional Resume Stylesheet
 * Harvard/Stanford Format - ATS Optimized
 * Mobile-first, Print-friendly (Single Page)
 */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2c3e50;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #333333;
    --bg-color: #ffffff;
    --bg-page: #e8e8e8;
    --font-main: 'Georgia', 'Times New Roman', Times, serif;
    --font-heading: 'Helvetica Neue', Arial, sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
    background: var(--bg-page);
}

/* ===== LINKS ===== */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== DOWNLOAD BUTTON (Floating FAB) ===== */
.download-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    z-index: 9999;
}

.download-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: #fff;
}

.download-btn i {
    font-size: 1.1rem;
}

/* ===== PAGE CONTAINER ===== */
.page {
    max-width: 850px;
    margin: 20px auto;
    background: var(--bg-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.sheet {
    padding: 30px 40px;
}

/* ===== HEADER SECTION ===== */
.header {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px;
}

.titleName {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.12rem;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.titlePosition {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.08rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.titleContact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.85rem;
}

.titleContact a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-color);
}

.titleContact i {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ===== SECTION HEADERS ===== */
.sectionHeader {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3px;
    margin-bottom: 8px;
    margin-top: 12px;
}

/* ===== PROFESSIONAL SUMMARY ===== */
.professionalSummary {
    margin-bottom: 5px;
}

.professionalSummary .sectionHeader {
    margin-top: 0;
}

.professionalSummaryDescription {
    text-align: justify;
    line-height: 1.5;
    font-size: 0.88rem;
}

/* ===== MAIN LAYOUT ===== */
.container {
    display: flex;
    gap: 25px;
}

.leftPanel {
    flex: 0 0 200px;
    order: 2;
}

.bodyPanel {
    flex: 1;
    order: 1;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

/* ===== EXPERIENCE SECTION ===== */
.professionalExperience {
    margin-top: 0;
}

.professionalExperience .sectionHeader {
    margin-top: 0;
}

.professionalDescription {
    margin-top: 8px;
}

.job {
    margin-bottom: 12px;
}

.job:last-child {
    margin-bottom: 0;
}

.jobTitle {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 1px;
    font-size: 0.88rem;
}

.jobTitle b {
    font-family: var(--font-heading);
    font-weight: 600;
}

.jobDescription {
    margin-top: 4px;
}

.jobDescription ul,
.list {
    margin: 0;
    padding-left: 16px;
}

.jobDescription li,
.list li {
    margin-bottom: 2px;
    line-height: 1.4;
    font-size: 0.85rem;
}

/* ===== SKILLS SECTION ===== */
.areasOfExpertise {
    margin-bottom: 10px;
}

.areaDescription {
    margin-bottom: 8px;
}

.areaDescription > b {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02rem;
    display: block;
    margin-bottom: 3px;
}

.skill ul {
    padding-left: 16px;
    margin: 0;
}

.skill li {
    font-size: 0.82rem;
    margin-bottom: 1px;
    line-height: 1.3;
}

/* ===== CERTIFICATIONS ===== */
.certifications {
    margin-bottom: 10px;
}

.certificationDetail {
    font-size: 0.82rem;
    margin-bottom: 5px;
    line-height: 1.3;
}

.certificationDetail b {
    display: block;
    font-weight: 600;
}

/* ===== EDUCATION ===== */
.education {
    margin-bottom: 10px;
}

.educationDescription {
    font-size: 0.82rem;
    margin-bottom: 5px;
    line-height: 1.3;
}

.educationDescription b {
    display: block;
    font-weight: 600;
}

/* ===== QR CODES ===== */
.qrCodes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.qrCodes img {
    width: 55px;
    height: 55px;
    border: 1px solid var(--border-color);
}

/* ===== FOOTER ===== */
.last-update {
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-top: 10px;
    margin-top: 15px;
    border-top: 1px solid #ddd;
}

/* ===== UTILITY ===== */
hr {
    display: none;
}

b {
    font-weight: 600;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media screen and (max-width: 850px) {
    .sheet {
        padding: 25px 30px;
    }

    .titleName {
        font-size: 1.6rem;
    }

    .container {
        gap: 18px;
    }

    .leftPanel {
        flex: 0 0 180px;
    }

    .bodyPanel {
        padding-right: 15px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (600px and below)
   Order: Summary → Experience → Certs → Education → Skills
   ======================================== */
@media screen and (max-width: 600px) {
    body {
        background: var(--bg-color);
    }

    .page {
        margin: 0;
        box-shadow: none;
    }

    .sheet {
        padding: 15px;
    }

    .header {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .titleName {
        font-size: 1.4rem;
        letter-spacing: 0.08rem;
    }

    .titlePosition {
        font-size: 0.95rem;
    }

    .titleContact {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    /* Flexbox column with order for mobile */
    .container {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Experience comes first on mobile */
    .bodyPanel {
        order: 1;
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 15px;
        margin-bottom: 10px;
    }

    /* Left panel content reordered via inner elements */
    .leftPanel {
        order: 2;
        flex: none;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Order within leftPanel for mobile */
    .certifications {
        order: 1;
    }

    .education {
        order: 2;
    }

    .areasOfExpertise {
        order: 3;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        margin-top: 10px;
    }

    .qrCodes {
        order: 4;
        display: none;
    }

    /* Skills in 2 columns on mobile */
    .areasOfExpertise .areaDescription {
        display: inline-block;
        width: 48%;
        vertical-align: top;
        margin-right: 2%;
    }

    .sectionHeader {
        font-size: 0.85rem;
        margin-top: 12px;
    }

    .jobTitle {
        flex-direction: column;
        gap: 0;
    }

    .jobDescription li {
        font-size: 0.85rem;
    }
}

/* ========================================
   PRINT STYLES - Single Page PDF
   ======================================== */
@media print {
    /* Hide non-print elements */
    .no-print,
    .no-print * {
        display: none !important;
    }

    /* Page setup - tighter margins for single page */
    @page {
        size: letter;
        margin: 0.3in 0.4in 0.3in 0.4in;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        font-size: 9pt;
        line-height: 1.25;
        background: white !important;
    }

    .page {
        max-width: 100%;
        margin: 0;
        box-shadow: none;
        border: none;
    }

    .sheet {
        padding: 0;
    }

    /* Header - compact */
    .header {
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom-width: 1px;
    }

    .titleName {
        font-size: 16pt;
        margin-bottom: 2px;
    }

    .titlePosition {
        font-size: 10pt;
        margin-bottom: 6px;
    }

    .titleContact {
        font-size: 8pt;
        gap: 5px 15px;
    }

    .titleContact i {
        display: none;
    }

    /* Section headers - compact */
    .sectionHeader {
        font-size: 9pt;
        margin-top: 8px;
        margin-bottom: 5px;
        padding-bottom: 2px;
    }

    .professionalSummary .sectionHeader {
        margin-top: 0;
    }

    /* Summary - compact */
    .professionalSummary {
        margin-bottom: 3px;
    }

    .professionalSummaryDescription {
        font-size: 8.5pt;
        line-height: 1.3;
    }

    /* Layout - tighter */
    .container {
        gap: 15px;
    }

    .leftPanel {
        flex: 0 0 155px;
    }

    .bodyPanel {
        padding-right: 12px;
    }

    /* Jobs - compact */
    .professionalDescription {
        margin-top: 5px;
    }

    .job {
        margin-bottom: 7px;
    }

    .jobTitle {
        font-size: 8.5pt;
        margin-bottom: 1px;
    }

    .jobDescription {
        margin-top: 2px;
    }

    .jobDescription ul,
    .list {
        padding-left: 12px;
    }

    .jobDescription li,
    .list li {
        font-size: 8pt;
        margin-bottom: 1px;
        line-height: 1.25;
    }

    /* Skills - compact */
    .areasOfExpertise {
        margin-bottom: 6px;
    }

    .areasOfExpertise .sectionHeader {
        margin-top: 0;
    }

    .areaDescription {
        margin-bottom: 5px;
    }

    .areaDescription > b {
        font-size: 7pt;
        margin-bottom: 2px;
    }

    .skill ul {
        padding-left: 12px;
    }

    .skill li {
        font-size: 7.5pt;
        line-height: 1.2;
        margin-bottom: 0;
    }

    /* Certifications - compact */
    .certifications {
        margin-bottom: 6px;
    }

    .certificationDetail {
        font-size: 7.5pt;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    /* Education - compact */
    .education {
        margin-bottom: 6px;
    }

    .educationDescription {
        font-size: 7.5pt;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    /* QR codes - smaller for print */
    .qrCodes {
        margin-top: 6px;
        gap: 5px;
    }

    .qrCodes img {
        width: 40px;
        height: 40px;
    }

    /* Prevent page breaks */
    .job,
    .professionalSummary,
    .areasOfExpertise,
    .certifications,
    .education {
        page-break-inside: avoid;
    }

    /* Hide footer in print */
    .last-update {
        display: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
