/* Styles spécifiques au CV principal */


/* Titres de section */

h2 {
    font-family: Arial, sans-serif;
    font-weight: 700;
    /* gras */
    margin-top: 28px;
    margin-bottom: 10px;
    position: relative;
}

h2::after {
    content: "";
    position: absolute;
    left: 0%;
    right: 5%;
    bottom: -4px;
    /* espace sous le texte */
    height: 2px;
    background: #808080;
    /* gris */
    border-radius: 2px;
}


/* Optionnel: première lettre capitale plus grande (commenter si non désiré) */


/* h2::first-letter { font-size: 115%; } */


/* ===== Styles pour l'organisation des rubriques du CV ===== */

#cv-sections-config {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 30px 0;
    border: 2px solid #e0e0e0;
    transition: box-shadow 0.3s ease;
}

#cv-sections-config h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.3em;
    margin-bottom: 15px;
}

#cv-sections-config small {
    display: block;
    margin-top: 15px;
    color: #666;
    font-style: italic;
    text-align: center;
}

#cv-sections-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 400px;
    position: relative;
}

.cv-section-block {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: move;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    will-change: transform;
    min-height: 56px;
}

.cv-section-block::before {
    content: "⠿⠿";
    font-size: 18px;
    color: #999;
    line-height: 1;
    letter-spacing: -2px;
    transition: color 0.2s ease;
}

.cv-section-block:hover::before {
    color: #4caf50;
}

.cv-section-block:hover {
    border-color: #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.cv-section-block.dragging {
    opacity: 0.5 !important;
    transform: rotate(2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    cursor: grabbing;
}

.cv-section-block.drag-over {
    border-color: #2196F3;
    border-style: dashed;
    background: #e3f2fd;
}

.cv-section-block.inactive {
    opacity: 0.5;
    background: #f5f5f5;
}

.cv-section-block.inactive label {
    text-decoration: line-through;
    color: #999;
}

.cv-section-block input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4caf50;
}

.cv-section-block label {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: move;
    user-select: none;
    margin: 0;
}

.cv-section-block:active {
    cursor: grabbing;
}


/* Animation de placement */

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cv-section-block {
    animation: slideIn 0.3s ease;
}


/* Success feedback */

#cv-sections-config.success {
    box-shadow: 0 0 0 3px #4caf50 !important;
}


/* Zones de drop entre les éléments */

.cv-drop-zone {
    min-height: 50px;
    height: 50px;
    margin: 8px 0;
    padding: 0;
    background: white;
    border: 2px dashed #2196F3;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: block;
    position: relative;
    box-sizing: border-box;
    opacity: 0.6;
}

.cv-drop-zone span {
    display: none !important;
    visibility: hidden !important;
}

.cv-drop-zone:hover,
.cv-drop-zone.active {
    opacity: 1;
    background: #e3f2fd;
    border-color: #1976D2;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.cv-drop-zone.active {
    animation: dropZonePulse 0.6s ease-in-out infinite;
}

@keyframes dropZonePulse {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
        border-color: #2196F3;
        background: white;
    }
    50% {
        box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
        border-color: #1976D2;
        background: #e3f2fd;
    }
}


/* État de drag amélioré */

.cv-section-block.dragging {
    opacity: 0.4 !important;
    transform: scale(0.95) rotate(1deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    cursor: grabbing !important;
    border-color: #2196F3;
    z-index: 1000;
    pointer-events: none;
    background: #f0f0f0;
}


/* Supprimer les anciens styles de placeholder */

.cv-section-placeholder {
    display: none;
}

.cv-section-block.drop-indicator,
.cv-section-block.drag-over {
    display: none;
}

/* ===== Styles pour la page principale du CV ===== */

body {
    font-family: Tahoma, Verdana, Segoe UI, sans-serif;
    background: linear-gradient(120deg, #e9f0fa 0%, #f6f7fb 100%);
    margin: 0;
    min-height: 100vh;
}

.main-content {
    padding-top: 40px;
    padding-bottom: 40px;
}

.cv-container {
    background: #fff;
    max-width: 900px;
    margin: 0px auto 0px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 40px 32px;
}

h1 { 
    margin: 0 0 8px; 
}

h2 {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 35px;
}

h2:before {
    content: '➢';
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
    transform: rotate(90deg);
}

h2.collapsed:before { 
    transform: rotate(0deg); 
}

h2:hover { 
    color: #0066cc; 
}

.section-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.section-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
}

.competence-categorie {
    margin-bottom: 15px;
}

ul {
    margin-block-start: 0.4em;
}

.cv-photo {
    max-width: 140px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.section-with-timeline {
    position: relative;
    padding-left: 30px;
}

.section-with-timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ddd;
}

.entry-row {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
    position: relative;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    background-color: #007bff;
    border-radius: 50%;
    position: absolute;
    left: -21px;
    top: 8px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #007bff;
    z-index: 1;
}

.timeline-svg {
    width: 16px;
    height: 16px;
    position: absolute;
    left: -24px;
    top: 5px;
    background-color: #fff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 0 0 2px #007bff;
    z-index: 1;
}

.entry-date-location {
    width: 18%;
    text-align: left;
    padding-right: 15px;
    font-size: 0.9em;
    color: #666;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 6px;
    padding-left: 8px;
}

.entry-date { 
    margin-bottom: 2px; 
}

.entry-location {
    margin-left: 12px;
    font-size: 0.85em;
}

.entry-content {
    flex: 1;
    padding-top: 0px;
    padding-left: 0px;
}

/* ===== Styles pour l'impression ===== */

@media print {
    /* Marges de page avec espace pour numérotation */
    @page {
        margin: 1.5cm 1cm 2cm 1cm;
        size: A4;
    }
    
    /* Forcer l'impression des couleurs */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        max-height: none !important;
    }
    
    /* Reset body et conteneurs */
    body { 
        background: none !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11pt !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    /* Réduction de la police */
    html {
        font-size: 90% !important;
    }
    
    h1 {
        font-size: 1.8em !important;
    }
    
    h2 {
        font-size: 1.3em !important;
    }
    
    strong {
        font-size: 1em !important;
    }
    
    li, p, div, span {
        font-size: 0.95em !important;
    }
    
    .cv-container {
        box-shadow: none !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        max-height: none !important;
        height: auto !important;
    }
    
    /* En-tête avec photo et infos */
    .cv-container > table:first-child {
        margin-bottom: 0.5cm;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    .cv-photo { 
        box-shadow: none !important; 
    }
    
    /* Sections du CV - PEUVENT se diviser sur plusieurs pages */
    .no-break-print {
        page-break-inside: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0.5cm !important;
        padding: 0 !important;
        padding-top: 0 !important;
        position: relative !important;
        clear: both !important;
        background: transparent !important;
    }
    
    /* Titres de section - NE PEUVENT PAS être seuls en bas de page */
    h2 {
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
        page-break-before: auto !important;
        padding-left: 0 !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0.4cm !important;
        clear: both !important;
        background: transparent !important;
    }
    
    h2:before { 
        display: none !important; 
    }
    
    /* Contenu des sections - PEUT se diviser */
    .section-content {
        orphans: 2;
        widows: 2;
        position: relative !important;
        clear: both !important;
        background: transparent !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        max-height: none !important;
        height: auto !important;
    }
    
    .section-content.collapsed {
        max-height: none !important;
        opacity: 1 !important;
    }
    
    /* Projets individuels - NE PEUVENT PAS être coupés */
    .projet-item,
    .interet-item,
    .competence-categorie,
    .entry-row,
    #content-projets > div,
    #content-interets > div,
    #content-competences > div {
        page-break-inside: avoid !important;
        margin-bottom: 0.3cm;
        position: relative !important;
        background: transparent !important;
    }
    
    /* Lignes de timeline */
    .entry-row {
        margin-bottom: 0.25cm;
    }
    
    /* Listes */
    ul, li {
        orphans: 2;
        widows: 2;
    }
    
    /* Timeline verticale */
    .section-with-timeline::before { 
        background-color: #999 !important;
        content: '' !important;
        display: block !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
    
    /* Points de timeline */
    .timeline-dot {
        background-color: #333 !important;
        box-shadow: 0 0 0 2px #333 !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
    
    .timeline-svg { 
        box-shadow: 0 0 0 2px #333 !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
    
    /* Masquer les éléments non imprimables */
    .no-print { 
        display: none !important; 
    }
}

/* ===== Styles pour les éléments du CV ===== */

/* Styles pour le tableau d'en-tête */
.cv-container > table td.header-center {
    text-align: center;
}

.cv-container > table td.header-info {
    padding-top: 0;
    text-align: center;
}

.cv-container > table td.header-photo {
    width: 160px;
    text-align: right;
    vertical-align: top;
}

/* Styles pour les images icônes */
.icon-img {
    height: 1em;
    vertical-align: middle;
}

/* Styles pour les listes d'informations personnelles */
.info-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Styles pour les liens de projets */
.projet-link {
    text-decoration: none;
}

/* Styles pour les niveaux de compétences */
.competence-niveau {
    color: gray;
}

/* Styles pour les contenus indentés */
.content-indent {
    padding-left: 2em;
    margin-top: 0.3em;
}

/* Style pour l'en-tête inline des informations personnelles */
.header-info-inline {
    display: inline-block;
    text-align: left;
}

/* Styles pour les éléments de projet et d'intérêt */
.projet-item {
    margin-bottom: 10px;
}

.interet-item {
    margin-bottom: 10px;
}

/* ===== Styles pour la page 404 ===== */

.error-404-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.error-404-title {
    font-size: 4rem;
    margin: 0;
    color: #e74c3c;
}

.error-404-subtitle {
    font-size: 2rem;
    margin: 20px 0;
    color: #333;
}

.error-404-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.error-404-route {
    color: #999;
    margin-bottom: 30px;
}

.error-404-code {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    color: #e74c3c;
}

.error-404-link {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #2a3a5e 0%, #3a4a6e 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s;
}

/* ===== Styles Responsive pour Mobile ===== */

@media screen and (max-width: 768px) {
    /* Ajustements généraux */
    body {
        font-size: 14px;
    }
    
    .main-content {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .cv-container {
        padding: 20px 16px;
        border-radius: 0;
        margin: 0;
        box-shadow: none;
    }
    
    /* Titres */
    h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    h2 {
        font-size: 1.2rem;
        padding-left: 25px;
        margin-top: 20px;
    }
    
    h2:before {
        font-size: 0.9em;
    }
    
    /* En-tête du CV - Réorganisation en colonne */
    .cv-container > table {
        display: block;
        width: 100%;
    }
    
    .cv-container > table thead,
    .cv-container > table tbody,
    .cv-container > table tr {
        display: block;
        width: 100%;
    }
    
    .cv-container > table td {
        display: block;
        width: 100% !important;
        text-align: center !important;
        padding: 10px 0 !important;
    }
    
    .cv-container > table td.header-center {
        order: 2;
    }
    
    .cv-container > table td.header-info {
        order: 3;
    }
    
    .cv-container > table td.header-photo {
        order: 1;
        text-align: center !important;
        margin-bottom: 15px;
    }
    
    /* Photo en mode mobile */
    .cv-photo {
        max-width: 120px;
        margin: 0 auto;
    }
    
    /* Liste d'informations */
    .header-info-inline {
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .info-list {
        text-align: left;
        display: inline-block;
    }
    
    .info-list li {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    /* Timeline et entrées */
    .section-with-timeline {
        padding-left: 20px;
    }
    
    .section-with-timeline::before {
        left: 9px;
    }
    
    .entry-row {
        flex-direction: column;
        margin-bottom: 20px;
        padding-left: 0;
    }
    
    .timeline-dot {
        left: -16px;
        top: 5px;
    }
    
    .timeline-svg {
        left: -19px;
        top: 2px;
    }
    
    .entry-date-location {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 8px;
        font-size: 0.85em;
    }
    
    .entry-location {
        margin-left: 0;
        margin-top: 3px;
    }
    
    .entry-content {
        width: 100%;
        padding-left: 0;
    }
    
    /* Contenus indentés */
    .content-indent {
        padding-left: 1em;
        margin-top: 0.5em;
        font-size: 0.95em;
    }
    
    /* Compétences */
    .competence-categorie {
        margin-bottom: 12px;
    }
    
    .competence-categorie ul {
        padding-left: 20px;
    }
    
    /* Projets et intérêts */
    .projet-item,
    .interet-item {
        margin-bottom: 15px;
        font-size: 0.95em;
    }
    
    /* Page 404 */
    .error-404-container {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .error-404-title {
        font-size: 3rem;
    }
    
    .error-404-subtitle {
        font-size: 1.5rem;
    }
    
    .error-404-text {
        font-size: 1rem;
    }
    
    .error-404-code {
        display: block;
        margin-top: 10px;
        word-break: break-all;
    }
    
    /* Configuration des sections */
    #cv-sections-config {
        padding: 15px;
        margin: 20px 0;
    }
    
    .cv-section-block {
        padding: 12px 15px;
        gap: 10px;
        min-height: auto;
    }
    
    .cv-section-block label {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    /* Ajustements pour très petits écrans */
    body {
        font-size: 13px;
    }
    
    .cv-container {
        padding: 15px 12px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.1rem;
        padding-left: 20px;
    }
    
    .cv-photo {
        max-width: 100px;
    }
    
    .info-list li {
        font-size: 0.85em;
    }
    
    .entry-row {
        margin-bottom: 15px;
    }
    
    .content-indent {
        padding-left: 0.5em;
        font-size: 0.9em;
    }
    
    .icon-img {
        height: 0.9em;
    }
    
    .error-404-title {
        font-size: 2.5rem;
    }
    
    .error-404-subtitle {
        font-size: 1.3rem;
    }
    
    .error-404-link {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

@media screen and (max-width: 360px) {
    /* Ajustements pour écrans très étroits */
    .cv-container {
        padding: 10px 8px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    .cv-photo {
        max-width: 90px;
    }
    
    .timeline-dot,
    .timeline-svg {
        transform: scale(0.8);
    }
}