:root {
    --bg-color: #f5f5f5;
    --resume-bg: #fff;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #777;
    --primary-color: #2c5aa0;
    --primary-hover: #1e3d6f;
    --border-color: #e0e0e0;
    --section-bg: #f8f9fc;
    --section-border: #2c5aa0;
    --skill-bg: #e3f2fd;
    --skill-color: #1565c0;
    --skill-border: #bbdefb;
    --list-border: #e8eaf6;
    --shadow: rgba(0,0,0,0.1);
}

/* Global font rendering improvements for cross-platform consistency */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.dark-mode {
    --bg-color: #1a1a1a;
    --resume-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --text-lighter: #999;
    --primary-color: #4a90e2;
    --primary-hover: #6ba3f0;
    --border-color: #404040;
    --section-bg: #3a3a3a;
    --section-border: #4a90e2;
    --skill-bg: #1e3a5f;
    --skill-color: #87ceeb;
    --skill-border: #2e4a6f;
    --list-border: #404040;
    --shadow: rgba(0,0,0,0.3);
}

#resume {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    font-size: .70em;
    line-height: 1.4;
    color: var(--text-color);
    background: var(--resume-bg);
    box-shadow: 0 0 20px var(--shadow);
    font-weight: 500;
}

body {
    margin: 0;
    padding: 20px;
    background: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

ul {
    margin-top: 0px;
    margin-bottom: 10px;
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
}

.role-description ul, #other-experience ul {
    list-style: none;
    padding-left: 0;
}

.role-description li, #other-experience li {
    border-left: 3px solid var(--list-border);
    padding-left: 15px;
    margin-bottom: 12px;
}

hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 30px 0;
}

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

a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

#print-button {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
}

#print-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
}

#print-button i {
    margin-right: 6px;
}

#dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
    transition: all 0.2s ease;
    z-index: 1000;
}

#dark-mode-toggle:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
}

#dark-mode-toggle i {
    margin-right: 6px;
}

#top {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    margin-bottom: 25px;
    background: var(--section-bg);
    padding: 20px;
    border-radius: 4px;
    border-left: 4px solid var(--section-border);
    align-items: center;
}
#name {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

#profile-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

#contact-info {
    text-align: right;
    font-size: .90em;
}

#contact-info i {
    width: 16px;
    margin-right: 6px;
    color: var(--primary-color);
}

.label {
    text-align: left;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

#work-experience {
    display: flex;
    flex-direction: column;
    margin-left: 20px;
}

.job {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--section-bg);
    border-left: 4px solid var(--section-border);
    border-radius: 4px;
}

.job > span {
    display: inline-block;
}

.company {
    font-weight: 800;
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 8px;
    margin-right: 15px;
}

.location {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
}

.roles {
    margin-left: 10px;
}

.role {
    font-weight: 700;
    margin-bottom: 5px;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 15px;
    align-items: end;
}

.role .time-range {
    font-weight: 500 !important;
    color: var(--text-light) !important;
    font-style: italic !important;
    font-size: 0.9em !important;
}

.role-description {
    margin-top: 10px;
    margin-bottom: 15px;
}

.title {
    color: var(--text-color);
}

.team {
    color: var(--text-lighter);
    font-size: 0.9em;
    font-weight: 500;
}

#skills {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-category {
    background: var(--section-bg);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid var(--section-border);
}

.category {
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
    font-size: 1em;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.3;
}

.skill-tag {
    display: inline-block;
    background: var(--skill-bg);
    color: var(--skill-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid var(--skill-border);
}

#other-experience {
    margin-left: 20px;
    padding: 15px;
    background: var(--section-bg);
    border-left: 4px solid var(--section-border);
    border-radius: 4px;
}

#education {
    display: flex;
    justify-content: space-evenly;
    margin-left: 20px;
    gap: 20px;
}

#education > div {
    flex: 1;
    padding: 15px;
    background: var(--section-bg);
    border-radius: 4px;
    border-left: 4px solid var(--section-border);
}

.school {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.degree-bonus {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.9em;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #resume {
        padding: 20px;
        box-shadow: none;
    }
    
    body {
        padding: 10px;
        background: var(--bg-color);
    }
    
    /* Mobile button adjustments */
    #dark-mode-toggle {
        top: 10px;
        right: 10px;
        padding: 10px 12px;
        font-size: 0.8em;
    }
    
    #print-button {
        top: 60px;
        right: 10px;
        padding: 10px 12px;
        font-size: 0.8em;
    }
    
    #top {
        flex-direction: column;
        align-items: flex-start;
        background: var(--section-bg) !important;
        padding: 15px;
        border-radius: 4px;
        border-left: 4px solid var(--section-border) !important;
        margin-bottom: 15px;
    }
    
    #contact-info {
        text-align: left;
        margin-top: 10px;
    }
    
    #contact-info i {
        width: 14px;
        margin-right: 5px;
    }
    
    #name {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    
    #profile-photo {
        width: 50px;
        height: 50px;
    }
    
    .label {
        font-size: 1.2em;
    }
    
    #work-experience, #skills, #other-experience {
        margin-left: 10px;
    }
    
    .job {
        padding: 10px;
        margin-bottom: 20px;
    }
    
    .role {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .role .time-range {
        font-size: 0.8em !important;
    }
    
    .location {
        margin-top: 5px;
    }
    
    #education {
        flex-direction: column;
        margin-left: 10px;
        gap: 15px;
    }
    
    #education > div {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .skill-list {
        gap: 4px;
    }
    
    .skill-tag {
        font-size: 0.75em;
        padding: 3px 8px;
    }
}

@media screen and (max-width: 480px) {
    #resume {
        font-size: 0.8em;
        padding: 15px;
    }
    
    body {
        padding: 5px;
    }
    
    /* Ultra-mobile button adjustments */
    #dark-mode-toggle {
        top: 5px;
        right: 5px;
        padding: 8px 10px;
        font-size: 0.75em;
    }
    
    #print-button {
        top: 50px;
        right: 5px;
        padding: 8px 10px;
        font-size: 0.75em;
    }
    
    #name {
        font-size: 1.5em;
        gap: 10px;
    }
    
    #profile-photo {
        width: 40px;
        height: 40px;
    }
    
    .company {
        font-size: 1.05em;
        margin-bottom: 5px;
    }
    
    .label {
        font-size: 1.1em;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    .job {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .skill-category {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .skill-tag {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    #contact-info {
        font-size: 0.85em;
        line-height: 1.3;
    }
    
    #contact-info div {
        margin-bottom: 3px;
    }
}

/* Print Styles - Optimized for exactly one page */
@media print {
    /* Force light mode for print regardless of current theme */
    body,
    body.dark-mode {
        --bg-color: #f5f5f5;
        --resume-bg: #fff;
        --text-color: #333;
        --text-light: #666;
        --text-lighter: #777;
        --primary-color: #2c5aa0;
        --primary-hover: #1e3d6f;
        --border-color: #e0e0e0;
        --section-bg: #f8f9fc;
        --section-border: #2c5aa0;
        --skill-bg: #e3f2fd;
        --skill-color: #1565c0;
        --skill-border: #bbdefb;
        --list-border: #e8eaf6;
        --shadow: rgba(0,0,0,0.1);
        
        margin: 0;
        padding: 0;
        background: white;
        font-size: 9pt;
        line-height: 1.1;
    }
    
    #resume {
        max-width: none;
        margin: 0;
        padding: 0.35in 0.6in;
        box-shadow: none;
        font-size: 8.2pt;
        line-height: 1.25;
        page-break-after: avoid;
        font-weight: 400;
    }
    
    /* Prevent page breaks inside important elements */
    .job, #education > div {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Compact spacing for print */
    #name {
        font-size: 13.5pt;
        margin-bottom: 0.5pt;
        color: #333;
        font-weight: 700;
    }

    #contact-info {
        font-size: 6.3pt;
        margin-bottom: 0.5pt;
        color: #333;
        line-height: 1.2;
        font-weight: 400;
    }
    
    #contact-info i {
        width: 8pt;
        margin-right: 2pt;
        color: #333;
    }
    
    #top {
        background: #f5f5f5 !important;
        border-left: 1pt solid #666 !important;
        padding: 3pt;
        border-radius: 2pt;
        margin-bottom: 1.5pt;
    }

    .label {
        font-size: 8.8pt;
        margin-top: 4pt;
        margin-bottom: 1pt;
        padding-bottom: 0.5pt;
        border-bottom: 0.5pt solid #999;
        color: #333;
        font-weight: 700;
    }

    #work-experience-label {
        margin-top: 4pt;
    }
    
    
    #work-experience {
        margin-left: 8pt;
    }
    
    .job {
        margin-bottom: 2pt;
        padding: 1.5pt;
        background: #f5f5f5;
        border-left: 1pt solid #666;
        border-radius: 2pt;
    }

    .company {
        font-size: 7.8pt;
        margin-bottom: 0.5pt;
        margin-right: 6pt;
        color: #333;
        font-weight: 700;
    }

    .location {
        font-size: 6.3pt;
        margin-bottom: 0.5pt;
        font-weight: 400;
    }

    .roles {
        margin-left: 3pt;
    }

    .role {
        margin-bottom: 0.5pt;
        font-size: 6.8pt;
        display: grid;
        grid-template-columns: auto auto 1fr;
        gap: 6pt;
        font-weight: 600;
    }

    .role .time-range {
        font-weight: 400;
        font-style: italic;
        font-size: 5.8pt;
    }

    .role-description {
        margin-top: 0.5pt;
        margin-bottom: 1.5pt;
    }

    .title {
        font-size: 6.3pt;
    }

    .team {
        font-size: 5.3pt;
        font-weight: 400;
    }
    
    ul {
        margin-bottom: 0.5pt;
        padding-left: 7pt;
    }

    li {
        margin-bottom: 0.5pt;
        font-size: 5.95pt;
        line-height: 1.22;
    }

    .role-description ul, #other-experience ul {
        list-style: none;
        padding-left: 0;
    }

    .role-description li, #other-experience li {
        border-left: 0.3pt solid #ccc;
        padding-left: 5pt;
        margin-bottom: 1.5pt;
    }
    
    #skills {
        margin-left: 8pt;
        display: block;
        gap: 2pt;
    }

    .skill-category {
        margin-bottom: 2pt;
        padding: 2pt;
        background: #f5f5f5;
        border-left: 1pt solid #666;
        border-radius: 2pt;
    }

    .category {
        font-size: 5.8pt;
        color: #333;
        font-weight: 600;
        margin-bottom: 0.5pt;
        display: block;
    }

    .skill-list {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5pt;
        line-height: 1.25;
    }

    .skill-tag {
        display: inline-block;
        background: #f0f0f0;
        color: #333;
        padding: 0.5pt 2.5pt;
        border-radius: 3pt;
        font-size: 4.8pt;
        font-weight: 400;
        border: 0.3pt solid #ccc;
    }
    
    #other-experience {
        margin-left: 8pt;
        padding: 1.5pt;
        background: #f5f5f5;
        border-left: 1pt solid #666;
        border-radius: 2pt;
    }


    #education {
        margin-left: 8pt;
        gap: 4pt;
    }

    #education > div {
        padding: 2pt;
        font-size: 6.2pt;
        background: #f5f5f5;
        border-radius: 2pt;
        border-left: 1pt solid #666;
    }

    .school {
        font-size: 6.2pt;
        margin-bottom: 0.3pt;
        color: #333;
        font-weight: 600;
    }

    .degree-bonus {
        font-size: 5.3pt;
        margin-bottom: 0pt;
    }
    
    /* Hide elements that shouldn't print */
    #print-button,
    #dark-mode-toggle {
        display: none;
    }
    
    a[href]:after {
        content: none;
    }
    
    /* Ensure links are visible in print */
    a {
        color: #000;
        text-decoration: none !important;
    }

    /* Keep company links readable in print */
    .company a {
        color: #333 !important;
        text-decoration: none !important;
    }
    
    /* Apply grayscale filter to profile photo in print */
    #profile-photo {
        filter: saturate(0%) contrast(1.1) !important;
        -webkit-filter: saturate(0%) contrast(1.1) !important;
        width: 45px;
        height: 45px;
        border: 1pt solid #666;
        opacity: 0.85;
    }

    /* Force everything to fit on one page */
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}