/* ========================================
   PROFESSIONAL CV STYLESHEET
   Matching Reference Format (Paul Cloete CV)
   ======================================== */

/* CSS Variables */
:root {
    --color-navy: #002060;
    --color-slate-blue: #4F81BD;
    --color-light-blue: #B8CCE4;
    --color-text: #000000;
    --color-white: #ffffff;
    --color-gray: #666666;
    --color-border: #95B3D7;
    --color-green: #2E7D32;
    --color-red: #C62828;

    --font-primary: 'Open Sans', Calibri, Arial, sans-serif;

    --page-width: 210mm;
    --page-height: 297mm;
    --page-margin: 0;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 11.5pt;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: #e0e0e0;
    line-height: 1.4;
}

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

a:hover {
    text-decoration: underline;
}

/* CV Container */
.cv-container {
    max-width: var(--page-width);
    margin: 20px auto;
}

/* Page Styles */
.page {
    width: var(--page-width);
    min-height: var(--page-height);
    background: var(--color-white);
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* ========================================
   PAGE 1: Two-Column Layout
   ======================================== */
.page-1 {
    display: grid;
    grid-template-columns: 70mm 140mm;
}

/* Sidebar */
.sidebar {
    background: var(--color-slate-blue);
    color: var(--color-white);
    padding: 15mm 5mm 20mm 8mm;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 13pt;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-white);
}

/* Education Items */
.education-item {
    margin-bottom: 12px;
}

.education-degree {
    font-size: 10pt;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--color-white);
}

.education-school {
    font-size: 8.5pt;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1px;
}

.education-date {
    font-size: 8pt;
    color: rgba(255, 255, 255, 0.75);
}

.education-detail {
    font-size: 7.5pt;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
    line-height: 1.3;
}

/* Skill Groups in Sidebar */
.skill-group {
    margin-bottom: 10px;
}

.skill-label {
    font-size: 8.5pt;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 2px;
}

.skill-items {
    font-size: 8pt;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Main Content */
.main-content {
    padding: 0;
}

/* Header */
.header {
    background: var(--color-navy);
    color: var(--color-white);
    padding: 12mm 10mm;
}

.name {
    font-size: 26pt;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 11pt;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.contact-list {
    list-style: none;
    font-size: 9pt;
}

.contact-list li {
    margin-bottom: 3px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.contact-list .bullet {
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.contact-list a {
    color: var(--color-light-blue);
}

/* Content Sections */
.content-section {
    padding: 10px 10mm;
    border-bottom: 1px solid #eee;
}

.content-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 13pt;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 8px;
}

.section-text {
    font-size: 10pt;
    line-height: 1.55;
    margin-bottom: 8px;
    text-align: justify;
}

/* Career Summary Table */
.career-summary {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    margin-top: 5px;
}

.career-summary th {
    background: var(--color-navy);
    color: var(--color-white);
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
}

.career-summary td {
    padding: 5px 8px;
    border-bottom: 1px solid #ddd;
}

.career-summary tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* ========================================
   PAGE 2-4: Single Column Layout
   ======================================== */
.page-2,
.page-3,
.page-4 {
    padding: 12mm 12mm;
}

.page-title {
    font-size: 15pt;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--color-slate-blue);
}

.matrix-note {
    font-size: 8.5pt;
    color: var(--color-gray);
    font-style: italic;
    margin-bottom: 10px;
}

/* Skill Matrix Table */
.skill-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
}

.skill-matrix th {
    background: var(--color-navy);
    color: var(--color-white);
    padding: 7px 8px;
    text-align: left;
    font-weight: 600;
}

.skill-matrix td {
    padding: 5px 8px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.skill-matrix .category-name {
    background: var(--color-light-blue);
    font-weight: 600;
    color: var(--color-navy);
    vertical-align: top;
    width: 100px;
}

.skill-matrix .category-row td:first-child {
    border-top: 2px solid var(--color-slate-blue);
}

.skill-matrix .center {
    text-align: center;
}

.skill-matrix .level {
    text-align: center;
}

/* Level Dots */
.level-dots {
    display: inline-flex;
    gap: 3px;
    font-size: 12px;
    letter-spacing: 2px;
}

.level-dots .dot {
    display: inline-block;
}

.level-dots .dot.filled {
    color: var(--color-navy);
}

.level-dots .dot.empty {
    color: #ddd;
}

.active-yes {
    color: var(--color-green);
    font-weight: 600;
}

.active-no {
    color: var(--color-gray);
}

/* Experience Items */
.experience-item {
    margin-bottom: 18px;
    page-break-inside: avoid;
}

.experience-header {
    margin-bottom: 6px;
}

.experience-header .job-title {
    font-size: 11pt;
    font-weight: 700;
    color: var(--color-navy);
    display: inline;
}

.experience-header .company {
    font-size: 10pt;
    color: var(--color-slate-blue);
    font-weight: 600;
    margin-left: 8px;
}

.experience-header .date {
    float: right;
    font-size: 9pt;
    color: var(--color-gray);
    font-weight: 500;
}

.experience-role {
    font-size: 9pt;
    color: var(--color-gray);
    margin-bottom: 8px;
    font-style: italic;
}

.experience-role strong {
    font-style: normal;
    color: var(--color-text);
}

.experience-bullets {
    list-style: none;
    font-size: 9.5pt;
    padding-left: 0;
}

.experience-bullets li {
    margin-bottom: 6px;
    position: relative;
    padding-left: 14px;
    line-height: 1.45;
}

.experience-bullets li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-slate-blue);
    font-weight: 700;
}

.experience-bullets li strong {
    color: var(--color-navy);
}

.tech-stack {
    font-size: 8.5pt;
    color: var(--color-gray);
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 8px;
}

.tech-stack strong {
    color: var(--color-navy);
}

/* References */
.references {
    margin-top: 25px;
    text-align: center;
    color: var(--color-gray);
    font-size: 9.5pt;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html {
        font-size: 10pt;
    }

    body {
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cv-container {
        margin: 0;
        max-width: none;
    }

    .page {
        box-shadow: none;
        margin: 0;
        page-break-after: always;
    }

    .page:last-child {
        page-break-after: auto;
    }

    .sidebar {
        background: var(--color-slate-blue) !important;
    }

    .header {
        background: var(--color-navy) !important;
    }

    .skill-matrix th,
    .career-summary th {
        background: var(--color-navy) !important;
    }

    .skill-matrix .category-name {
        background: var(--color-light-blue) !important;
    }

    .active-yes {
        color: var(--color-green) !important;
    }
}

/* ========================================
   RESPONSIVE (Screen Only)
   ======================================== */
@media screen and (max-width: 800px) {
    .cv-container {
        max-width: 100%;
    }

    .page {
        width: 100%;
        min-height: auto;
    }

    .page-1 {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 20px;
    }

    .header {
        padding: 20px;
    }

    .page-2,
    .page-3,
    .page-4 {
        padding: 20px;
    }

    .experience-header .date {
        float: none;
        display: block;
        margin-top: 5px;
    }

    .skill-matrix {
        font-size: 8pt;
    }
}