*{ margin:0; padding:0; box-sizing:border-box; }

body{
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height:1.6;
  color:#333;
  background-color:#f5f5f5;
}

.cv-container{
  max-width:900px;
  margin:20px auto;
  background-color:#fff;
  box-shadow:0 0 20px rgba(0,0,0,0.1);
}

/* Header */
.header{
  background:linear-gradient(135deg,#2c3e50 0%,#3498db 100%);
  color:#fff;
  padding:40px;
  text-align:center;
}
.header h1{
  font-size:2.5em;
  margin-bottom:20px;
  letter-spacing:2px;
}

.contact-info{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:20px;
  font-size:0.95em;
}
.contact-info span{
  display:flex;
  align-items:center;
  gap:5px;
}

/* Icons */
.icon{ width:16px; height:16px; fill:white; }

/* Main Content */
.content{
  display:grid;
  grid-template-columns:1fr 2fr;
  gap:0;
}

/* Sidebar */
.sidebar{
  background-color:#f8f9fa;
  padding:30px;
}
.sidebar h2{
  color:#2c3e50;
  font-size:1.3em;
  margin-bottom:15px;
  border-bottom:2px solid #3498db;
  padding-bottom:5px;
}
.sidebar section{ margin-bottom:30px; }

.skill-category{ margin-bottom:20px; }
.skill-category h3{
  color:#3498db;
  font-size:1.1em;
  margin-bottom:10px;
}
.skill-category ul{ list-style:none; }
.skill-category li{
  padding:3px 0;
  font-size:0.9em;
  color:#555;
  padding-left:15px;
  position:relative;
}
.skill-category li:before{
  content:"▸";
  position:absolute;
  left:0;
  color:#3498db;
}

/* Main */
.main{ padding:30px; }
.main h2{
  color:#2c3e50;
  font-size:1.5em;
  margin-bottom:20px;
  border-bottom:2px solid #3498db;
  padding-bottom:5px;
}

.profile{
  background-color:#e8f4f8;
  padding:20px;
  border-radius:5px;
  margin-bottom:30px;
  font-style:italic;
  color:#555;
}

.experience-item{
  margin-bottom:25px;
  padding-bottom:25px;
  border-bottom:1px solid #eee;
}
.experience-item:last-child{ border-bottom:none; }

.job-header{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:10px;
}
.job-title{
  color:#2c3e50;
  font-weight:bold;
  font-size:1.1em;
}
.company{ color:#3498db; font-weight:normal; }
.date{ color:#666; font-size:0.9em; font-style:italic; }

.job-description{ margin-top:10px; }
.job-description ul{ list-style:none; padding-left:0; }
.job-description li{
  padding:3px 0;
  padding-left:20px;
  position:relative;
  color:#555;
}
.job-description li:before{
  content:"•";
  position:absolute;
  left:0;
  color:#3498db;
  font-weight:bold;
}

.education-item{ margin-bottom:20px; }
.education-title{ font-weight:bold; color:#2c3e50; }
.education-school{ color:#3498db; }

/* Points forts */
.highlights{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:15px;
  margin-top:15px;
}
.highlight-item{
  background-color:#f8f9fa;
  padding:15px;
  border-radius:5px;
  border-left:3px solid #3498db;
}
.highlight-item strong{ color:#2c3e50; }

/* Footer */
.footer{
  background-color:#2c3e50;
  color:#fff;
  padding:20px;
  text-align:center;
}
.footer-info{
  display:flex;
  justify-content:center;
  gap:30px;
  flex-wrap:wrap;
}

/* Bouton export (écran) */
.export-btn{
  position:fixed;
  top:16px;
  right:16px;
  z-index:9999;
  padding:10px 14px;
  border:none;
  border-radius:8px;
  background:#2c3e50;
  color:#fff;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,0.2);
  font-size:14px;
}
.export-btn:hover{ opacity:0.92; }

/* Responsive */
@media (max-width:768px){
  .content{ grid-template-columns:1fr; }
  .job-header{
    flex-direction:column;
    align-items:flex-start;
  }
  .highlights{ grid-template-columns:1fr; }
}

/* =========================
   Impression / PDF (A4)
   ========================= */
@page{
  size:A4;
  margin:0;
}

@media print{
  .export-btn{ display:none !important; }

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

  .cv-container{
    width:210mm;
    min-height:594mm; /* 2 pages A4 */
    margin:0;
    display:flex;
    flex-direction:column;
    box-shadow:none;
  }

  .header{
    padding:22px;
    break-after:avoid;
    page-break-after:avoid;
  }

  /* Remplace la grid par flex (meilleure pagination) */
  .content{
    display:flex !important;
    flex-direction:row;
    gap:0;
  }

  .sidebar{ width:35%; padding:22px; }
  .main{ width:65%; padding:22px; }

  /* IMPORTANT : on autorise les sections à se couper si nécessaire */
  section{
    break-inside:auto;
    page-break-inside:auto;
  }

  /* On évite juste les petites coupures moches */
  .experience-item,
  .education-item,
  .highlight-item{
    break-inside:avoid;
    page-break-inside:avoid;
  }


  .content{
    flex:1 1 auto;
  }

  .footer{
    margin-top:auto;
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
