/* ========================================
   CV HTML/CSS - Styles Pixel-Perfect PDF
   ======================================== */

/* === RESET & BASE === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === PAGE SETUP (Print) === */
@page {
    size: A4 portrait;
    margin: 0;
}

/* === VARIABLES === */
:root {
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #888888;
    --color-border: #e0e0e0;
    --color-bg: #ffffff;
    --sidebar-width: 70mm;
    --main-width: 140mm;
    --page-padding: 12mm;
    --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    --font-name: 'Playfair Display', Georgia, serif;
}

/* === BODY === */
html,
body {
    font-family: var(--font-body);
    font-size: 9pt;
    line-height: 1.4;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ========================================
   NAVIGATION CONTROLS (No Print)
   ======================================== */
.cv-controls {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    pointer-events: none;
}

.cv-controls>* {
    pointer-events: auto;
}

/* Tabs Container - Glassmorphism Frame */
.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Tab Buttons */
.tab-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: #333;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Download Button */
.download-btn {
    position: fixed;
    top: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
}

.download-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.download-btn svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   CV PAGE CONTAINER
   ======================================== */
.cv-page {
    display: none;
}

.cv-page.active {
    display: block;
}

.cv-container {
    /* A4 Dimensions */
    width: 210mm;
    min-height: 297mm;
    max-height: 297mm;

    /* Layout */
    display: flex;
    flex-direction: row-reverse;
    /* Main à droite, Sidebar à gauche visuellement */

    /* Fond et overflow */
    background: white;
    overflow: hidden;

    /* Centrage écran */
    margin: 0 auto;
}

/* ========================================
   SIDEBAR (Left column visually)
   ======================================== */
.cv-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding: var(--page-padding);
    padding-right: 8mm;
    border-right: 1px solid var(--color-border);
}

/* Photo Container */
.photo-container {
    width: 48mm;
    height: 48mm;
    margin: 0 auto 10mm auto;
    border-radius: 50%;
    overflow: hidden;
    /* border: 2px solid var(--color-border); Removed border as requested */
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 8mm;
}

.sidebar-section h2 {
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5pt;
    color: var(--color-text);
    margin-bottom: 4mm;
    padding-bottom: 2mm;
    border-bottom: 1px solid var(--color-border);
}

/* Contact List */
.contact-list {
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 3mm;
    margin-bottom: 3mm;
    font-size: 8pt;
    line-height: 1.4;
    color: var(--color-text);
}

.contact-list .icon {
    width: 12pt;
    height: 12pt;
    flex-shrink: 0;
    stroke: var(--color-text);
    margin-top: 1pt;
}

/* Skills List */
.skills-list {
    list-style: none;
}

.skills-list li {
    font-size: 8pt;
    color: var(--color-text);
    padding: 1.5mm 0;
    /* border-bottom: 1px dotted var(--color-border); Removed dotted spacer */
}

.skills-list li:last-child {
    border-bottom: none;
}

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

.education-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 8pt;
    color: var(--color-text);
    padding: 1.5mm 0;
}

.education-list .year {
    font-size: 7pt;
    color: var(--color-text-muted);
}

/* ========================================
   MAIN CONTENT (Right column visually)
   ======================================== */
.cv-main {
    flex: 1;
    padding: var(--page-padding);
    padding-left: 10mm;
}

/* Header */
.cv-header {
    margin-bottom: 6mm;
    padding-bottom: 5mm;
    border-bottom: 1px solid var(--color-border);
}

.name {
    font-family: var(--font-name);
    font-weight: 400;
    font-style: italic;
    line-height: 1.1;
    margin-bottom: 2mm;
}

.name-first {
    display: inline-block;
    font-size: 32pt;
    margin-right: 5px;
}

.name-last {
    display: inline-block;
    font-size: 32pt;
}

.job-title {
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2pt;
    color: var(--color-text-light);
    margin-top: 3mm;
}

/* Sections */
.section {
    margin-bottom: 5mm;
}

.section h2 {
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2pt;
    color: var(--color-text);
    margin-bottom: 4mm;
}

.section.summary p {
    font-size: 8.5pt;
    line-height: 1.5;
    color: var(--color-text);
    text-align: justify;
    margin-bottom: 0;
}

.section.summary {
    margin-bottom: 6mm;
    padding-bottom: 5mm;
    border-bottom: 1px solid var(--color-border);
}

/* Job Items */
.job-item {
    margin-bottom: 4mm;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1mm;
}

.job-header h3 {
    font-size: 9pt;
    font-weight: 600;
    color: var(--color-text);
}

.job-header .date {
    font-size: 7.5pt;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.company {
    font-size: 8pt;
    color: var(--color-text-light);
    margin-bottom: 1.5mm;
}

.job-item ul {
    list-style: disc;
    padding-left: 5mm;
    margin-top: 1mm;
}

.job-item li {
    font-size: 8pt;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 0.5mm;
}

.old-jobs {
    font-size: 7.5pt;
    color: var(--color-text-light);
    margin-top: 2mm;
}

/* ========================================
   SCREEN STYLES
   ======================================== */
@media screen {
    html {
        background: #e5e7eb;
    }

    body {
        padding-top: 80px;
        /* Space for fixed nav */
        padding-bottom: 40px;
    }

    .cv-container {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
        margin-top: 20px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {

    html,
    body {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 0;
        background: white;
    }

    /* Force exact colors */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Hide navigation */
    .no-print {
        display: none !important;
    }

    /* Hide inactive CV pages */
    .cv-page:not(.active) {
        display: none !important;
    }

    .cv-page.active {
        display: block !important;
    }

    .cv-container {
        box-shadow: none;
        margin: 0;
    }

    /* Avoid page breaks */
    section,
    article,
    .job-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    h2,
    h3 {
        page-break-after: avoid;
        break-after: avoid;
    }
}

/* ========================================
   RESPONSIVE (Mobile)
   ======================================== */
@media screen and (max-width: 900px) {
    .cv-controls {
        top: 15px;
    }

    .download-btn {
        top: 15px;
        right: 15px;
        padding: 8px 14px;
        font-size: 11px;
    }

    body {
        padding-top: 80px;
    }
}

@media screen and (max-width: 600px) {
    .cv-container {
        width: 100%;
        max-height: none;
        flex-direction: column;
    }

    .cv-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 20px;
    }

    .cv-main {
        padding: 20px;
    }

    .photo-container {
        width: 120px;
        height: 120px;
    }

    .name-first,
    .name-last {
        font-size: 28pt;
    }

    .job-header {
        flex-direction: column;
        gap: 2px;
    }

    .tabs {
        flex-direction: column;
        width: 100%;
    }

    .tab-btn {
        padding: 12px 16px;
    }
}