/**
 * All of the CSS for the public-facing CSS source
 * for the MODEC resources table.
 */

#resources-table-container {
  width: 100%;
  position: relative;
  min-height: 500px;
}

#resources-table_filter {
  text-align: left;
  float: none;
  display: flex;
}

#resources-table_filter label {
  flex-grow: 1;
  display: flex;
  letter-spacing: .2px;
  height: 25px;
}

#resources-table_filter input {
  flex-grow: 1;
}

#resources-table tr.group,
#resources-table tr.group:hover {
  background-color: #ccc !important;
}

#resources-table tr.spacer:not(:first-child) td {
  padding: 15px 0 !important;
}

#resources-table-filter {
  margin-bottom: 1em;
}

#resources-filter-form {
  display: flex;
  flex-direction: column;
  gap: .5em;
}

/*#resources-types-filter {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
}*/

#resources-types-filter input[type="radio"] {
  display: none;
}

#resources-types-filter label {
  border-color: #ccc;
  border-radius: 2em;
  border-style: solid;
  border-width: 0.15em;
  padding: 0.25em 1em;
  font-size: 1.2rem;
  font-weight: 400;
  cursor: pointer;
  letter-spacing: .2px;
  height: 25px;
}

#resources-types-filter input[type="radio"]:checked+label {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white !important;
}

#resources-filter-form {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  column-gap: 0.25em;
  row-gap: 0.25em;
}

*:not(input[type="text"]) {
  caret-color: transparent;
}


.count-resources {
  display: none;
}

/*#resources-filter-form>div {
  width: 45%;
}*/

#resources-filter-form label {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: .2px;
  height: 25px;
}

#resources-filter-form select {
  /* -webkit-appearance: none; */
  border-color: #ccc;
  border-radius: 2em;
  border-style: solid;
  border-width: 0.15em;
  padding: .15em 1.25em .25em .35em;
  height: 100%;
  vertical-align: middle;
  font-size: 1.2rem;
  font-weight: 400;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  outline: none;
  cursor: pointer;
  letter-spacing: .2px;
  height: 25px;
}

#resources-products-filter, #resources-scopes-filter {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
  justify-content: center;
}

#resources-products-filter input[type="radio"], #resources-scopes-filter input[type="radio"] {
  display: none;
}

#resources-products-filter label, #resources-scopes-filter label {
  border-color: #ccc;
  border-style: solid;
  border-width: 1px;
  border-left-width: 0;
  padding: 0.25em 0.5em;
  cursor: pointer;
  letter-spacing: .2px;
  height: 25px;
  flex-grow: 1 !important;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  white-space: pre;
}

@media only screen and (max-width: 1200px){
  /*Tablets [601px -> 1200px]*/
}
@media only screen and (max-width: 600px){
/*Big smartphones [426px -> 600px]*/
  #resources-products-filter label, #resources-scopes-filter label{
    width: fit-content;
  }
  #resources-filter-form>.filter.dd{
    flex-basis: 40% !important;
  }
}
@media only screen and (max-width: 425px){
/*Small smartphones [325px -> 425px]*/
}

#resources-products-filter label:first-of-type, #resources-scopes-filter label:first-of-type {
  border-radius: 2em 0 0 2em;
  border-left-width: 1px;
}

#resources-products-filter label:last-of-type, #resources-scopes-filter label:last-of-type {
  border-radius: 0 2em 2em 0;
  border-left-width: 0;
}

.filter input[type="radio"][data-checked="1"] + label {
  background-color: var(--color-primary) !important;
  border-color: #ccc;
  color: white !important;
}

#resources-table thead tr th:first-of-type,
#resources-table tbody tr td:first-of-type {
  width: 100%;
}

#resources-table thead tr th:last-of-type,
#resources-table tbody tr td:last-of-type {
  max-width: 100%;
  white-space: nowrap;
}

#resources-table {
  border-bottom: none;
}

#resources-table tbody tr td {
  border-top: none;
}

#resources-table_info {
  display: none;
}

.count-resources {
  margin-top: 10px;
}

.hidden {
  display: none;
}

.selected {
  background-color: var(--color-primary);
  color: white !important;
}


.selected option {
  background-color: var(--color-on-primary);
  color: #374037 !important;
}

.search-bar {
  border-color: #ccc;
  border-radius: 2em;
  border-style: solid;
  border-width: 0.15em;
  font-size: 1.2rem;
  font-weight: 400;
  padding: 0 10px;
  cursor: pointer;
  outline: none;
}

.ouro {
  position: relative;
  display: inline-block;
  height: 46px;
  width: 46px;
  margin: 1em;
  border-radius: 50%;
  background: none repeat scroll 0 0 #DDDDDD;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1) inset, 0 0 25px rgba(0, 0, 255, 0.075);
}

.ouro:after {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  display: block;
  height: 28px;
  width: 28px;
  background: none repeat scroll 0 0 #F2F2F2;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1);
}

.ouro>span {
  position: absolute;
  height: 100%;
  width: 50%;
  overflow: hidden;
}

.left {
  left: 0
}

.right {
  left: 50%
}

.anim {
  position: absolute;
  left: 100%;
  top: 0;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: none repeat scroll 0 0 var(--color-primary);
  -webkit-animation: ui-spinner-rotate-left 1s infinite;
  animation: ui-spinner-rotate-left 1s infinite;
  -webkit-transform-origin: 0 50% 0;
  transform-origin: 0 50% 0;
}

.left .anim {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}

.right .anim {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  left: -100%;
  -webkit-transform-origin: 100% 50% 0;
  transform-origin: 100% 50% 0;
}

/* v2 */
.ouro2 .anim {
  -webkit-animation-delay: 0;
  animation-delay: 0;
}

.ouro2 .right .anim {
  -webkit-animation-delay: .5s;
  animation-delay: .5s;
}

/* round variation */
.round .ouro:after {
  display: none
}

/* double variation */
.double .ouro:after {
  height: 13px;
  width: 13px;
  left: 7px;
  top: 7px;
  border: 10px solid #ddd;
  background: transparent;
  box-shadow: none;
}

@keyframes ui-spinner-rotate-right {
  0% {
    transform: rotate(0deg)
  }

  25% {
    transform: rotate(180deg)
  }

  50% {
    transform: rotate(180deg)
  }

  75% {
    transform: rotate(360deg)
  }

  100% {
    transform: rotate(360deg)
  }
}

@keyframes ui-spinner-rotate-left {
  0% {
    transform: rotate(0deg)
  }

  25% {
    transform: rotate(0deg)
  }

  50% {
    transform: rotate(180deg)
  }

  75% {
    transform: rotate(180deg)
  }

  100% {
    transform: rotate(360deg)
  }
}

@-webkit-keyframes ui-spinner-rotate-right {
  0% {
    -webkit-transform: rotate(0deg)
  }

  25% {
    -webkit-transform: rotate(180deg)
  }

  50% {
    -webkit-transform: rotate(180deg)
  }

  75% {
    -webkit-transform: rotate(360deg)
  }

  100% {
    -webkit-transform: rotate(360deg)
  }
}

@-webkit-keyframes ui-spinner-rotate-left {
  0% {
    -webkit-transform: rotate(0deg)
  }

  25% {
    -webkit-transform: rotate(0deg)
  }

  50% {
    -webkit-transform: rotate(180deg)
  }

  75% {
    -webkit-transform: rotate(180deg)
  }

  100% {
    -webkit-transform: rotate(360deg)
  }
}

.circle {
  position: absolute;
  top: 175px;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 100;
}

.circle.hide {
  display: none;
}

#resources-search {
  padding: 0;
  position: relative;
  display: flex;
}

#resources-search #search {
  height: 25px;
  caret-color: var(--color-primary);
  color: #374037;
  letter-spacing: 1px;
}

#resources-search #search-btn {
  position: absolute;
  font-size: 12px;
  line-height: calc(25px - 0.25em);
  width: 25px;
  padding-right: 2px;
  background: var(--color-primary);
  top: 0;
  right: 0;
  text-align: center;
  color: white;
  border-top-right-radius: 2em;
  border-bottom-right-radius: 2em;
  cursor: pointer;
  outline: none;
  border-color: #ccc;
  border-width: 0.15em;
  border-style: solid;
  display: flex;
  height: 25px;
  justify-content: center;
  align-items: center;
}

#resources-search #empty-search-btn {
  position: absolute;
  right: 25px;
  font-size: 15px;
  line-height: 32px;
  width: 15px;
  height: 25px;
  padding-right: 2px;
  background: transparent;
  top: 0px;
  text-align: center;
  color: #cd5555;
  cursor: pointer;
  outline: none;
  caret-color: transparent;
  display: none;
}

#resources-search #search-btn .icon {
  transform: scale(.9, .9);
  transition: transform .33s ease 0s;
  cursor: pointer;
  outline: none;
  caret-color: transparent;
  fill: white;
}

#resources-search #search-btn:hover .icon {
  transform: scale(1, 1);
  transition: transform .33s ease 0s;
}


#resources-search #empty-search-btn i {
  opacity: .75;
  transition: all .33s ease 0s;
}

#resources-search #empty-search-btn:hover i {
  opacity: 1;
  transition: all .33s ease 0s;
}

*:focus,
*::before {
  outline: none !important;

}

#search {
  min-width: 100px;
}

/* Styles pour les écrans larges (desktop) */
@media screen and (min-width: 768px) {

  .colonne1,
  .colonne2 {
    display: table-cell !important;
  }
}

/* Styles pour les écrans étroits (mobile) */
@media screen and (max-width: 767px) {
  #resources-table>thead {
    display: none;
  }

  .colonne1,
  .colonne2 {
    display: block !important;
    /* Chaque colonne devient un bloc */
    width: 100%;
    /* Remplit la largeur de l'écran */
    padding: 5px 0 !important;
  }

  .colonne1 {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .colonne2 {
    position: relative;
    padding-top: 25px !important;
  }

  .colonne2::before {
    font-size: 12px;
    color: #333;
    position: absolute;
    top: 0;
    left: 5px;
  }

  #resources-table-container[data-locale*="fr"] .colonne2::before {
    content: "Télécharger";
  }

  #resources-table-container[data-locale*="en"] .colonne2::before {
    content: "Download";
  }

  #resources-table-container[data-locale*="es"] .colonne2::before {
    content: "Descargar";
  }

  #resources-table-container[data-locale*="de"] .colonne2::before {
    content: "Herunterladen";
  }

  #resources-table {
    width: 100% !important;
  }

  tr {
    display: block !important;
    /* Chaque ligne devient un bloc */
    margin-bottom: 1rem !important;
    /* Ajoute un espace entre les lignes */
  }
}

#resources-filter-form>.filter {
  flex-grow: 1;
}

#resources-filter-form>.filter.dd{
  flex-basis: 25%;
}

#resources-filter-form> #resources-search{
  flex-basis: 30%;
}
#resources-filter-form>.filter input,
#resources-filter-form>.filter select {
  width: 100% !important;
}

@media screen and (max-width: 1120px) {}

@media screen and (max-width: 992px) {
  #resources-filter-form {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 768px) {

  #resources-language-filter,
  #resources-power-range-filter,
  #resources-motor-filter,
  #resources-types-filter {
    width: 45%;
  }
}

@media screen and (max-width: 480px) {
  #resources-filter-form>div {
    width: 100%;
  }
}

/* ============================================
   CUSTOM DROPDOWN STYLES - À ajouter à votre CSS
============================================ */
.custom-dropdown-container{
  display: flex;
  gap:.25em;
}

.custom-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}

#resources-language-filter .custom-dropdown{
  width: 140px;
}
#resources-power-range-filter .custom-dropdown,
#resources-motor-filter .custom-dropdown{
  width: 115px;
}
#resources-types-filter .custom-dropdown{
  width: 180px;
}

.custom-dropdown.disabled {
  opacity: 0.6;
  pointer-events: none;
}
.custom-dropdown.selected {
  background-color: transparent !important;
}

/* Custom dropdown trigger */
.dropdown-trigger {
  padding: 5px 3px 5px 5px;
  background: white;
  border: 2px solid #e1e8ed;
  border-radius: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #333;
  height: 24px;
  font-family: inherit;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.dropdown-trigger:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.custom-dropdown.open .dropdown-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
  /*border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;*/
}

.custom-dropdown.selected .dropdown-trigger {
  border-color: var(--color-primary);
  background-color: #fff;
}

.dropdown-trigger .text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
  line-height: 24px;
}

.dropdown-trigger .arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #666;
  transition: transform 0.2s ease;
  margin-left: 2px;
  flex-shrink: 0;
}

.custom-dropdown.open .dropdown-trigger .arrow {
  transform: rotate(180deg);
}

/* Desktop dropdown list */
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #9b9b9b;
  border-radius: .5em;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  width: 100%;
}

.custom-dropdown.open .dropdown-list {
  display: block;
}

.dropdown-option {
  padding: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 12px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--paragraph-color);
  letter-spacing: 0;
  line-height: 24px;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background-color: #f8f9fa;
}

.dropdown-option.selected {
  background-color: var(--color-primary);
  color: white;
}

.dropdown-option.hidden {
  display: none !important;
}

/* OVERLAY pour mobile */
.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Lock body scroll when dropdown is open on mobile */
body.dropdown-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Mobile styles */
@media (max-width: 768px) {
  .custom-dropdown-container{
    flex-wrap: wrap;
  }
  .custom-dropdown{
    width: 100% !important;
  }

  .dropdown-list {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0.9);
      width: 90vw;
      max-width: 400px;
      max-height: 70vh;
      border-radius: 12px;
      border: none;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
      opacity: 0;
      transition: all 0.2s ease;
      z-index: 1000;
  }

  .custom-dropdown.open .dropdown-list {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
  }

  .dropdown-option {
      padding: 16px 20px;
      font-size: 16px;
      border-bottom: 1px solid #f0f0f0;
  }

  .dropdown-option:first-child {
      border-top-left-radius: 12px;
      border-top-right-radius: 12px;
  }

  .dropdown-option:last-child {
      border-bottom-left-radius: 12px;
      border-bottom-right-radius: 12px;
      border-bottom: none;
  }

  .filter.dd {
    flex-grow: 1;
  }
}

/* Responsive filter layout */
@media (max-width: 768px) {
  #resources-filter-form {
      display: flex;
      flex-direction: column;
      gap: 10px;
  }
  
  .filter {
      width: 100%;
  }
}

/* Ensure proper stacking order */
.custom-dropdown {
  z-index: 1;
}

.custom-dropdown.open {
  z-index: 1001;
}

/* Accessibility improvements */
.dropdown-trigger:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.dropdown-option:focus {
  background-color: #e6f3ff;
  outline: none;
}

/* Animation for smooth transitions */
.dropdown-list {
  transform-origin: top center;
}

@media (min-width: 769px) {
  .dropdown-list {
      animation: fadeInDown 0.15s ease-out;
  }
}

@keyframes fadeInDown {
  from {
      opacity: 0;
      transform: translateY(-10px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}