/* Import des polices locales */

@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-regular-webfont-Dh2UyALx.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Roboto-bold";
  src: url("../fonts/roboto-bold-webfont-DLEC0mPx.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Jura";
  src: url("../fonts/jura-oeZM-I3y.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

/* Variables CSS */

:root {
  /* Palette de couleurs */
  --color-white-tint: #fefdff;
  --color-light-1: #fcefff;
  --color-light-2: #f9edff;
  --color-pink: #ed6da6;
  --color-magenta: #dc3f94;
  --color-purple-dark: #a81580;
  --color-violet-1: #45287c;
  --color-violet-2: #44277a;

  /* Polices */
  --title-font-family: "Jura", sans-serif;
  --body-font-family: "Roboto", Arial, sans-serif;
  --body-bold-font-family: "Roboto-bold", Arial, sans-serif;

  /* Dégradés */
  --gradient-brand: linear-gradient(to right, var(--color-violet-2), var(--color-violet-1), var(--color-purple-dark), var(--color-magenta));
  --gradient-avatar: linear-gradient(135deg, var(--color-violet-1), var(--color-magenta));
  --gradient-profile-header: linear-gradient(135deg, var(--color-light-2) 0%, var(--color-white-tint) 100%);
}

/* ===== STYLES GLOBAUX ===== */

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

body {
  font-family: var(--body-font-family) !important;
}

/* ===== ALERTES ===== */

.alert-success , .alert-info {
  background-color: var(--color-light-2) !important;
  color: black !important;
  border: 1px solid var(--color-magenta) !important;
}

/* ===== NAVBAR ===== */

.navbar {
  background-color: var(--color-white-tint);
}

nav hr {
  border: none;
  height: 1px;
  background: var(--gradient-brand);
}

.navbar-brand {
  font-family: var(--title-font-family);
  font-size: 2rem !important;
  font-weight: bold;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link,
.dropdown-item {
  font-family: var(--body-font-family);
  font-size: 1.25rem !important;
  color: var(--color-violet-1) !important;
}

.nav-link:hover,
.nav-link.active,
.dropdown-item:hover {
  color: var(--color-magenta) !important;
}

.nav-link img,
.switch-custom img {
  margin-bottom: 2px;
}

.navbar-toggler {
  border-color: var(--color-magenta) !important;
}

.navbar-toggler:focus {
  box-shadow: none !important;
}

.navbar-toggler-icon {
  background-image: url(../img/hamburger.svg) !important;
}

/* ===== FOOTER ===== */

footer {
  background-color: var(--color-violet-1);
  border-top: 2px solid transparent;
  border-image: var(--gradient-brand) 1;
}

.text-footer {
  font-family: var(--body-font-family);
  color: var(--color-light-1);
  font-size: 12px;
}

/* ===== MISE EN PAGE ===== */

section {
  background-image: url("../img/background.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
}

.div-container {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.form-wrapper,
.welcome-wrapper {
  max-width: 800px;
  width: 100%;
}

.form-wrapper-sm {
  max-width: 400px;
  width: 100%;
}

.form-card,
.persona-card,
.profile-card,
.compass-card {
  border-color: var(--color-magenta) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.title-custom {
  font-family: var(--title-font-family);
  font-size: 20px;
  color: var(--color-violet-1);
}

h3.title-custom {
  color: var(--color-magenta);
}

/* ===== BOUTONS ===== */

#closeBtn {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#closeBtn img {
  width: 20px;
  height: 20px;
}

#closeBtn:hover {
  opacity: 0.7;
}

#closeBtn:active {
  transform: scale(0.9);
}

.btn-connexion {
  background-color: transparent !important;
  color: white !important;
  border: none !important;
  transition: transform 0.2s ease !important;
  position: relative;
}

.btn-connexion:hover {
  transform: translateY(-2px);
}

.btn-connexion:active {
  transform: translateY(0px);
}

.btn-next:active,
.btn-back:active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-add-criteria .btn-img-hover,
.btn-add-criteria:hover .btn-img-normal,
.btn-connexion .btn-img-hover,
.btn-connexion:hover .btn-img-normal,
.toggle-password-btn .eye-active,
.toggle-password-btn.active .eye-inactive,
.icone-list .img-hover,
.icone-list:hover .img-normal {
  display: none;
}

.btn-add-criteria:hover .btn-img-hover,
.btn-connexion:hover .btn-img-hover,
.icone-list:hover .img-hover {
  display: inline-block;
}

.btn-connexion img {
  width: auto;
  height: auto;
  display: block;
}

.btn-connexion .btn-text {
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -52%);
  font-weight: 500;
  pointer-events: none;
}

.btn-back,
.btn-next {
  background-color: var(--color-violet-1) !important;
  color: white !important;
  border: none !important;
  cursor: pointer;
  transition: transform 0.2s ease !important;
}

.btn-back:hover,
.btn-next:hover {
  background-color: var(--color-magenta) !important;
  color: white !important;
}

.btn-add-criteria {
  background-color: white !important;
  border-color: var(--color-violet-1) !important;
  color: var(--color-violet-1) !important;
}

.btn-add-criteria:hover {
  background-color: var(--color-violet-1) !important;
  border-color: var(--color-violet-1) !important;
  color: white !important;
}

.btn-add-criteria img {
  width: 16px;
  margin-bottom: 2px;
}

/* ===== AUTOCOMPLETION CRITÈRES ===== */

.criteria-suggestions {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background: #fff;
}

.criteria-suggestions .list-group-item {
  font-size: 0.9rem;
  border-left: none;
  border-right: none;
}

.criteria-suggestions .list-group-item:first-child {
  border-top: none;
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
}

.criteria-suggestions .list-group-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

.criteria-suggestions .list-group-item:hover,
.criteria-suggestions .list-group-item:focus {
  background-color: #f0f0f0;
}

/* ===== BOUSSOLE ===== */

.compass-card {
  max-width: 300px;
}

#compass {
  max-width: 250px;
}

#compass-arrow {
  max-width: 103px;
  position: absolute;
  top: 33%;
  left: 33%;
  animation: rotating 12s linear(0, 0.25 45%, 0.5 55%, 0.35 70%, 1) infinite;
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== FORMULAIRES ===== */

.color-link {
  color: var(--color-violet-1);
}

.color-link:hover {
  color: var(--color-magenta);
}

.form-label,
.small-text {
  font-family: var(--body-font-family);
  font-size: 14px;
}

.required {
  color: var(--color-magenta);
}

.form-control-custom {
  border: 2px solid var(--color-violet-1) !important;
}

.form-control-custom::placeholder {
  font-size: 14px;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 8px rgba(69, 40, 124, 0.3) !important;
  border-color: var(--color-magenta) !important;
}

.password-input-wrapper {
  position: relative;
}

.toggle-password-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.toggle-password-btn img {
  width: 20px;
  height: 20px;
}

.toggle-password-btn.active .eye-active {
  display: block;
}

/* Edge / Chrome : masque le bouton "reveal" */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

.welcome-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.logo-dashboard {
  max-width: 110px;
  max-height: 110px;
  object-fit: cover;
  width: 100%;
  height: auto;
  border: solid;
  border-width: thin;
  border-color: var(--color-magenta);
}

.logo-preview img {
  max-width: 150px;
  max-height: 150px;
}

.crown {
  margin-bottom: 5px;
  width: 18px;
}

.form-control.is-valid {
  background-image: url(../img/check.svg) !important;
  background-size: auto !important;
}

.form-control.is-invalid {
  background-image: url(../img/error-outline.svg) !important;
  background-size: auto !important;
}

#password.is-valid,
#password.is-invalid,
#confirm_password.is-valid,
#confirm_password.is-invalid {
  background-position: right calc(2em + .1875rem) center !important;
}

/* ===== LISTE DES OPÉRATIONS ===== */

.operations-wrapper {
  max-width: 595px;
  width: 100%;
}

/* ===== FORMULAIRE MULTI-ÉTAPES ===== */

.step {
  display: none !important;
}
.step.active {
  display: flex !important;
}

/* ===== FICHE PERSONA ===== */

.persona-card {
  padding: 1.5rem;
}

.icone-list {
  display: inline-block;
  transition: transform 0.2s ease;
}

.icone-img {
  margin-right: 5px;
}

.switch-custom a {
  text-decoration: none;
  color: var(--color-violet-1);
}

.switch-custom a:hover {
  color: var(--color-magenta);
}

#personaTypeStatus {
  opacity: 0.7;
}

/* ===== DATATABLES ===== */
/* Surcharge nécessaire des styles natifs de DataTables et Bootstrap */

#th-actions {
  min-width: 95px;
}

.page-link {
  background-color: white !important;
  border-color: var(--color-pink) !important;
  color: var(--color-pink) !important;
}

.page-link:hover {
  background-color: var(--color-light-1) !important;
  border-color: var(--color-magenta) !important;
  color: var(--color-magenta) !important;
}

.paginate_button.active .page-link,
.page-item.active .page-link,
.paginate_button.current .page-link {
  background-color: var(--color-pink) !important;
  border-color: var(--color-pink) !important;
  color: white !important;
}

.paginate_button.active .page-link:hover,
.page-item.active .page-link:hover,
.paginate_button.current .page-link:hover {
  background-color: var(--color-magenta) !important;
  border-color: var(--color-magenta) !important;
  color: white !important;
}

.page-link:focus {
  box-shadow: none !important;
}

/* Icônes Bootstrap pour le tri des colonnes DataTables */

/* État neutre (non trié) - afficher les deux icônes */
/* :before affiche bi-sort-up-alt */
table.dataTable thead > tr > th.dt-orderable-asc .dt-column-order:before,
table.dataTable thead > tr > th.dt-orderable-desc .dt-column-order:before,
table.dataTable thead > tr > td.dt-orderable-asc .dt-column-order:before,
table.dataTable thead > tr > td.dt-orderable-desc .dt-column-order:before {
  font-family: 'bootstrap-icons' !important;
  content: "\F57A" !important; /* bi-sort-up-alt */
  font-size: 0.9em !important;
  opacity: 0.3 !important;
  bottom: 55% !important;
}

/* :after affiche bi-sort-down */
table.dataTable thead > tr > th.dt-orderable-asc .dt-column-order:after,
table.dataTable thead > tr > th.dt-orderable-desc .dt-column-order:after,
table.dataTable thead > tr > td.dt-orderable-asc .dt-column-order:after,
table.dataTable thead > tr > td.dt-orderable-desc .dt-column-order:after {
  font-family: 'bootstrap-icons' !important;
  content: "\F575" !important; /* bi-sort-down */
  font-size: 0.9em !important;
  opacity: 0.3 !important;
  top: 55% !important;
}

/* Tri ascendant actif - bi-sort-up-alt */
table.dataTable thead > tr > th.dt-ordering-asc .dt-column-order:before,
table.dataTable thead > tr > td.dt-ordering-asc .dt-column-order:before {
  font-family: 'bootstrap-icons' !important;
  content: "\F57A" !important; /* bi-sort-up-alt */
  font-size: 1em !important;
  opacity: 1 !important;
  color: var(--color-magenta) !important;
  bottom: 50% !important;
}

/* Masquer l'icône after pour le tri ascendant */
table.dataTable thead > tr > th.dt-ordering-asc .dt-column-order:after,
table.dataTable thead > tr > td.dt-ordering-asc .dt-column-order:after {
  content: "" !important;
  display: none !important;
}

/* Tri descendant actif - bi-sort-down */
table.dataTable thead > tr > th.dt-ordering-desc .dt-column-order:after,
table.dataTable thead > tr > td.dt-ordering-desc .dt-column-order:after {
  font-family: 'bootstrap-icons' !important;
  content: "\F575" !important; /* bi-sort-down */
  font-size: 1em !important;
  opacity: 1 !important;
  color: var(--color-magenta) !important;
  top: 50% !important;
}

/* Masquer l'icône before pour le tri descendant */
table.dataTable thead > tr > th.dt-ordering-desc .dt-column-order:before,
table.dataTable thead > tr > td.dt-ordering-desc .dt-column-order:before {
  content: "" !important;
  display: none !important;
}

/* Surcharge pour les colonnes numériques - direction normale pour les en-têtes */
table.dataTable th.dt-type-numeric div.dt-column-header,
table.dataTable th.dt-type-numeric div.dt-column-footer,
table.dataTable th.dt-type-date div.dt-column-header,
table.dataTable th.dt-type-date div.dt-column-footer {
  flex-direction: row !important;
}

/* Surcharge pour les colonnes numériques - aligner les cellules à gauche */
table.dataTable th.dt-type-numeric, 
table.dataTable th.dt-type-date, 
table.dataTable td.dt-type-numeric, 
table.dataTable td.dt-type-date {
    text-align: left !important;
}

.dt-info {
  margin-top: 1rem;
}

.pagination {
  justify-content: center;
  margin-top: 1rem !important;
}

.non-wrap {
  white-space: nowrap;
}

/* ===== LISTE DES PERSONAS ===== */

.form-label-custom {
  font-family: var(--body-font-family);
  font-size: 1rem;
}

/* ===== PAGE DE PROFIL ===== */

.profile-card {
  overflow: hidden;
}

.profile-header {
  background: var(--gradient-profile-header);
  text-align: center;
  padding: 3rem 2rem 2rem;
  border-bottom: 2px solid var(--color-light-1);
}

.profile-avatar {
  margin-bottom: 1.5rem;
}

.avatar-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient-avatar);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-family: var(--title-font-family);
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(168, 21, 128, 0.2);
  border: 4px solid white;
}

.profile-name {
  font-family: var(--title-font-family);
  font-size: 1.8rem;
  color: var(--color-violet-1);
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.profile-username {
  color: var(--color-purple-dark);
  font-size: 1rem;
  margin-bottom: 0;
  opacity: 0.8;
}

.profile-content {
  padding: 2rem;
}

.profile-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f0f0f0;
}

.profile-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-family: var(--title-font-family);
  font-size: 1.1rem;
  color: var(--color-violet-1);
  margin-bottom: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 1rem;
  background-color: #fafafa;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.info-item:hover {
  background-color: var(--color-light-1);
  border-color: var(--color-light-2);
  transform: translateY(-1px);
}

.info-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 8px;
  flex-shrink: 0;
  color: #dc3f94;
}

.info-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.info-label {
  font-size: 0.75rem;
  color: var(--color-purple-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-align: center;
}

.info-value {
  font-size: 1rem;
  color: var(--color-violet-1);
  font-family: var(--body-bold-font-family);
  word-wrap: break-word;
  text-align: center;
}

a.info-value:hover {
  color: var(--color-magenta);
}

.profile-wrapper {
  max-width: 900px;
  width: 100%;
}

.avatar-persona {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(168, 21, 128, 0.2);
}

.criteria-group-title {
  font-size: 1rem;
  color: var(--color-magenta);
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.criteria-list {
  list-style: none;
  padding-left: 1.5rem;
  margin-bottom: 0;
}

.criteria-list li {
  padding: 0.4rem 0;
  color: var(--color-violet-1);
}

.criteria-check-icon {
  color: var(--color-magenta);
  margin-right: 0.5rem;
}

.bg-success-custom {
  background-color: var(--color-magenta);
  color: white;
}

.bg-secondary-custom {
  background-color: var(--color-violet-1);
  color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .persona-card {
    padding-left: 0;
    padding-right: 0;
  }

  .icone-img {
    margin-right: 0;
  }

  .table-responsive {
    font-size: 14px;
  }

  .form-label-custom {
    font-size: 14px;
  }

  .div-container {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .profile-header {
    padding: 2rem 1.5rem 1rem;
  }
}