/*
Projet développé par Evensis Technologies.
Website: www.evensis.com
*/
/* Style pour le bouton d'export DOCX */
.export-docx-section {
    margin: 20px 0;
    padding: 15px;
    background: #f7f6eb;
    border: 2px solid #d4d2ba;
    border-radius: 5px;
    text-align: center;
}

.export-docx-section h3 {
    margin-bottom: 10px;
    color: #333;
}
.btn-export-docx {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-export-docx:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

.btn-export-docx:before {
    content: "📄 ";
    margin-right: 5px;
}

#filigrane {
  opacity: 8%;
  width: 500px;
}
.container {
  text-align: center;
}

/* #diagramme {
  width: 90vh;
} */

.acf-field-68430fbec9ea9, .acf-field--post-title, .acf-field-684313944a620, .acf-field-68459941ed382 {
    display: none !important;
}
#export-wrapper {
  position: relative;
}

/*#region INTERACTIVITE */
.show {
  opacity: 100% !important;
}
.hide {
  opacity: 0% !important;
}
.icon {
  opacity: 35%;
  transition: 500ms;
  z-index: 100 !important;
}
.icon:hover {
  opacity: 80%;
}
#numbers, #labels, #icons {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#numbers {
  pointer-events: none;
}
#labels {
  pointer-events: none;
}
#niveaux, .icon {
  cursor: pointer;
}
.zone {
  opacity: 0%;
  transition: 150ms;
  stroke: #ccc;
  stroke-width: 7px;
}
.zone:hover {
  opacity: 70%;
}
/*#endregion */

/*#region TITRE ET LIEU - VERSION RESPONSIVE */
#text {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.text-wrapper {
  display: flex; 
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 0.2vw; /* Gap responsive */
}

/* DESKTOP - Écrans larges (1200px et plus) */
@media screen and (min-width: 1200px) {
  .location {
    width: 270px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .title {
    width: 320px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .input-location {
    font-size: 30px;
    line-height: 1.2;
  }
  
  .input-title {
    font-size: 46px;
    line-height: 1.3;
  }
}

/* TABLETTE PAYSAGE - Écrans moyens-larges (992px à 1199px) */
@media screen and (min-width: 992px) and (max-width: 1199px) {
  .location {
    width: 210px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .title {
    width: 280px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .input-location {
    font-size: 24px;
    line-height: 1.1;
  }
  
  .input-title {
    font-size: 36px;
    line-height: 1.2;
  }
}

/* TABLETTE PORTRAIT - Écrans moyens (768px à 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
  .location {
    width: 150px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .title {
    width: 200px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .input-location {
    font-size: 20px;
    line-height: 1.1;
  }
  
  .input-title {
    font-size: 30px;
    line-height: 1.2;
  }
}

/* MOBILE LARGE - Écrans petits-moyens (576px à 767px) */
@media screen and (min-width: 576px) and (max-width: 767px) {
  .location {
    width: 70px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .title {
    width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .input-location {
    font-size: 10px;
    line-height: 1;
  }
  
  .input-title {
    font-size: 16px;
    line-height: 1;
  }
  h2 {
    font-size: 2.2em;
    line-height: 1;
  }
  h1 {
    font-size: 1.5em;
  }
  p.desc {
    font-size: 1em;
  }
  .container {
    padding: 0 5px;
  }
  #recherche_id {
    font-size: 1em;
  }
  #charger-projet {
    padding: 5px 0 5px 0;
  }
  .colored-line {
    width: 90%;
  }
  .acf-field .acf-label label {
    line-height: 1.1;
  }
  .acf-field p.description {
    font-size: 13px;
  }
  ul.acf-radio-list.acf-hl li {
    margin-bottom: 10px;
  }
  .btn-export-docx {
    margin-bottom: 10px;
  }
}

/* MOBILE SMALL - Très petits écrans (jusqu'à 575px) */
@media screen and (max-width: 575px) {
  .location {
    width: 70px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .title {
    width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .input-location {
    font-size: 8px;
    line-height: 1;
  }
  
  .input-title {
    font-size: 16px;
    line-height: 1;
  }
    h2 {
    font-size: 2.2em;
    line-height: 1;
  }
  h1 {
    font-size: 1.5em;
  }
  p.desc {
    font-size: 1em;
  }
  .container {
    padding: 0 5px;
  }
  #recherche_id {
    font-size: 1em;
  }
  #charger-projet {
    padding: 5px 0 5px 0;
  }
  .colored-line {
    width: 90%;
  }
  .acf-field .acf-label label {
    line-height: 1.1;
  }
  .acf-field p.description {
    font-size: 13px;
  }
  ul.acf-radio-list.acf-hl li {
    margin-bottom: 10px;
  }
  .btn-export-docx {
    margin-bottom: 10px;
  }
}

/* Styles communs pour les inputs */
.input-location {
  width: 100%;
  height: 100%;
  color: #4d4d4d;
  border: none;
  background: none;
  text-align: center;
  font-family: GentiumBookBasic-Italic, 'Gentium Book Basic';
  font-style: italic !important;
  outline: none;
  resize: none;
  overflow: hidden;
  pointer-events: all;
}

.input-title {
  width: 100%;
  height: 100%;
  color: black;
  font-family: GentiumBookBasic-Bold, 'Gentium Book Basic';
  text-align: center;
  border: none;
  background: none;
  outline: none;
  resize: none;
  overflow: hidden;
  pointer-events: all; 
}

/* Placeholders */
.input-location::placeholder {
  color: #999;
}

.input-title::placeholder {
  color: rgb(0, 0, 0);
}

/* États de focus */
.input-location:focus,
.input-title:focus {
  background: none;
  border-radius: none;
}

.input-title::-webkit-input-placeholder {
  color: rgb(0, 0, 0);
}
.input-title:-moz-placeholder {
  color: rgb(0, 0, 0);
  opacity: 1;
}
.input-title::-moz-placeholder {
  color: rgb(0, 0, 0);
  opacity: 1;
}
.input-title:-ms-input-placeholder {
  color: rgb(0, 0, 0);
}
.input-title::-ms-input-placeholder {
  color: rgb(0, 0, 0);
}

.input-location:hover, 
.input-title:hover, 
.input-title:focus, 
.input-location:focus {
  outline: none;
}

/* Ajustement pour le mobile existant */
@media screen and (max-width: 768px) {
  text.label-mobile-fix {
    white-space: pre;
    font-size: 38px !important;
  }
  #diagramme {
    width: 96% !important;
  }
}
/*#endregion */

/*#region LABEL DES AXES */
#labels text {
    font-family: Montserrat, 'Montserrat', Verdana, Tahoma, sans-serif;
    font-weight: 800;
    font-size: 45px;
    text-transform: uppercase;
    letter-spacing: -2.5px;
}
.reduced {font-size: 43px !important;}

@media screen and (max-width: 768px) {
  text.label-mobile-fix {
    white-space: pre;
    font-size: 38px !important;
  }
  #diagramme {
    width: 96% !important;
  }
}
/*#endregion */

/*#region TEXTES */
.category-title {
    font-family: GentiumBookBasic, 'Gentium Book Basic', Verdana, Tahoma, sans-serif;
    font-weight: 400;
    font-size: 85px;
    letter-spacing: -5px;
}
#numbers text {
font-family: 'Montserrat';
font-weight: 400;
font-size: 50px;
}
#project-title {
    font-family: GentiumBookBasic, 'Gentium Book Basic';
    font-size: 150px;
}
#project-location {
    fill: #4d4d4d;
    font-family: GentiumBookBasic-Italic, 'Gentium Book Basic';
    font-size: 76.86px;
    font-style: italic;
}
/*#endregion */

/*#region BORDURES */
.border-1 {
    stroke: #ccc;
    stroke-width: 7px;
    stroke-miterlimit: 10;
}
.border-2 {
    stroke-miterlimit: 10;
    stroke: #fff;
    stroke-width: 5px;
}
.border-w {
    stroke: #fff;
    stroke-width: 3px;
}
/*#endregion */

/*#region FONDS DE COULEUR */
.bleu-1 { fill: #09f; }
.bleu-2 { fill: #06f; }
.bleu-3 { fill: #03f; }
.jaune-1 { fill: #fff14b; }
.jaune-2 { fill: #f2e436; }
.jaune-3 { fill: #ffe000; }
.jaune-4 { fill: #efcc00; }
.jaune-5 { fill: #ffb307; }
.jaune-6 { fill: #f90; }
.rose-1 { fill: #d9318a; }
.rose-2 { fill: #c3c; }
.rose-3 { fill: #b4318a; }
.rose-4 { fill: #9d318a; }
.vert-1 { fill: #8cc63f; }
.vert-2 { fill: #62c355; }
.vert-3 { fill: #3c6; }
.vert-4 { fill: #99c355; }
.blanc { fill: #fff; }
/*#endregion */

/*#region FORMES GEOMETRIQUES */
#axis-cicle-small { fill: #fff; }
#axis-circle-medium { fill: #f2f2f2; opacity: .31; display: none; pointer-events: none;}
#axis-circle-wide { fill: none; }
#circlePath, #circlePathInverted, #circlePathLabels { fill: none; }
#circlePathLabels { stroke: red; stroke-width: 5px;}
/*#endregion */

/*#region */

/* Animation du diagramme au chargement de la page */

/* Animation principale du conteneur */
#export-wrapper {
  animation: fadeInScale 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
  transform: scale(0.8);
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation des axes de couleur (apparition en cascade) */
#axis-background path {
  opacity: 0;
  animation: slideInRotate 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: 50% 50%;
}

#axis-background path:nth-child(1) { animation-delay: 0.3s; }
#axis-background path:nth-child(2) { animation-delay: 0.5s; }
#axis-background path:nth-child(3) { animation-delay: 0.7s; }
#axis-background path:nth-child(4) { animation-delay: 0.9s; }

@keyframes slideInRotate {
  0% {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  50% {
    opacity: 0.7;
    transform: rotate(2deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* Animation des fonds blancs des axes */
g[data-name="Fond blanc des axes"] path {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
  animation-delay: 1.1s;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Les niveaux (zones cliquables) ne sont pas animés pour préserver l'interactivité */

/* Animation temporaire des sections niveau 3 - uniquement avec la classe temporaire */
#niveaux path[id$="_3"].section-preview {
  animation: sectionReveal 1.2s ease-in-out forwards;
}

/* Délais pour chaque section niveau 3 avec la classe temporaire */
#niveaux path[id="1.1_3"].section-preview { animation-delay: 0.2s; }
#niveaux path[id="1.2_3"].section-preview { animation-delay: 0.4s; }
#niveaux path[id="1.3_3"].section-preview { animation-delay: 0.6s; }
#niveaux path[id="2.1_3"].section-preview { animation-delay: 0.8s; }
#niveaux path[id="2.2_3"].section-preview { animation-delay: 1.0s; }
#niveaux path[id="2.3_3"].section-preview { animation-delay: 1.2s; }
#niveaux path[id="2.4_3"].section-preview { animation-delay: 1.4s; }
#niveaux path[id="2.5_3"].section-preview { animation-delay: 1.6s; }
#niveaux path[id="2.6_3"].section-preview { animation-delay: 1.8s; }
#niveaux path[id="3.1_3"].section-preview { animation-delay: 2.0s; }
#niveaux path[id="3.2_3"].section-preview { animation-delay: 2.2s; }
#niveaux path[id="3.3_3"].section-preview { animation-delay: 2.4s; }
#niveaux path[id="3.4_3"].section-preview { animation-delay: 2.6s; }
#niveaux path[id="4.1_3"].section-preview { animation-delay: 2.8s; }
#niveaux path[id="4.2_3"].section-preview { animation-delay: 3.0s; }
#niveaux path[id="4.3_3"].section-preview { animation-delay: 3.2s; }

@keyframes sectionReveal {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 0.4;
  }
  35% {
    opacity: 0.6;
  }
  85% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
  }
}

/* Les numéros des axes ne sont pas animés pour éviter les clignotements */

/* Animation des cercles - Restaure les opacités d'origine */
#axis-circle-wide {
  opacity: 0;
  animation: drawCircleTransparent 1.5s ease-out forwards;
  animation-delay: 1.2s;
}

#axis-circle-medium {
  opacity: 0;
  animation: drawCircleMedium 1.5s ease-out forwards;
  animation-delay: 1.2s;
}

#axis-cicle-small {
  opacity: 0;
  animation: drawCircle 1.5s ease-out forwards;
  animation-delay: 1.2s;
}

@keyframes drawCircle {
  0% {
    opacity: 0;
    stroke-dasharray: 0 1000;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    stroke-dasharray: 1000 0;
  }
}

@keyframes drawCircleMedium {
  0% {
    opacity: 0;
    stroke-dasharray: 0 1000;
  }
  50% {
    opacity: 0.31;
  }
  100% {
    opacity: 0.31;
    stroke-dasharray: 1000 0;
  }
}

@keyframes drawCircleTransparent {
  0% {
    opacity: 0;
    stroke-dasharray: 0 1000;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    stroke-dasharray: 1000 0;
  }
}

/* Animation des titres de catégories - Fade-in simple sans transformation */
.category-title {
  animation: simpleFadeIn 1.2s ease-out forwards;
  animation-delay: 2.8s;
}

/* Animation des labels - Fade-in simple sans transformation */
#labels text {
  animation: simpleFadeIn 0.8s ease-out forwards;
}

#labels-gauche text:nth-child(1) { animation-delay: 3.0s; }
#labels-gauche text:nth-child(2) { animation-delay: 3.1s; }
#labels-gauche text:nth-child(3) { animation-delay: 3.2s; }
#labels-gauche text:nth-child(4) { animation-delay: 3.3s; }
#labels-gauche text:nth-child(5) { animation-delay: 3.4s; }
#labels-gauche text:nth-child(6) { animation-delay: 3.5s; }
#labels-gauche text:nth-child(7) { animation-delay: 3.6s; }
#labels-gauche text:nth-child(8) { animation-delay: 3.7s; }

#labels-droit text:nth-child(1) { animation-delay: 3.0s; }
#labels-droit text:nth-child(2) { animation-delay: 3.1s; }
#labels-droit text:nth-child(3) { animation-delay: 3.2s; }
#labels-droit text:nth-child(4) { animation-delay: 3.3s; }
#labels-droit text:nth-child(5) { animation-delay: 3.4s; }
#labels-droit text:nth-child(6) { animation-delay: 3.5s; }
#labels-droit text:nth-child(7) { animation-delay: 3.6s; }
#labels-droit text:nth-child(8) { animation-delay: 3.7s; }

/* Les icônes ne sont pas animées pour préserver le hover d'origine */

/* Animation des labels - Fade-in simple sans transformation */
#labels text {
  opacity: 0;
  animation: simpleFadeIn 0.8s ease-out forwards;
}

#labels-gauche text:nth-child(1) { animation-delay: 2.0s; }
#labels-gauche text:nth-child(2) { animation-delay: 2.1s; }
#labels-gauche text:nth-child(3) { animation-delay: 2.2s; }
#labels-gauche text:nth-child(4) { animation-delay: 2.3s; }
#labels-gauche text:nth-child(5) { animation-delay: 2.4s; }
#labels-gauche text:nth-child(6) { animation-delay: 2.5s; }
#labels-gauche text:nth-child(7) { animation-delay: 2.6s; }
#labels-gauche text:nth-child(8) { animation-delay: 2.7s; }

#labels-droit text:nth-child(1) { animation-delay: 2.0s; }
#labels-droit text:nth-child(2) { animation-delay: 2.1s; }
#labels-droit text:nth-child(3) { animation-delay: 2.2s; }
#labels-droit text:nth-child(4) { animation-delay: 2.3s; }
#labels-droit text:nth-child(5) { animation-delay: 2.4s; }
#labels-droit text:nth-child(6) { animation-delay: 2.5s; }
#labels-droit text:nth-child(7) { animation-delay: 2.6s; }
#labels-droit text:nth-child(8) { animation-delay: 2.7s; }

/* Animation du conteneur de texte central */
#text {
  opacity: 0;
  animation: simpleFadeIn 1.0s ease-out forwards;
  animation-delay: 4.2s;
}

/* Animation des champs de texte - Fade-in simple sans transformation */
.input-location,
.input-title {
  opacity: 0;
  animation: simpleFadeIn 0.8s ease-out forwards;
}

.input-location {
  animation-delay: 4.4s;
}

.input-title {
  animation-delay: 4.6s;
}

@keyframes simpleFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Réduction du mouvement pour les utilisateurs préférant moins d'animations */
@media (prefers-reduced-motion: reduce) {
  #export-wrapper,
  #axis-background path,
  g[data-name="Fond blanc des axes"] path,
  #axis-circle-wide,
  #axis-circle-medium,
  #axis-cicle-small,
  .category-title,
  #labels text,
  #text,
  .input-location,
  .input-title {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Restaure les opacités d'origine pour les éléments spéciaux */
  #axis-circle-medium {
    opacity: 0.31 !important;
  }
}

/*#endregion */



/* Animation hover pour les paths niveau-0 */
#niveau-0 path {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
    cursor: pointer;
}

#niveau-0 path:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Animation pour les numéros transformés en pastilles d'aide */
#numbers text {
    transition: all 0.3s ease;
    cursor: pointer;
}

#numbers text.help-mode {
    font-family: Arial, sans-serif;
    font-size: 40px;
    font-weight: bold;
}


/* Styles pour le tooltip */
.hover-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.92);
    color: white;
    padding: 0; /* Supprimé pour gérer le padding dans les enfants */
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    pointer-events: none;
    z-index: 10000;
    
    /* Dimensions adaptatives */
    min-width: 200px;
    max-width: 400px;
    max-height: 300px;
    
    /* Gestion du débordement */
    overflow: hidden; /* Changé pour gérer le scroll dans le contenu */
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    
    /* Effets visuels */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

.hover-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Titre du tooltip */
.tooltip-title {
    padding: 12px 16px 8px 16px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 0;
}

/* Contenu du tooltip */
.tooltip-content {
    padding: 8px 16px 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Flèche du tooltip */
.hover-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -7px;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.92);
}

/* Flèche alternative pour les tooltips positionnés à droite */
.hover-tooltip.tooltip-right::before {
    left: auto;
    right: -7px;
    border-right-color: transparent;
    border-left-color: rgba(0, 0, 0, 0.92);
}

/* Scrollbar personnalisée pour le contenu */
.tooltip-content::-webkit-scrollbar {
    width: 6px;
}

.tooltip-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive pour mobile */
@media screen and (max-width: 768px) {
    .hover-tooltip {
        max-width: calc(100vw - 40px);
        max-height: 250px;
    }
    
    .tooltip-title {
        font-size: 15px;
        padding: 10px 12px 6px 12px;
    }
    
    .tooltip-content {
        font-size: 13px;
        padding: 6px 12px 10px 12px;
        max-height: 150px;
    }
}
/* Styles pour les critères des tooltips */
.tooltip-level-label {
    font-weight: 600;
    font-size: 12px;
    color: #d7d7d7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 4px;
    text-align: center;
    width: 100%;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .tooltip-level-label {
        font-size: 10px;
    }
}