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

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
    color: #000;
    background-color: #fff;
    /* Prevent layout shift */
    overflow-x: hidden;
}

/* Resume Container */
.resume-container {
    max-width: 16in;
    margin: 0 auto;
    padding: 0.75in;
    background-color: #fff;
    min-height: 11in;
    /* Prevent layout shift */
    contain: layout;
}

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

.name {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.contact-info {
    font-size: 14px;
    color: #000;
}

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

.contact-info a:hover {
    text-decoration: underline;
}

.separator {
    margin: 0 8px;
    color: #666;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid #000;
    margin: 20px 0;
}

/* Section Styles */
.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Introduction Section */
.introduction-section {
    margin-bottom: 25px;
}

.introduction-content {
    margin-top: 15px;
}

.introduction-content p {
    font-size: 14px;
    color: #000;
    line-height: 1.4;
    text-align: justify;
}

/* Skills Section */
.skills-section {
    margin-bottom: 25px;
    /* Prevent layout shift */
    contain: layout;
    /* Override any injected styles */
    display: block !important;
    flex-direction: unset !important;
    gap: unset !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    border-top: none !important;
}

.skills-content {
    margin-top: 16px;
}

.skills-list {
    list-style-type: none;
    margin-left: 0;
    /* Prevent layout shift */
    contain: layout;
}

.skill-category {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    /* Prevent layout shift */
    contain: layout;
}

.skill-category-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin-right: 8px;
    min-width: fit-content;
    /* Prevent layout shift */
    flex-shrink: 0;
}

.skill-items-text {
    font-size: 14px;
    color: #000;
    line-height: 1.3;
    /* Prevent layout shift */
    word-wrap: break-word;
}

/* Experience Styles */
.experience {
    margin-bottom: 25px;
}

.company-header {
    margin-bottom: 10px;
}

.company-name {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin-bottom: 5px;
    background-color: #E0FFFF;
    padding: 2px 4px;
}

.position-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.position {
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.date {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.key-achievements {
    margin-top: 10px;
}

.achievements-title {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    margin-bottom: 8px;
}

.achievements-list {
    list-style-type: disc;
    margin-left: 20px;
}

.achievements-list li {
    font-size: 14px;
    color: #000;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Education Styles */
.education-section {
    margin-bottom: 25px;
}

.education-item {
    margin-bottom: 15px;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.degree {
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.education-date {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.university {
    font-size: 14px;
    color: #000;
    font-style: italic;
}

/* Certifications Styles */
.certifications-section {
    margin-bottom: 25px;
}

.certifications-list {
    margin-top: 15px;
}

.cert-item {
    margin-bottom: 8px;
}

.cert-title {
    font-size: 14px;
    color: #000;
    text-decoration: underline;
    text-decoration-color: #000;
}

.cert-title:hover {
    color: #0066cc;
    text-decoration-color: #0066cc;
}

/* References Styles */
.references-section {
    margin-bottom: 25px;
}

.references-text {
    font-size: 14px;
    color: #000;
    font-style: italic;
}

/* Testimonial Styles */
.testimonial-section {
    margin-bottom: 25px;
}

.testimonial-placeholder {
    font-size: 14px;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* Page Number */
.page-number {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 20px;
}

/* Print Styles */
@media print {
    /* Hide print button */
    button {
        display: none !important;
    }
    
    body {
        font-size: 11px;
        line-height: 1.1;
        margin: 0;
        padding: 0;
    }
    
    .resume-container {
        max-width: none;
        margin: 0;
        padding: 0.4in;
        min-height: auto;
        width: 100%;
    }
    
    .name {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .contact-info {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .section-title {
        font-size: 14px;
        margin-bottom: 8px;
        margin-top: 12px;
    }
    
    .introduction-content p {
        font-size: 11px;
        line-height: 1.2;
        margin-bottom: 8px;
    }
    
    .skills-content {
        margin-top: 8px;
    }
    
    .skill-category {
        margin-bottom: 6px;
    }
    
    .skill-category-title {
        font-size: 11px;
        margin-right: 6px;
    }
    
    .skill-items-text {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .company-name {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .position {
        font-size: 11px;
    }
    
    .date {
        font-size: 10px;
    }
    
    .key-achievements {
        margin-top: 6px;
    }
    
    .achievements-title {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .achievements-list {
        margin-left: 15px;
    }
    
    .achievements-list li {
        font-size: 10px;
        line-height: 1.1;
        margin-bottom: 2px;
    }
    
    .education-item {
        margin-bottom: 8px;
    }
    
    .degree {
        font-size: 11px;
    }
    
    .education-date {
        font-size: 10px;
    }
    
    .university {
        font-size: 10px;
    }
    
    .cert-item {
        margin-bottom: 4px;
    }
    
    .cert-title {
        font-size: 10px;
    }
    
    .references-text {
        font-size: 10px;
    }
    
    .testimonial-placeholder {
        font-size: 10px;
    }
    
    .divider {
        margin: 8px 0;
    }
    
    .experience {
        margin-bottom: 12px;
        page-break-inside: avoid;
    }
    
    .education-item {
        page-break-inside: avoid;
    }
    
    .cert-item {
        page-break-inside: avoid;
    }
    
    .page-number {
        font-size: 9px;
        margin-top: 10px;
    }
    
    /* Optimize spacing for 2-page layout */
    .introduction-section {
        margin-bottom: 12px;
    }
    
    .skills-section {
        margin-bottom: 12px;
    }
    
    .employment-section {
        margin-bottom: 12px;
    }
    
    .education-section {
        margin-bottom: 12px;
    }
    
    .certifications-section {
        margin-bottom: 12px;
    }
    
    .references-section {
        margin-bottom: 8px;
    }
    
    .testimonial-section {
        margin-bottom: 8px;
    }
    
    /* Additional optimizations for 2-page fit */
    .header {
        margin-bottom: 12px;
    }
    
    .achievements-list li {
        margin-bottom: 1px;
    }
    
    .skill-category {
        margin-bottom: 4px;
    }
    
    /* Ensure content fits in 2 pages */
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    /* Force page breaks if needed */
    .employment-section {
        page-break-before: auto;
    }
    
    .education-section {
        page-break-before: auto;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .resume-container {
        padding: 20px;
        max-width: 100%;
    }
    
    .name {
        font-size: 20px;
    }
    
    .contact-info {
        font-size: 12px;
    }
    
    .position-date {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .education-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .skill-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .skill-category-title {
        margin-bottom: 5px;
    }
}
