@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
        
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f8f9fa;
    padding: 20px;
}
        
.cv-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}
        
.cv-content {
    padding: 40px;
}
        
h1 {
    text-align: center;
    font-size: 1.4em; /* slightly smaller title */
    font-weight: 700; /* bold title */
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1a365d;
    margin-bottom: 8px;
    letter-spacing: 1px;
    border-bottom: 3px solid #1a365d;
    padding-bottom: 10px;
    display: inline-block;
    width: 100%;
}

/* Ensure certain elements force a page break when printing (PDF generation) */
.page-break-before {
    page-break-before: always;
    break-before: page;
}

/* Prevent tables from splitting across pages */
table, thead, tbody, tr, td, th {
    page-break-inside: avoid;
}
        
h2 {
    text-align: center;
    font-size: 1.0em;
    color: #2b6cb0;
    margin-bottom: 25px;
    font-weight: 400;
    line-height: 1.4;
}
        
h3 {
    color: #1a365d;
    font-size: 1.2em;
    margin: 10px 0 6px 0;
    padding-bottom: 3px;
    border-bottom: 2px solid #2b6cb0;
    font-weight: 600;
}
        
.contact-info {
    text-align: center;
    background: #f1f5f9;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #2b6cb0;
}
        
.contact-info strong {
    color: #1a365d;
    font-weight: 500;
}
        
table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
        
th {
    background: #1a365d;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
        
td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    font-size: 14px;
}
        
tr:hover td {
    background-color: #f8fafc;
}
        
tr:last-child td {
    border-bottom: none;
}
        
tr:nth-child(even) td {
    background-color: #fafbfc;
}
        
.experience-table th {
    background: #1a365d;
}
        
.skills-table th {
    background: #1a365d;
}
        
.languages-table th {
    background: #1a365d;
}
        
.certifications-table th {
    background: #1a365d;
    color: white;
}
        
.publications-table th {
    background: #1a365d;
}
        
strong {
    font-weight: 600;
    color: #2d3748;
}
        
em {
    font-style: italic;
    color: #4a5568;
    background: #f7fafc;
    padding: 1px 4px;
    border-radius: 3px;
}
        
.badge-expert {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
        
.badge-advanced {
    background: linear-gradient(135deg, #2b6cb0 0%, #3182ce 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
        
.badge-intermediate {
    background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
        
hr {
    border: none;
    height: 1px;
    background: linear-gradient(135deg, #2b6cb0 0%, #3182ce 100%);
    margin: 20px 0;
}
        
ul {
    margin: 10px 0;
    padding-left: 20px;
}
        
li {
    margin-bottom: 6px;
    font-size: 14px;
}
        
li::marker {
    color: #2b6cb0;
}
        
.description-text {
    font-size: 13px;
    line-height: 1.5;
}
        
.experience-section {
    margin: 8px 0;
}
        
.experience-item {
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 10px;
    overflow: hidden;
    border-left: 4px solid #2b6cb0;
}
        
.experience-header {
    background: #1a365d;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
        
.experience-title {
    font-weight: 600;
    font-size: 14px;
}
        
.experience-period {
    font-size: 12px;
    color: #e2e8f0;
}
        
.experience-org {
    font-size: 12px;
    color: #cbd5e0;
    margin-top: 2px;
}
        
.experience-content {
    padding: 10px 15px;
    font-size: 13px;
    line-height: 1.4;
}
        
.experience-content ul {
    margin: 8px 0;
    padding-left: 15px;
}
        
.experience-content li {
    margin-bottom: 3px;
    font-size: 12px;
}
        
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .cv-container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .cv-content {
        padding: 10mm;
    }
    
    h1 {
        font-size: 18pt;
        color: #1a365d !important;
        margin-bottom: 5pt;
    }
    
    h2 {
        font-size: 11pt;
        page-break-after: avoid;
        break-after: avoid;
        margin-bottom: 15pt;
    }
    
    h3 {
        font-size: 12pt;
        page-break-after: avoid;
        break-after: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
        margin: 8pt 0 4pt 0;
    }
    
    /* Prevent tables from being split across pages */
    table {
        page-break-inside: avoid;
        break-inside: avoid;
        font-size: 9pt;
        margin-bottom: 6pt;
    }
    
    /* Prevent table rows from being split */
    tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Keep thead with tbody */
    thead {
        display: table-header-group;
    }
    
    tbody {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Prevent experience items from being split */
    .experience-item {
        page-break-inside: avoid;
        break-inside: avoid;
        font-size: 9pt;
        margin-bottom: 6pt;
    }
    
    .experience-header {
        font-size: 10pt;
        page-break-after: avoid;
        break-after: avoid;
    }
    
    .experience-content {
        font-size: 9pt;
        padding: 8pt 12pt;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Keep sections together - wrap h3 + following content */
    .section-block {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .experience-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Contact info should not be split */
    .contact-info {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Prevent orphaned list items */
    ul, ol {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    li {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Prevent widows and orphans */
    p, li, td {
        orphans: 3;
        widows: 3;
    }
    
    @page {
        margin: 12mm;
        size: A4;
        /* Remove headers and footers */
        @top-left { content: ""; }
        @top-center { content: ""; }
        @top-right { content: ""; }
        @bottom-left { content: ""; }
        @bottom-center { content: counter(page) "/" counter(pages); }
        @bottom-right { content: ""; }
    }
    
    /* Hide any browser-generated headers/footers */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
        
@media (max-width: 768px) {
    .cv-content {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 6px;
    }
}
