/**==============================================
**                   SIDEBAR
**===============================================**/
.sidebar {
  background: var(--neutral4);
  display: flex;
  flex-direction: column;
  position: fixed;
  width: 220px;
  height: 100dvh;
  z-index: 10;
  top: 0;
  left: 0;
  transition: all var(--transition-normal);
}
/*# ----------- Mode Open = .open ----------- #*/
.sidebar.open {
  transform: translateX(0);
  width: 250px;
  overflow-y: auto;
}

/**================== LOGO ====================*/
#closeCross {
  display: none;
}
/*# ----------- Mode Open = .open ----------- #*/
.sidebar.open h1 {
  position: relative;
}
.sidebar.open #closeCross {
  position: absolute;
  display: block;
  top: 8px;
  right: 8px;
  z-index: 20;
}

/**============= ONGLETS + LIEN ===============*/
.sidebar-section {
  margin: var(--spacing-m);
}
.section-title {
  text-transform: uppercase;
  font-size: var(--font-size-s);
}
.separator {
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color-dark) 0%,
    var(--primary-color) 25%,
    var(--primary-color-light) 50%,
    var(--primary-color) 75%,
    var(--primary-color-dark) 100%
  );
  margin: var(--spacing-xs) 0 var(--spacing-s);
  box-shadow: var(--shadow-color);
}
.sidebar-section ul li {
  padding: var(--spacing-s);
  transition: all var(--transition-normal);
}
/*¤ ---------- Mode Hover = :hover ---------- ¤*/
.sidebar-section ul li:hover {
  background: linear-gradient(90deg, transparent, var(--color-hover-link), transparent);
  border-radius: var(--radius-s);
}
.sidebar-section ul li:hover a {
  color: var(--color-text-primary);
  transform: scale(1.05);
}

/**==============================================
**                   HEADER
**===============================================**/
header {
  margin-left: 220px;
  width: calc(100% - 220px);
  height: 80px;
  background: var(--neutral5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-m);
  box-shadow: var(--shadow-black);
}

/**=============== BURGER MENU ================*/
.burger-menu {
  display: none;
  fill: var(--color-text-primary);
  align-items: center;
}

/**=============== NAVIGATION =================*/
.navbar ul {
  display: flex;
  align-items: center;
  gap: 1px;
}
.navbar ul li {
  background: var(--neutral4);
  padding: var(--spacing-s) var(--spacing-m);
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-color);
}
.navbar ul li:nth-child(1) {
  border-radius: var(--radius-m) 0 0 var(--radius-m);
}
.navbar ul li:nth-child(3) {
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
}
.navbar ul li a {
  font-weight: bold;
  color: var(--color-text-primary);
}
/*¤ ---------- Mode Hover = :hover ---------- ¤*/
.navbar ul li:hover {
  background: var(--neutral4-5);
}
.navbar ul li:hover::after {
  content: '';
  width: 100%;
  height: 3px;
  background: var(--neutral1);
  position: absolute;
  bottom: 0;
  left: 0;
}
/*# --------- Mode Actif = .active ---------- #*/
.navbar ul li.active {
  background: var(--neutral3-5);
  position: relative;
  overflow: hidden;
}
.navbar ul li.active a {
  color: var(--color-accent-primary);
}
.navbar ul li.active::after {
  content: '';
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color-dark) 0%,
    var(--primary-color) 25%,
    var(--primary-color-light) 50%,
    var(--primary-color) 75%,
    var(--primary-color-dark) 100%
  );
  position: absolute;
  bottom: 0;
  left: 0;
}

/**=============== SEARCH BAR =================*/
.search-bar {
  background: var(--neutral4);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-color);
  padding: var(--spacing-xs) var(--spacing-m);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}
#search-bar {
  color: var(--color-text-primary);
  font-weight: bold;
  width: clamp(200px, 25%, 300px);
}
#search-bar::placeholder {
  color: var(--neutral0);
  font-weight: bold;
}
/*¤ ---------- Mode Focus = :focus ---------- ¤*/
#search-bar:focus {
  outline: 1px solid var(--primary-color);
  outline-offset: 3px;
  transition: outline 0.3s ease;
}

/**================= PROFILE ==================*/
.profile {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}
.profile-text {
  text-align: right;
}
.profile-text a {
  transition: all var(--transition-normal);
}
/*¤ ---------- Mode Hover = :hover ---------- ¤*/
.profile-text a:hover {
  transform: scale(1.05);
}

/**==============================================
**                    MAIN
**===============================================**/
main {
  width: calc(100% - 220px);
  margin-left: 220px;
  min-height: calc(100dvh - 220px);
}

/**============= FILTER/SORT BAR ==============*/
.filter-sort-bar {
  width: 80%;
  margin: var(--spacing-l) auto;
  max-width: 1080px;
  background: var(--neutral4);
  box-shadow: var(--shadow-color);
  padding: var(--spacing-s) var(--spacing-m);
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-sort-bar div {
  display: flex;
  align-items: center;
  gap: var(--spacing-l);
}
fieldset {
  border: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}
fieldset button {
  background: var(--neutral3-5);
  box-shadow: var(--shadow-black);
  padding: var(--spacing-xs) var(--spacing-s);
  border-radius: var(--radius-s);
  font-weight: bold;
  color: var(--neutral1);
  transition: all var(--transition-normal);
}
/*¤ ---------- Mode Hover = :hover ---------- ¤*/
fieldset button:hover {
  background-color: var(--neutral4-5);
}

/*(1) Les boutons filtre par Language. */
/*# ----- Mode Filteredby = .filteredby ----- #*/
/* Bouton actif : application de la classe .filteredby */
.filter-buttons button.filteredby {
  background: var(--neutral3);
  position: relative;
  overflow: hidden;
  color: var(--color-accent-primary);
  box-shadow: var(--shadow-color);
}
.filter-buttons button.filteredby::after {
  content: '';
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color-dark) 0%,
    var(--primary-color) 25%,
    var(--primary-color-light) 50%,
    var(--primary-color) 75%,
    var(--primary-color-dark) 100%
  );
  position: absolute;
  bottom: 0;
  left: 0;
}

/*(2) Les boutons Display. */
.display-buttons button {
  width: 36px;
  height: 36px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.display-buttons svg {
  width: 100%;
  height: auto;
  fill: var(--color-text-primary);
}
/*# ------ Mode Displayed = .displayed ------ #*/
/* Bouton actif : application de la classe .displayed */
.display-buttons button.displayed {
  background: var(--neutral3);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-color);
}
.display-buttons button.displayed::after {
  content: '';
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color-dark) 0%,
    var(--primary-color) 25%,
    var(--primary-color-light) 50%,
    var(--primary-color) 75%,
    var(--primary-color-dark) 100%
  );
  position: absolute;
  bottom: 0;
  left: 0;
}
.display-buttons button.displayed svg {
  fill: var(--color-accent-primary) !important;
}

/*(3) Le sort Select */
#sort-select {
  background: var(--neutral3-5);
  box-shadow: var(--shadow-black);
  padding: var(--spacing-xs) var(--spacing-s);
  border-radius: var(--radius-s);
  font-weight: bold;
  color: var(--neutral1);
  transition: all var(--transition-normal);
}
/*¤ ---------- Mode Focus = :focus ---------- ¤*/
#sort-select:focus {
  outline: 1px solid var(--primary-color);
  outline-offset: 3px;
  box-shadow: var(--shadow-color);
  transition: outline 0.3s ease;
}

/**=============== GRID RESULT ================*/
.grid-results {
  width: 80%;
  margin: var(--spacing-xl) auto;
  max-width: 1080px;
  background: var(--neutral4);
  box-shadow: var(--shadow-color);
  padding: var(--spacing-l);
  border-radius: var(--radius-s);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-l);
}
/*# - Mode Inline-Display = .inline-display - #*/
.grid-results.inline-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

/*(1) Les Cards. */
.card {
  max-width: 300px;
  margin: 0 auto;
  background: var(--neutral3-5);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-black);
  padding: var(--spacing-l);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-l);
  cursor: pointer;
}
.card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  background: var(--card-img);
}
.card-text {
  display: flex;
  flex-direction: column;
  align-items: left;
  gap: var(--spacing-m);
  font-weight: bold;
}
.tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-s);
}
.tag {
  background: var(--neutral4);
  padding: var(--spacing-xs) var(--spacing-s);
  border-radius: var(--radius-s);
}
/*¤ ---------- Mode Hover = :hover ---------- ¤*/
.card:hover {
  transform: scale(1.05);
}
/*# - Mode Inline-Display = .inline-display - #*/
.inline-display .card {
  flex-direction: row;
  width: 100%;
  max-width: 1080px;
}
.inline-display .card-img {
  display: none;
}
.inline-display .card-text {
  flex-direction: row;
  align-items: center;
}

/**==============================================
**                   FOOTER
**===============================================**/
footer {
  width: calc(100% - 220px);
  height: 140px;
  margin-left: 220px;
  background: var(--neutral5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.footer-container {
  text-align: center;
}

/**==============================================
**                MEDIA QUERIES
**===============================================**/
/*MEDIA Max-Width = 1090px */
@media screen and (max-width: 1090px) {
  .profile-text {
    display: none;
  }
}

/*MEDIA Max-Width = 935px */
@media screen and (max-width: 935px) {
  .sidebar {
    transform: translateX(-100%);
  }
  header,
  main,
  footer {
    width: 100%;
    margin-left: 0;
  }
  .burger-menu {
    display: flex;
  }
}

/*MEDIA Max-Width = 780px */
@media screen and (max-width: 780px) {
  .navbar {
    display: none;
  }
}

/*MEDIA Max-Width = 640px */
@media screen and (max-width: 640px) {
  .filter-sort-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-m);
  }
  .inline-display .card-text {
    flex-wrap: wrap;
  }
}

/*MEDIA Max-Width = 460px */
@media screen and (max-width: 460px) {
  body {
    font-size: var(--font-size-s);
  }
  .search-bar {
    width: 180px;
  }
  .search-bar img {
    width: 16px;
    height: 16px;
  }
  #search-bar {
    width: 150px;
  }
  .tag {
    font-size: var(--font-size-xs);
  }
}

/**==============================================
**               FENÊTRE MODALE
**===============================================**/
.modale {
  display: none;
  width: 100dvw;
  height: 100dvh;
  background: var(--neutral4-5);
  z-index: 100;
}
.modale-container {
  width: 100%;
  height: 100%;
}
/*# ----- Mode modaleMode = .modaleMode ----- #*/
.modale.modaleMode {
  display: block;
}

/**============== MODALE HEADER ===============*/
.modale-header {
  width: 100%;
  height: 80px;
  background: var(--neutral5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-m);
}

/*(1) Modale Header left */
.modale-header-left {
  display: flex;
  align-items: center;
}

/**=============== MODALE MAIN ================*/
.modale-main {
  width: 100%;
  height: calc(100% - 80px);
}
.modale-main-code,
.modale-main-view {
  height: 50%;
  padding: var(--spacing-m);
}

/*(1) Modale Main Code */
.modale-main-code-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: var(--spacing-xs);
  height: 100%;
}
.code-container {
  width: 33%;
  height: 100%;
  background: var(--neutral3-5);
  border-radius: var(--radius-s);
  display: flex;
  flex-direction: column;
}
.code-header {
  display: flex;
  padding: var(--spacing-s);
  align-items: center;
  justify-content: space-between;
  background: var(--neutral4);
}
.code-header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}
#closeModaleBtn {
  cursor: pointer;
}
.code-body {
  height: 100%;
  padding: var(--spacing-s);
  overflow: auto;
}

/*(2) Modale Main View */
.modale-main-view {
  background: var(--neutral5);
}
.view-snippet {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  border: 1px solid var(--color-border);
}
