body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 10pt;
    font-weight: 300;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; 
    box-sizing: border-box;
}

.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
}

.download-button-container {
  position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    text-align: center;
    padding: 10px 0;
    background-color: #2c3e50;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

#print-pdf-button {
  padding: 10px 20px;
  color: white;
  background-color: #3498db;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#print-pdf-button:hover {
  background-color: #2980b9;
  box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
#print-pdf-button:active {
  background-color: #2471a3;
  transform: translateY(0px);
  box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
}

.page-container {
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  margin: 0 auto;
  background-color: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  display: flex;
  box-sizing: border-box;
}
  
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: radial-gradient(circle, #203864, #263e6a, #2c4471, #324b77, #38517e);
  max-width: 55mm;
  height: 100%;
  padding-top: 5mm;
  gap: 7mm;
  padding-right: 5mm;
  padding-left: 5mm;
  box-sizing: border-box;
  color: white;
}

.sidebar-image {
  width: 70%; 
  max-width: 40mm;
  height: auto; 
  border-radius: 5%;
}

.sidebar-block {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

.sidebar-title {
  border-bottom: 1px solid white;
  padding-bottom: 1mm;
  margin-top:0px;
  font-size: 1.1em;
  margin-bottom: 2mm;
}

.sidebar-text {
  font-size: 0.9em; 
  line-height: 1.4;
  margin:0;
}
.sidebar-text ul {
    font-size: 1em;
}

#sidebar-competences-desktop .sidebar-text .sidebar-competence-subtitle {
  font-weight: 600; 
  font-size: 1.05em; 
  color: white; 
  margin-top: 10px; 
  margin-bottom: 2px; 
}

#sidebar-competences-desktop .sidebar-text .sidebar-competence-subtitle:first-of-type {
  margin-top: 0; 
}

#sidebar-competences-desktop .sidebar-text ul {
  margin-left: 6mm; 
  padding-left: 0; 
  list-style-position: outside;
}

.phone-only {
  display: none;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 3mm;
}

.sidebar-icon-link {
  display: flex; 
  align-items: center;
  text-decoration: none; 
  color: inherit; 
  padding-left: 0mm; 
  padding-right: 2mm;
}

.sidebar-icon-text {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 0.85em;
  word-break: break-all;
}
  
.icon {
  filter: invert(100%);
  width: 5mm;
  height: auto; 
  margin-right: 3mm;
  padding: 0;
  flex-shrink: 0;
}

.sidebar-icon-link:hover .icon {
  filter: invert(75%);
}
.sidebar-icon-link:hover .sidebar-icon-text {
   color: #cccccc; 
}

ul {
  display: flex;
  flex-direction: column;
  gap: 0.5mm;
  margin: 0 0 0 5mm;
  padding: 0;
  list-style-position: outside;
  font-size: 0.9em;
  line-height: 1.4;
}
.sidebar ul {
  margin-left: 4mm;
}

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap:35px;
  box-sizing: border-box;
  height: 100%;
}

.header {
  margin-top: 0;
  align-self: center; 
}
.header-h1 {
  color: #203864;
  font-size: 18pt;
  margin-bottom: 1mm;
  text-align: center;
}
.header-h2 {
  margin: 0px;
  font-size: 14pt;
  text-align: center;
  color: #333;
}
  
.content-block{
  width:100%;
}
.content-block:last-child {
    margin-bottom: 0;
}

.block-title{
  border-bottom: 1px solid #203864;
  color: #203864;
  padding-left: 2mm;
  padding-bottom: 1mm;
  margin: 0 0 3mm 0;
  font-size: 1.2em;
}

.block-experience{
 margin: 0 5mm 5mm 2.5mm;
  padding:0;
}

.experience-top{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-right:2mm;
  gap: 5mm;
}

.experience-definition{
  display: flex;
  flex-direction: column;
  margin-left: 1mm;
  padding: 0;
}
.experience-titre{
  margin: 0;
  padding: 0;
  font-size: 1em;
  font-weight: bold;
  margin-bottom: 0.5mm;
}
.experience-definition-subtitle{
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1mm;
  font-weight: bolder;
}
.experience-date{
  margin: 0;
  padding: 0;
}
.experience-entreprise{
  margin: 0;
  padding: 0;
  font-size: 1em;
  color: #203864;
}
.experience-lieu{
  margin: 0;
  padding: 0;
  font-size: 0.8em;
  font-style: italic;
}
.experience-img{
  max-height: 10mm; 
  width: auto;
  max-width: 15mm;
}

.block-experience ul {
  list-style-type: circle;
  margin: 1mm 0 0 8mm;
  font-size: 0.9em;
  line-height: 1.4;
}
.block-experience li::marker{
  color: #203864;
}
.block-experience:last-child {
  margin-bottom:0; 
}

.experience-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 65px;
}

.formation-lieu{
  margin: 1mm 0 0 1mm;
  padding: 0;
  font-size: 0.9em;
}

.block-competences{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 3mm; 
  margin-left:2.5mm;
}
.competence{
  margin:0px ;
  padding: 0;
  white-space:nowrap;
  flex: 1;
}
.competence:not(:last-child) {
  padding-right: 3mm;
  border-right: 1px solid #203864;
}

.competence h4{
  margin: 0 0 2mm 0;
  text-align: center;
  font-size: 1em;
  color: #203864;
}
.competence ul {
  font-size: 0.9em;
  line-height: 1.4;
  margin-left: 5mm;
}
.competence li::marker{
  color: #203864;
}

.link{
  text-decoration: none; 
  color: inherit;
}
.link:hover{
  text-decoration: underline;
}

input[type="checkbox"] {
    display: none;
}

#button {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 110px;
    height: 40px;
    border-radius: 20px;
    display: block;
    background-color: #002654;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
    margin: 0; 
}

#knob {
    width: 32px;
    height: 32px;
    top: 4px;
    left: 4px;
    background-color: #fff;
    position: absolute;
    border-radius: 50%;
    transition: 0.4s ease left, 0.4s ease background-color;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.flag-svg {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}
#french-flag { display: block; }
#english-flag { display: none; }

#language-text {
    font-size: 14px;
    left: 48px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-weight: bold;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    transition: color 0.4s ease, left 0.4s ease;
}

#language-toggle:checked + #button {
    background-color: #012169;
}

#language-toggle:checked + #button #knob {
    left: 74px; 
    background-color: #ffffff;
}
#language-toggle:checked + #button #knob #french-flag { display: none; }
#language-toggle:checked + #button #knob #english-flag { display: block; }

#language-toggle:checked + #button #language-text {
    left: 15px;
    color: #ffffff;
    transition: left 0.4s ease;
}


@media print {
  @page {
    size: A4 portrait;
    margin: 0mm;
  }
  html, body {
    width: 210mm;
    height: 297mm;
    margin: 0 !important;
    padding: 0 !important; 
    background-color: white !important;
    color: black !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .content {
    overflow-y: visible !important;
    margin-bottom: 0 !important;
  }
  .main-content-wrapper { padding: 0 !important; }
  .download-button-container { display: none !important; }
  .page-container {
    width: 210mm;
    height: 297mm;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    display: flex !important;
    box-sizing: border-box;
  }
  .sidebar-block, .content-block, .block-experience, .competence { page-break-inside: avoid; }
  h1, h2, h3, h4, p, li { 
    page-break-after: avoid;
    page-break-before: avoid; 
  }
  ul { page-break-inside: avoid; }
}

@media screen and (max-width: 800px) {
  body {
    background-color: white;
    padding-bottom: 80px;
  }

  .download-button-container {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    padding: 10px; 
    box-sizing: border-box;
    bottom: -1px;
  }

  #button {
      position: relative; 
      left: auto;
      top: auto;
      transform: none;
      margin: 0; 
  }

  #print-pdf-button {
      padding: 8px 12px;
      font-size: 12px;
      margin: 0; 
  }

  .main-content-wrapper {
      padding: 0; 
      background: white;
  }
  .page-container {
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0;
    flex-direction: column;
    box-shadow: none;
  }
  .content {
    overflow-y: visible;
    gap:10mm;
  }
  .header { 
    align-self: center;
    margin-bottom: 15px
  }
  .header-h1 {
    font-size: xx-large;
    margin-bottom: 0px;
  }
  .header-h2 {
    margin-top: 0px;
    font-size: x-large;
    margin-bottom:0px;
  }
  .phone-hide{ display: none; }
  .phone-only{ display: block !important; }
  .sidebar {
     display: flex;
      width: 100%;
      min-width: 0;
      height: auto;
      gap: 0mm;
      max-width: 100%;
  }
  .sidebar-image {
      display: block;
      width: 150px;
      max-width: 40%;
  }
  .sidebar-block {
      width: 90%;
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
      justify-content: center;
      position:static;
      top:auto;
  }
  .link-group{
    display: flex;
    flex-direction: row;
    margin: 10px 0;
    justify-content: space-evenly;
  }
  .sidebar-icon-link {
    padding: 5px 0; 
    margin: 0; 
    justify-content: flex-start; 
  }
  .icon{
    width:7mm;
    margin-right: 0mm;
  }
  .content-block .block-title {
    cursor: pointer;
    position: relative;
    padding-right: 35px; 
    display: block; 
    padding-left: 10px; 
    margin-left: 0;
    margin-right: 0;
  }
  .content-block .block-title::after {
    content: '+';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: bold;
    color: #203864;
    transition: transform 0.3s ease-out;
  }
  .content-block.active .block-title::after { content: '−'; }
  .content-block .collapsible-body {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease-out, 
                opacity 0.3s ease-out, 
                padding-top 0.4s ease-out, 
                padding-bottom 0.4s ease-out;
    box-sizing: border-box;
    padding: 0 10px;
  }
  .content-block.active .collapsible-body {
    opacity: 1;
    padding-top: 10px;    
    padding-bottom: 15px;   
  }
  .block-experience{
    margin:0 10px 30px 10px; 
    padding:0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .experience-left {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    margin-bottom: px;
  }
  .experience-date {
    margin: 0;
    padding: 0;
    font-weight: bold;
    color: #203864;
    max-width:none;
    text-align: left;
  }
  .block-competences {
      flex-direction: column;
      margin:10px;
  }
  .competence {
    padding:0px;
    border-right: none !important;
    width: 100%;
  }
  .competence ul {
      padding: 0 0 10px 10px;
      border-bottom: 1px solid #203864;
      margin-left: 0;
  }
  .competence:last-child ul { border-bottom: none; }
  .competence h4{ text-align: left; }
  .competence li{ margin-left: 20px; } 
}