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

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 11pt;
    line-height: 1.3;
    color: #000;
    background: #fff;
    max-width: 8.5in;
    margin: 0 auto;
    padding: 0.5in;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 16pt;
}

.header h1 {
    font-size: 22pt;
    font-weight: bold;
    margin-bottom: 6pt;
}

.contact-info {
    font-size: 10pt;
}

.contact-info a {
    color: #000;
    text-decoration: none;
}

.contact-separator {
    margin: 0 8pt;
}

/* Section Styles */
.section {
    margin-bottom: 14pt;
    page-break-inside: avoid;
}

.section-title {
    font-size: 12pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    border-bottom: 1pt solid #000;
    margin-bottom: 6pt;
    padding-bottom: 2pt;
}

/* Experience/Education Item Styles */
.resume-item {
    margin-bottom: 10pt;
    page-break-inside: avoid;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2pt;
}

.item-title {
    font-weight: bold;
}

.item-subtitle {
    font-style: italic;
    font-size: 10pt;
    margin-bottom: 3pt;
}

.item-date-location {
    text-align: right;
    font-size: 10pt;
    flex-shrink: 0;
}

.item-location {
    font-weight: bold;
}

.item-date {
    font-style: italic;
}

/* Project Styles */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3pt;
}

.project-title-tech {
    display: flex;
    align-items: center;
    gap: 8pt;
}

.project-title {
    font-weight: bold;
}

.project-tech {
    font-style: italic;
    font-size: 10pt;
}

.project-date {
    font-style: italic;
    font-size: 10pt;
    flex-shrink: 0;
}

/* List Styles */
.resume-list {
    list-style: none;
    padding-left: 0;
    margin-left: 0.15in;
}

.resume-list li {
    position: relative;
    margin-bottom: 3pt;
    padding-left: 8pt;
    line-height: 1.2;
}

.resume-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    font-size: 8pt;
    line-height: 1.2;
}

/* Skills Styles */
.skills-grid {
    margin-left: 0.15in;
}

.skill-item {
    margin-bottom: 3pt;
}

.skill-category {
    font-weight: bold;
    display: inline;
}

.skill-list {
    display: inline;
}

/* Download Button */
.download-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #000;
    color: #fff;
    border: none;
    padding: 8pt 12pt;
    font-size: 9pt;
    cursor: pointer;
    border-radius: 2pt;
    z-index: 1000;
}

.download-btn:hover {
    background: #333;
}

/* Print Styles - Optimized for single page */
@media print {
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    body {
        margin: 0;
        padding: 0;
        font-size: 10pt;
        line-height: 1.2;
        max-width: none;
        width: 100%;
    }
    
    .download-btn {
        display: none !important;
    }
    
    .header {
        margin-bottom: 12pt;
    }
    
    .header h1 {
        font-size: 20pt;
        margin-bottom: 4pt;
    }
    
    .section {
        margin-bottom: 10pt;
        page-break-inside: avoid;
    }
    
    .section-title {
        font-size: 11pt;
        margin-bottom: 4pt;
    }
    
    .resume-item {
        margin-bottom: 8pt;
        page-break-inside: avoid;
    }
    
    .resume-list li {
        margin-bottom: 2pt;
        font-size: 9pt;
        line-height: 1.1;
    }
    
    .item-subtitle {
        font-size: 9pt;
        margin-bottom: 2pt;
    }
    
    .item-date-location {
        font-size: 9pt;
    }
    
    .project-tech,
    .project-date {
        font-size: 9pt;
    }
    
    .skill-item {
        margin-bottom: 2pt;
        font-size: 9pt;
    }
    
    /* Prevent orphan headings */
    .section-title {
        page-break-after: avoid;
    }
    
    /* Keep items together */
    .resume-item {
        orphans: 2;
        widows: 2;
    }
    
    /* Reduce spacing for projects to fit better */
    .projects-section .resume-item {
        margin-bottom: 6pt;
    }
    
    .projects-section .resume-list li {
        margin-bottom: 1pt;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .item-header,
    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-date-location {
        text-align: left;
        margin-top: 4pt;
    }
    
    .project-title-tech {
        flex-direction: column;
        align-items: flex-start;
        gap: 2pt;
    }
    
    .download-btn {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        display: block;
        width: 100%;
    }
}