:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-muted: #444444;
    --border-color: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Chakra Petch', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Highlighting */
mark.highlight {
    background-color: #fff176; /* Softer, less contrasting yellow */
    color: #000000;
    padding: 0 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* Actions Bar */
.actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
    padding: 12px 24px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 4px 4px 0px rgba(0,0,0,1);
    white-space: nowrap;
}

.download-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0,0,0,1);
}

.download-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px rgba(0,0,0,1);
}

/* CV Container */
.cv-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 40px 120px 40px;
    background-color: var(--bg-color);
}

.cv-header {
    margin-bottom: 50px;
    border-bottom: 4px solid var(--border-color);
    padding-bottom: 30px;
}

.name {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.title {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
}

.contact-info a {
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.contact-info a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--text-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.contact-info a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.separator {
    color: var(--text-muted);
}

/* Sections */
.cv-section {
    margin-bottom: 40px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background-color: var(--text-color);
}

.cv-section p {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.7;
    text-align: justify;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.skill-category {
    border: 2px solid var(--border-color);
    padding: 20px;
    position: relative;
    background: var(--bg-color);
    transition: transform 0.2s ease;
    page-break-inside: avoid;
    break-inside: avoid;
}

.skill-category:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
}

.skill-category h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    display: inline-block;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 4px 8px;
    position: absolute;
    top: -16px;
    left: 15px;
}

.skill-category p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-top: 10px;
    text-align: left;
}

/* Experience */
.experience-item {
    margin-bottom: 35px;
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--text-color);
    page-break-inside: avoid;
    break-inside: avoid;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.role-company {
    display: flex;
    flex-direction: column;
}

.experience-header h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.experience-header .company {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.experience-header .date {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    background-color: #f0f0f0;
    padding: 4px 10px;
    border: 1px solid var(--text-color);
}

.experience-list {
    list-style: none;
}

.experience-list li {
    font-size: 1.1rem;
    margin-bottom: 8px;
    position: relative;
    padding-left: 25px;
    line-height: 1.5;
    page-break-inside: avoid;
    break-inside: avoid;
}

.experience-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: var(--text-color);
}

/* Education */
.education-list {
    list-style: none;
}

.education-list li {
    font-size: 1.15rem;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    border-left: 2px solid var(--text-color);
    page-break-inside: avoid;
    break-inside: avoid;
}

.education-list strong {
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.education-list .edu-details {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .cv-container {
        padding: 60px 30px;
    }
    .name { font-size: 3rem; }
    .title { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    .cv-container {
        padding: 40px 20px;
    }
    .name { font-size: 2.5rem; }
    .title { font-size: 1.4rem; }
    .experience-header { flex-direction: column; align-items: flex-start; gap: 5px; }
    .experience-header .date { margin-top: 5px; }
    .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .cv-container {
        padding: 30px 15px;
    }
    .name { font-size: 2rem; margin-bottom: 5px; }
    .title { font-size: 1.2rem; margin-bottom: 15px; }
    .contact-info { 
        flex-direction: column; 
        align-items: flex-start;
        gap: 8px;
    }
    .contact-info .separator { 
        display: none; 
    }
    .section-title { font-size: 1.4rem; margin-bottom: 20px; }
    .cv-section p { font-size: 1.05rem; }
    .experience-header h4 { font-size: 1.25rem; }
    .experience-list li { font-size: 1.05rem; }
}

/* PDF Generation Specific Overrides - Tightened slightly to ensure it fits onto exactly 2 pages */
.generating-pdf {
    padding: 10px !important;
    max-width: 100% !important;
}

.generating-pdf .name { font-size: 3rem; margin-bottom: 5px; }
.generating-pdf .title { font-size: 1.5rem; margin-bottom: 15px; }
.generating-pdf .cv-header { margin-bottom: 30px; padding-bottom: 15px; }
.generating-pdf .cv-section { margin-bottom: 25px; }
.generating-pdf .section-title { margin-bottom: 15px; font-size: 1.6rem; }
.generating-pdf .experience-item { margin-bottom: 25px; }
.generating-pdf .experience-header h4 { font-size: 1.25rem; }
.generating-pdf .experience-header .company { font-size: 1rem; }
.generating-pdf .experience-header .date { font-size: 1rem; padding: 2px 8px; }
.generating-pdf .experience-list li { font-size: 1rem; margin-bottom: 6px; line-height: 1.4; }
.generating-pdf .cv-section p { font-size: 1.05rem; line-height: 1.5; }
.generating-pdf .skill-category { padding: 15px; }
.generating-pdf .skill-category h4 { font-size: 1rem; top: -14px; }
.generating-pdf .skill-category p { font-size: 1rem; margin-top: 5px; }
.generating-pdf .education-list li { margin-bottom: 10px; font-size: 1.05rem; }

/* Print Styles */
@media print {
    .actions {
        display: none !important;
    }
    
    body {
        background-color: #ffffff;
    }
    
    .cv-container {
        padding: 0;
        max-width: 100%;
        background-color: transparent;
    }
    
    .skills-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .skill-category {
        flex: 1 1 30%;
    }
    
    /* Ensure yellow highlights print nicely */
    mark.highlight {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
