/* ==================================================
   COLOR SYSTEM & ROOT VARIABLES
   ================================================== */
:root {
    --navy: #24384D;
    --sidebar: #F1F4F6;
    --text: #202830;
    --muted: #5F6872;
    --white: #FFFFFF;
    --border: #24384D;
    --border-light: #DCE3E8;
    --bg-page: #EAEFF2;
}

/* ==================================================
   BASE & RESET
   ================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background-color: var(--bg-page);
    line-height: 1.58;
    margin: 0;
    padding: 24px 0;
}

/* ==================================================
   A4 RESUME CONTAINER
   ================================================== */
.resume {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background-color: var(--white);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==================================================
   HEADER
   ================================================== */
.resume-header {
    background-color: var(--navy);
    color: var(--white);
    padding: 30px 32px 26px 32px;
    text-align: center;
    width: 100%;
}

.candidate-name {
    font-size: 35px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--white);
    letter-spacing: 3.5px;
    line-height: 1.15;
    margin-bottom: 8px;
}

.candidate-subtitle {
    font-size: 15.5px;
    font-weight: 400;
    text-transform: uppercase;
    color: #D6E0E9;
    letter-spacing: 2px;
    line-height: 1.25;
}

/* ==================================================
   RESUME BODY (TWO-COLUMN DESKTOP)
   ================================================== */
.resume-body {
    display: grid;
    grid-template-columns: 70mm 140mm;
    flex: 1;
}

/* ==================================================
   LEFT SIDEBAR
   ================================================== */
.sidebar {
    background-color: var(--sidebar);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid var(--border-light);
}

/* Profile Photo & Clean CSS Placeholder */
.profile-photo-wrapper {
    width: 124px;
    height: 124px;
    margin: 0 auto 6px auto;
    border-radius: 50%;
    border: 2.5px solid var(--navy);
    background-color: #DCE3E9;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Clean fallback avatar silhouette */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='%2324384D'%3E%3Cpath d='M50 48a18 18 0 1 0 0-36 18 18 0 0 0 0 36zm0 10c-18.7 0-34 11.2-34 25v5h68v-5c0-13.8-15.3-25-34-25z' opacity='0.75'/%3E%3C/svg%3E");
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: 82% auto;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* Sidebar Section Headers */
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--navy);
    letter-spacing: 1px;
    padding-bottom: 4px;
    margin-bottom: 10px;
    border-bottom: 1.5px solid var(--border);
}

/* Contact List */
.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.contact-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
}

.contact-link,
.contact-text {
    font-size: 12px;
    color: var(--navy);
    line-height: 1.4;
    word-break: break-word;
    text-decoration: none;
    font-weight: 500;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Skills & Hobbies Lists */
.skills-list {
    list-style-type: disc;
    padding-left: 17px;
    display: flex;
    flex-direction: column;
    gap: 4.5px;
}

.skills-list li {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.42;
}

/* ==================================================
   RIGHT MAIN CONTENT
   ================================================== */
.main-content {
    background-color: var(--white);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 17px;
}

/* Section Headings */
.section-title {
    font-size: 19px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--navy);
    letter-spacing: 1.2px;
    padding-bottom: 4px;
    margin-bottom: 10px;
    border-bottom: 1.5px solid var(--border);
}

/* Career Objective */
.objective-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    text-align: justify;
}

/* Academic Qualification */
.education-entry {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.degree-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}

.education-date {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.institution-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.academic-status {
    font-size: 12.5px;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 3px;
}

.coursework-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text);
}

/* Projects */
.projects-section {
    display: flex;
    flex-direction: column;
}

.project-entry {
    margin-bottom: 11px;
}

.project-entry:last-child {
    margin-bottom: 0;
}

.project-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 3px;
    line-height: 1.3;
}

.project-desc {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text);
    margin-bottom: 3px;
    text-align: justify;
}

.project-tech {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.project-tech strong {
    color: var(--navy);
    font-weight: 700;
}

/* Work Experience */
.experience-entry {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.experience-status {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.5px;
}

.experience-desc {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text);
}

/* Personal Details */
.personal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px 24px;
}

.personal-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.personal-label {
    width: 105px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
}

.personal-value {
    font-size: 12.5px;
    color: var(--text);
    font-weight: 500;
}

/* ==================================================
   RESPONSIVE DESIGN (PRESERVE EXACT A4 2-COLUMN RESUME ON MOBILE)
   ================================================== */
@media screen and (max-width: 860px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    body {
        padding: 12px 6px;
        background-color: #DCE3E8;
    }

    .resume {
        width: 100% !important;
        max-width: 650px !important;
        min-height: auto !important;
        margin: 0 auto !important;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16) !important;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background-color: var(--white);
    }

    /* Keep Full Navy Header */
    .resume-header {
        padding: 22px 14px 18px 14px;
    }

    .candidate-name {
        font-size: 24px;
        letter-spacing: 2px;
        margin-bottom: 5px;
        line-height: 1.2;
    }

    .candidate-subtitle {
        font-size: 11px;
        letter-spacing: 1.2px;
        color: #D6E0E9;
    }

    /* Keep Exact Two-Column Resume Grid */
    .resume-body {
        display: grid !important;
        grid-template-columns: 34% 66% !important;
        flex: 1;
    }

    /* Left Sidebar */
    .sidebar {
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--sidebar) !important;
        padding: 16px 10px !important;
        gap: 14px !important;
        border-right: 1px solid var(--border-light) !important;
    }

    .profile-photo-wrapper {
        width: 84px;
        height: 84px;
        margin: 0 auto 4px auto;
        border: 2px solid var(--navy);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(36, 56, 77, 0.15);
    }

    .sidebar-title {
        font-size: 12.5px;
        letter-spacing: 0.8px;
        padding-bottom: 3px;
        margin-bottom: 6px;
        border-bottom: 1.5px solid var(--navy);
    }

    .contact-list {
        gap: 7px;
    }

    .contact-label {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .contact-link,
    .contact-text {
        font-size: 10px;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .skills-list {
        padding-left: 14px;
        gap: 3.5px;
    }

    .skills-list li {
        font-size: 10px;
        line-height: 1.35;
    }

    /* Right Content */
    .main-content {
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--white) !important;
        padding: 16px 14px !important;
        gap: 12px !important;
    }

    .section-title {
        font-size: 13.5px;
        letter-spacing: 0.8px;
        padding-bottom: 3px;
        margin-bottom: 6px;
        border-bottom: 1.5px solid var(--navy);
    }

    .objective-text {
        font-size: 10.5px;
        line-height: 1.48;
        text-align: justify;
    }

    .education-entry {
        gap: 2px;
    }

    .education-header {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 6px;
    }

    .degree-title {
        font-size: 11.5px;
        font-weight: 700;
    }

    .education-date {
        font-size: 9.5px;
        white-space: nowrap;
    }

    .institution-name {
        font-size: 10.5px;
    }

    .academic-status {
        font-size: 9.5px;
        margin-bottom: 2px;
    }

    .coursework-text {
        font-size: 9.5px;
        line-height: 1.4;
    }

    /* Projects */
    .project-entry {
        margin-bottom: 9px;
    }

    .project-entry:last-child {
        margin-bottom: 0;
    }

    .project-title {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .project-desc {
        font-size: 9.8px;
        line-height: 1.4;
        margin-bottom: 2px;
        text-align: justify;
    }

    .project-tech {
        font-size: 9px;
        line-height: 1.3;
    }

    /* Experience */
    .experience-status {
        font-size: 11px;
    }

    .experience-desc {
        font-size: 9.8px;
        line-height: 1.4;
    }

    /* Personal Details */
    .personal-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .personal-row {
        display: flex;
        align-items: baseline;
        gap: 6px;
    }

    .personal-label {
        width: 80px;
        font-size: 9.5px;
        flex-shrink: 0;
    }

    .personal-value {
        font-size: 9.8px;
    }
}

/* Extra Compact Tuning for Small Phones (<= 420px) */
@media screen and (max-width: 420px) {
    body {
        padding: 6px 3px;
    }

    .resume-header {
        padding: 18px 10px 14px 10px;
    }

    .candidate-name {
        font-size: 20px;
        letter-spacing: 1.5px;
    }

    .candidate-subtitle {
        font-size: 9.5px;
        letter-spacing: 0.8px;
    }

    .resume-body {
        grid-template-columns: 35% 65% !important;
    }

    .sidebar {
        padding: 12px 6px !important;
        gap: 11px !important;
    }

    .profile-photo-wrapper {
        width: 70px;
        height: 70px;
    }

    .sidebar-title {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .contact-label {
        font-size: 8px;
    }

    .contact-link,
    .contact-text {
        font-size: 8.8px;
        line-height: 1.3;
    }

    .skills-list {
        padding-left: 11px;
        gap: 2.5px;
    }

    .skills-list li {
        font-size: 8.8px;
        line-height: 1.3;
    }

    .main-content {
        padding: 12px 8px !important;
        gap: 9px !important;
    }

    .section-title {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .objective-text {
        font-size: 9.2px;
        line-height: 1.38;
    }

    .degree-title {
        font-size: 10.2px;
    }

    .education-date {
        font-size: 8.5px;
    }

    .institution-name {
        font-size: 9.2px;
    }

    .academic-status {
        font-size: 8.5px;
    }

    .coursework-text {
        font-size: 8.5px;
        line-height: 1.32;
    }

    .project-entry {
        margin-bottom: 7px;
    }

    .project-title {
        font-size: 9.8px;
    }

    .project-desc {
        font-size: 8.8px;
        line-height: 1.35;
    }

    .project-tech {
        font-size: 8.2px;
    }

    .experience-status {
        font-size: 9.8px;
    }

    .experience-desc {
        font-size: 8.8px;
        line-height: 1.35;
    }

    .personal-label {
        width: 68px;
        font-size: 8.5px;
    }

    .personal-value {
        font-size: 8.8px;
    }
}

/* ==================================================
   PRINT DESIGN (A4 ACCURATE)
   ================================================== */
@page {
    size: A4;
    margin: 0;
}

@media print {
    html, body {
        background-color: var(--white) !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .resume {
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .resume-header {
        background-color: var(--navy) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .resume-body {
        display: grid !important;
        grid-template-columns: 70mm 140mm !important;
        min-height: calc(297mm - 38mm) !important;
    }

    .sidebar {
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--sidebar) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .main-content {
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--white) !important;
    }

    /* Reset order properties for print */
    .profile-photo-wrapper,
    .contact-section,
    .objective-section,
    .education-section,
    .projects-section,
    .technical-skills-section,
    .soft-skills-section,
    .experience-section,
    .hobbies-section,
    .personal-section {
        order: initial !important;
        padding: initial !important;
        background-color: transparent !important;
    }

    .sidebar > * {
        padding: 0 !important;
    }

    .main-content > * {
        padding: 0 !important;
    }

    .sidebar {
        padding: 24px 20px !important;
    }

    .main-content {
        padding: 24px 28px !important;
    }

    .no-print {
        display: none !important;
    }

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