:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-main: #ffffff;
    --bg-sidebar: #f0f4f8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: #cbd5e1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

/* ============================================
   STRUCTURE PRINCIPALE A4
   ============================================ */

.cv-container {
    max-width: 210mm;
    min-height: 296mm;
    margin: 2rem auto;
    background-color: var(--bg-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* HEADER */
.cv-header {
    background-color: var(--primary);
    color: white;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 140px;
    flex-shrink: 0;
}

.header-content h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.header-content h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
}

.header-image {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.4);
    transform-origin: center 0%;
}

/* ============================================
   CORPS : DEUX COLONNES PLEINE HAUTEUR
   ============================================ */

.cv-body {
    display: flex;
    flex: 1;
    /* Prend TOUT l'espace restant sous le header */
    min-height: 0;
    /* Nécessaire pour que flex: 1 fonctionne correctement */
}

.cv-sidebar {
    width: 31%;
    min-height: 100%;
    background-color: var(--bg-sidebar);
    border-right: 1px solid #e2e8f0;
    padding: 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-section {
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1.18rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.6rem;
    letter-spacing: 1.5px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.4rem;
}

.sidebar-section p {
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.contact-list,
.skills-list,
.divers-list {
    list-style: none;
}

.contact-list li {
    font-size: 0.98rem;
    margin-bottom: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    overflow-wrap: break-word;
    word-break: normal;
}

.contact-list a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.contact-list a:hover {
    color: var(--primary);
}

.contact-list li i {
    color: var(--primary);
    width: 18px;
    font-size: 1.02rem;
    text-align: center;
    flex-shrink: 0;
}

.skills-list li,
.divers-list li {
    font-size: 0.98rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 1.1rem;
    line-height: 1.45;
}

.skills-list li::before,
.divers-list li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
    font-size: 1.22rem;
    line-height: 1.2;
}

/* ============================================
   COLONNE PRINCIPALE
   ============================================ */

.cv-main {
    flex: 1;
    padding: 1rem 2.2rem;
    display: flex;
    flex-direction: column;
}

.main-section {
    margin-bottom: 0.8rem;
}

.main-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.3rem;
}

.timeline-item {
    margin-bottom: 0.6rem;
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid var(--primary-light);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.timeline-header h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

.timeline-company {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.timeline-subtitle {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}

.timeline-description {
    list-style: none;
    margin-top: 0.4rem;
}

.timeline-description li {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    position: relative;
    padding-left: 1.1rem;
    line-height: 1.35;
}

.timeline-description li::before {
    content: "▹";
    color: var(--primary);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9rem;
}

.timeline-description b {
    color: var(--text-color);
    font-weight: 600;
}

.horizontal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.horizontal-list span {
    background-color: #f1f5f9;
    color: var(--text-main);
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.skill-box {
    background-color: #f1f5f9;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    color: var(--text-main);
}

.skill-box b {
    color: var(--primary);
    font-weight: 600;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.timeline-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.2rem;
}

/* BOUTON FLOTTANT PDF */
.floating-pdf-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-pdf-btn:hover {
    transform: scale(1.05);
    background-color: #1d4ed8;
}

/* ============================================
   IMPRESSION PDF
   ============================================ */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html {
        font-size: 14.5px !important;
    }

    body {
        margin: 0;
        padding: 0;
        background-color: white;
    }

    .floating-pdf-btn {
        display: none !important;
    }

    .cv-container {
        width: 100%;
        min-height: 297mm;
        margin: 0 !important;
        box-shadow: none;
        border: none;
    }
}