:root {
  --background: #181a1e;
  --background-nav: rgba(24, 26, 30, 0.85);
  --background-light: #2a303c;
  --accent-color: #f4e6b8;
  --color-text: #fff;
  --selection-color: black;

  --nav-border-color: #ffffff33;
  --tool-background: linear-gradient(232deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 94.37%);
  --tool-background-hover: linear-gradient(334deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 94.37%);

  --favorite-star-color: #c0bcae;

  transition: 2s var(--ease-out-quint);
}

::-moz-selection {
  /* Code for Firefox */
  background: var(--accent-color);
  color: var(--selection-color);
}

::selection {
  color: var(--selection-color);
  background: var(--accent-color);
}

body {
  font-family: var(--ff-marr-sans);
  padding-bottom: 20px;
}

a:hover {
  text-decoration: none;
}

#lmwikinavbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  transition: all 0.45s var(--ease-out-quint);
  background-color: var(--background-nav);
  backdrop-filter: blur(5px);
  color: var(--color-text);
  border-bottom: 1px solid var(--nav-border-color);

  .navbar-brand {
    --gap-logo: 1rem;
    display: flex;
    align-items: center;
    gap: var(--gap-logo);
  }

  .navbar-brand a {
    font-weight: 500;
    font-size: 18px;
    line-height: 21.6px;
    letter-spacing: 0.02em;
    display: block;
    height: 100%;
    text-decoration: none;
    color: var(--color-text);

    &.fil_dariane {
      font-weight: 400;
    }
  }

  .navbar-brand a:not(:first-child) {
    padding-left: var(--gap-logo);
    border-left: 1px solid var(--nav-border-color);
  }

  div.dropdown-menu {
    transition: all 0.45s var(--ease-out-quint);
    background-color: var(--background);
    border: 1px solid var(--nav-border-color);
    color: var(--color-text);
    min-width: unset;
    padding: 0;
  }

  .dropdown-divider {
    border-top: 1px solid var(--nav-border-color);
    width: 80%;
    margin: 0.5rem auto;
  }

  .dropdown-item {
    color: var(--color-text);
    padding: 0.4rem 1rem;

    display: flex;
    gap: 5px;
  }

  .dropdown-item:focus,
  .dropdown-item:hover {
    color: var(--accent-color);
    text-decoration: none;
    background-color: var(--background-light);
    transition: all 0.45s var(--ease-out-quint);
  }

  .nav-link {
    color: var(--color-text);
  }
  .navbar-nav {
    gap: 15px;
    align-items: center;
  }

  #outils {
    transition: all 0.45s var(--ease-out-quint);
    background-color: var(--background-light);
    border-radius: 100px;
    padding: 1px 8px;
    a.nav-link {
      color: var(--accent-color);
    }

    img {
      width: 20px;
      filter: brightness(0) saturate(100%) invert(26%) sepia(7%) saturate(10%) hue-rotate(187deg) brightness(106%) contrast(89%);
    }
  }
}
.lightmode_icon {
  /* display: none; */
  cursor: pointer;
  aspect-ratio: 1/1;
  filter: invert(1);
  img {
    height: 30px;
    transform: rotate(0deg);
    transition: transform 0.2s ease-in-out;
  }

  &:hover {
    transform: rotate(5deg);
  }
}
:has(.home_page) #lmwikinavbar .lightmode_icon {
  display: block;
}
.container_base {
  padding-top: 130px;
  min-height: 100vh;
}

table.dataTable thead th,
table.dataTable tfoot th {
  font-weight: 500;
}

.container_base:has(.home_page) {
  max-width: unset;
  padding: 0;
  background-color: var(--background);
  min-height: 100vh;
  transition: all 0.45s var(--ease-out-quint);
}

.home_page {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(30vh, 60px) 200px 80px;
  gap: 10px;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 400;

  h1 {
    font-size: 48px;
    font-weight: 300;
  }
  h2 {
    font-size: 26px;
  }
  h3 {
    font-size: 24px;
    font-weight: 500;
  }
  p {
    margin-bottom: 0;
  }
  .accent {
    color: var(--accent-color);
  }

  .home_title {
    padding-bottom: 100px;
  }

  section .section_header {
    padding-bottom: 34px;
  }

  section .section_content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px;
    margin-bottom: 60px;
    flex-wrap: wrap;

    .tool {
      border-radius: 10px;
      background-color: var(--background-light);
      background: var(--tool-background);
      padding: 10%;
      overflow: hidden;
      aspect-ratio: 1/1;

      display: flex;
      align-items: flex-start;
      flex-direction: column;
      align-content: flex-start;
      justify-content: flex-end;
      gap: 10px;

      position: relative;

      img {
        position: absolute;
        top: 12%;
        left: 12%;
        width: 25%;
        z-index: 0;
        transform: rotate(0deg);
        transition: transform 0.2s ease-in-out;
      }
      &:hover:not(:has(.favorite_star:hover)) {
        background: var(--tool-background-hover);
        img {
          transform: rotate(5deg);
        }
      }

      .favorite_star {
        position: absolute;
        top: 10px;
        right: 20px;
        font-size: 20px;
        color: var(--favorite-star-color);
        z-index: 2;
        cursor: pointer;
        transition: transform 0.2s ease-in-out;
        &:hover {
          transform: scale(1.2) rotate(5deg);
        }
      }

      .favorite_star.favorited {
        color: var(--accent-color);

        svg {
          fill: var(--accent-color);
        }
      }

      span.tool_title {
        z-index: 1;
        font-weight: 500;
        color: var(--accent-color);
      }

      p {
        color: var(--color-text);
        z-index: 1;
        font-size: 16px;
        min-height: 48px;
        letter-spacing: 0.02em;
      }
    }

    .no-favorites {
      border: 2px dashed var(--nav-border-color);
      aspect-ratio: 1/1;
      border-radius: 10px;
      padding: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    &.section_content_contrib {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
      gap: 20px;

      .contrib_person {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        color: var(--color-text);

        img {
          width: 100px;
          height: 100px;
          border-radius: 50%;
          transform: rotate(0deg);
          transition: transform 0.2s ease-in-out;
        }

        &:hover {
          img {
            transform: rotate(5deg);
          }
        }

        span {
          text-align: center;
        }
      }
    }
  }

  .section_agenda {
    max-height: 40vh;
    overflow-y: auto;
  }
  .home_agenda {
    li.event {
      opacity: 0.9;
      font-size: 15px;
    }
    margin-bottom: 40px;

    a {
      text-decoration: underline;
      color: currentColor;

      &:hover {
        text-decoration: none;
      }
    }
  }
}

@media (max-width: 800px) {
  .home_page {
    padding: 85px 4% 80px;

    h1 {
      font-size: 32px;
    }
    h2 {
      font-size: 24px;
    }
    h3 {
      font-size: 18px;
    }
    .home_title {
      padding-bottom: 50px;
    }

    section .section_header {
      padding-bottom: 20px;
    }

    section .section_content {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      margin-bottom: 40px;

      .tool {
        span.tool_title {
          font-size: 15px;
        }

        p {
          display: none;
        }
      }
    }
  }
}

/* JUSTE POUR LES DECODOS */
.home_decodeurs {
  .home_title,
  #decodeurs_header {
    padding-bottom: 50px;
  }
}

.d_credits {
  font-size: 16px;
  opacity: 0.5;
  margin: auto;
  max-width: 95%;
  margin-top: 50px;
  margin-bottom: 50px;
}

[data-color-mode="light"] {
  --background: #f6f1e9;
  --background-nav: #f6f1e985;
  --background-light: #e2ddd5;
  --accent-color: #cb9601;
  --color-text: #000;

  --nav-border-color: #00000033;
  --tool-background: linear-gradient(232deg, rgba(0, 0, 0, 0.09) 0%, rgba(0, 0, 0, 0.04) 94.37%);
  --tool-background-hover: linear-gradient(334deg, rgba(0, 0, 0, 0.09) 0%, rgba(0, 0, 0, 0.04) 94.37%);

  #lightmode_icon img,
  .navbar-brand svg {
    filter: invert(1);
  }

  .tool img {
    opacity: 0.6;
  }
}

[data-color-mode="dark"] body {
  background-color: var(--lmui-c-charcoal-dark);
  color: var(--lmui-c-snow-light);
}

.messages {
  position: fixed;
  top: 120px;
  width: 50%;
  left: 25%;
  z-index: 100;
}

@keyframes myAnimation {
  0% {
    opacity: 0.9;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    display: none;
    opacity: 0;
  }
}

.messages div.message {
  position: sticky;
  width: 100%;
  margin-top: 10px;
  border-radius: 0.25rem;
  padding: 10px;
  background-color: rgba(139, 146, 161);

  animation-name: myAnimation;
  animation-duration: 4000ms;
  animation-fill-mode: forwards;
}

.messages div.message.safe {
  animation-duration: 6000ms;
}

.messages div.message a {
  color: inherit;
  text-decoration: underline;
}
.messages div.message a:hover {
  text-decoration: none;
  opacity: 0.8;
}

.messages div.message.success {
  background-color: #28a744;
  color: #fff;
}

.messages div.message.error {
  background-color: #dc3644;
  color: #fff;
  animation-duration: 10000ms;
}

.messages div.message.warning {
  background-color: #dc8136;
  color: #fff;
}

@media screen and (max-height: 950px) {
  #lmwikinavbar .navbar {
    padding: 0.2rem 1rem;
  }
}

@media screen and (max-height: 800px) {
  #lmwikinavbar {
    height: 47px;
  }
  #lmwikinavbar .fil_dariane {
    display: none;
  }
  #lmwikinavbar .navbar {
    padding: 0.2rem 1rem;
  }

  #lmwikinavbar .navbar-brand {
    padding: 0;
  }

  #lmwikinavbar .navbar-brand a,
  #lmwikinavbar .nav-item {
    font-size: 15px;
  }

  #lmwikinavbar .nav-link {
    padding: 0.2rem;
  }
}

.modal.fade.show {
  opacity: 1 !important;
  display: block !important;
}

.modal.fade.show .modal-dialog {
  transform: translate(0, 0) !important;
  opacity: 1 !important;
}

.modal-content {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.modal-body,
.modal-header,
.modal-footer {
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-backdrop.show {
  opacity: 0.5 !important;
}
