.autocomplete-items {
    background-color: #000;
}

#tds-search {
  background-color: #e1e1e1;
  color: black;
}

/* Suggerimenti */
.autocomplete-items div {
  border-bottom: 1px solid #111;
}

.autocomplete-items div:hover {
  background-color: #a0a0a0;
}

.testo-titoli {
  color: #fff;
}

#theme-icon {
  fill: #fff;
}
.tds-contenitore {
  background-color: #121212;
}

.tds-icon {
  fill: currentColor;
}
#tds-view-toggle button {
  color: #fff;
}
#tds-view-toggle button.active {
  color: #DA291C;
}
/* === GENERALE === */

#tds-filter-bar {
  background-color: #121212;
}

#tds-search {
  flex: 1;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background-color: #1e1e1e;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
}

#tds-controls-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom:10px;
}

#tds-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

#tds-dropdowns {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
}

#tds-dropdowns select {
  flex: 1 1 0;
  min-width: 100px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 0.5rem 1rem 0.5rem 1rem;
  padding-right: 2rem;
  font-size: 1rem;
  background-color: #1e1e1e;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path fill="white" d="M0 0l5 6 5-6z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.65rem auto;
}

#tds-view-toggle {
  display: flex;
  gap: 0.25rem;
}

#tds-view-toggle button {
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  width: 42px;
  fill:#fff;
}

#tds-view-toggle button.active {
  background-color: #333;
}

/* === TABELLA === */
.tds-table-scroll {
  position: relative;
}

#tds-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 20px;
}

#tds-table th,
#tds-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #333;
  vertical-align: top;
  word-break: break-word;
  color:#fff;
}

#tds-table thead th {
  position: static;
  background-color: #1e1e1e;
  font-weight: bold;
  color: #fff;
}

#tds-table tbody tr:hover {
  background-color: #222;
}

/* === MOBILE TABELLA COMPATTA === */
@media (max-width: 768px) {
  #tds-table thead {
    display: none;
  }

  #tds-table,
  #tds-table tbody,
  #tds-table tr,
  #tds-table td {
    display: block;
    width: 100%;
  }

  #tds-table tr {
    margin-bottom: 1rem;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.5rem;
  }

  #tds-table td {
    padding: 0.2rem 0;
    border: none;
  }

  #tds-table td::before {
    content: none !important;
  }

  .tds-mobile-links {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }

  .tds-mobile-links a {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    color: #4da6ff;
    text-decoration: underline;
    padding: 0.3rem;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #1e1e1e;
  }

  .tds-mobile-links a:hover {
    background-color: #2a2a2a;
    text-decoration: none;
  }
}

/* === GRIGLIA === */
#tds-grid-wrapper {
  position: relative;
}

#tds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 20px;
}

@media (min-width: 768px) {
  #tds-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tds-card {
  background-color: #1a1a1a;
  padding: 1rem;
  border: 1px solid #333;
  border-radius: 6px;
  color: #eee;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.tds-codice {
  font-family: "Fira Sans Condensed", sans-serif;
  font-size: 23px;
  font-weight: 300;
  color: #fff;
}

.tds-nome {
  font-family: "Fira Sans Condensed", sans-serif;
  font-size: 21px;
  font-weight: 600;
  color: #ccc;
  min-height: 2em;
}

.tds-pagina {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tds-pagina::before {
  content: attr(data-category);
  font-family: "Fira Sans Condensed", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #aaa;
  margin-bottom: 0.25rem;
}

.tds-links {
  display: flex;
  gap: 1rem;
}

.tds-links:empty {
  display: none;
}

.tds-links a {
  flex: 1;
  text-align: center;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.7rem;
  border: 1px solid #000;
  border-radius: 4px;
  background-color: #000;
  padding: 0.5rem 0.25rem;
  text-transform: uppercase;
  font-weight: 700;
}

.tds-links a:hover {
  background-color: #3e3e3e;
  color: #000;
  text-decoration: none;
}

/* === IMMAGINI === */
td[data-label="Preview"] {
  display: none;
}

.tds-card .render {
  display: block;
  width: 100%;
  height: 172px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

#toggle-theme {
  background-color: #1e1e1e;
  border-color: #444;
}

.tds-table-scroll table#tds-table tbody td a:hover {
  color: #fff;
}