:root {
  --navbarbackground: #1a1a1a;
  --navbarcolor: #fff;
  --formcontainerbackground: #1a1a1a;
  --formcontainercolor: #fff;
  --h1backgroundcolor: #1a1a1a;
  --h1color: white;
  --thchildcolor: #666666;
  --tdcolor: #555555;
  --thcolor: white;
  --bodybackground: #1a1a1a;
  --sconosciutavar: #545454;
  --thtdcolor: white;
  --tdacolor: #B57EDC;
  --tdahover: #FFB6C1;
  --tdactive: #8E44AD;
  --text-color: #fff;
  --button-bg: #16ab63;
}

/* Animazioni globali */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

body {
  font-family: Arial, sans-serif;
  background-color: var(--bodybackground);
  margin: 0;
  padding: 0;
}

#filter-status-dropdown, #filter-translation-dropdown, #filter-category-dropdown {
  opacity: 0;
  transition: opacity 0.3s ease;
}

td a {
  color: var(--tdacolor);
}

td a:visited {
  color: var(--tdacolor);
}

td a:hover {
  color: var(--tdahover);
}

td a:active {
  color: var(--tdactive);
}

/* Language toggle fisso in alto a destra */
.language-toggle {
  position: sticky;  /* Cambiato da fixed a sticky */
  top: 20px;
  right: 55px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-color);
  z-index: 1002;
  float: right;  /* Aggiunto per mantenere l'allineamento a destra */
}

.theme-toggle {
  position: sticky;  /* Cambiato da fixed a sticky */
  top: 50px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-color);
  z-index: 1002;
  float: right;  /* Aggiunto per mantenere l'allineamento a destra */
  clear: right;  /* Aggiunto per posizionarlo sotto language-toggle */
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #16ab63;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Titolo */
h1 {
  color: var(--h1color);
  font-size: 2rem;
  margin: 0;
  padding: 20px 0;
  background-color: var(--h1backgroundcolor);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  background-color: var(--navbarbackground);
  padding: 10px;
  border-bottom: 3px solid #f9359d;
  animation: slideInFromTop 0.5s ease-out;
  position: relative;
  z-index: 1;
}

.tooltip {
  position: absolute;
  background-color: var(--h1backgroundcolor);
  color: var(--h1color);
  padding: 5px 15px;
  border-radius: 5px;
  font-size: 14px;
  display: none;
  z-index: 1000;
  width: auto;
  min-width: 150px;
  text-align: left;
  max-width: none;
}

.mod-name {
  position: relative;
}

.mod-name .tooltip {
  display: none;
  position: absolute;
  top: 0;
  left: 80%;
  transform: translateX(10px);
  background-color: var(--h1backgroundcolor);
  color: var(--h1color);
  padding: 5px 15px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 1000;
  text-align: left;
}

.mod-name:hover .tooltip {
  display: block;
}

.navbar a, .navbar button {
  color: var(--navbarcolor);
  text-decoration: none;
  background: linear-gradient(135deg, var(--button-bg), #0f7041);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  margin: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: 16px;
  text-align: center;
  font-weight: bold;
}

.navbar a:hover, .navbar button:hover {
    background: linear-gradient(135deg, #0f7041, var(--button-bg));
    transform: translateY(-8px) rotateX(10deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

.sort-arrow {
  margin-left: 5px;
  font-size: 20px;
  color: var(--h1color);
}

.sort-arrow.asc:before {
  content: "↑";
}

.sort-arrow.desc:before {
  content: "↓";
}

.scroll-to-top {
  position: fixed;  /* Cambiato da sticky a fixed */
  bottom: 30px;
  right: 30px;
  display: none;
  width: 55px;
  height: 55px;
  background: linear-gradient(145deg, #c77dff 0%, #7ed957 100%);
  color: white;
  text-align: center;
  line-height: 55px;
  font-size: 28px;
  font-weight: bold;
  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(199, 125, 255, 0.4), 0 5px 10px rgba(126, 217, 87, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
  border: none;
  backdrop-filter: blur(5px);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0px);
  }
}

.scroll-to-top:hover {
  background: linear-gradient(145deg, #b85eff 0%, #6bcB3d 100%);
  transform: scale(1.2) rotate(360deg);
  box-shadow: 0 15px 35px rgba(199, 125, 255, 0.6), 0 8px 15px rgba(126, 217, 87, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.scroll-to-top:active {
  transform: scale(0.9);
  box-shadow: 0 5px 15px rgba(199, 125, 255, 0.4), 0 3px 8px rgba(126, 217, 87, 0.3);
}

.back-arrow {
  position: sticky;
  top: 10px;
  left: 10px;
  text-decoration: none;
  font-size: 20px;
  color: #16ab63;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 1001;
  background: rgba(52, 58, 64, 0.95);
  padding: 8px 15px;
  border-radius: 25px;
  border: 2px solid #16ab63;
  animation: fadeInUp 0.5s ease-out;
}

.back-arrow:hover {
  color: #16ab63;
  transform: scale(1.1) translateX(-5px);
  background: rgba(22, 171, 99, 0.2);
  box-shadow: 0 5px 15px rgba(22, 171, 99, 0.3);
}

input, select {
  margin: 10px 5px;
  padding: 10px;
  border-radius: 25px;
  border: 1px solid #ccc;
  font-size: 16px;
}

input:focus, select:focus {
  outline: none;
  border-color: #16ab63;
}

/* Form container che scorre con tutto il resto */
.form-container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  margin-top: 0px;
  margin-bottom: 0px;
  padding: 5px;
  border: 1px solid var(--formcontainerbackground);
  border-radius: 5px;
  background-color: var(--formcontainerbackground);
  color: var(--formcontainercolor);
  gap: 60px;
  background-color: var(--formcontainerbackground);
  animation: fadeInUp 0.5s ease-out 0.2s both;
}


.form-container label {
  margin-right: 10px;
  font-size: 16px;
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Contenuto principale */
.main-content {
  position: relative;
  z-index: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  border-radius: 10px;
  overflow: hidden;
  table-layout: auto;
}

th, td {
  padding: 15px 20px;
  text-align: center;
  border: 1px solid #ddd;
  font-size: 16px;
  word-wrap: break-word;
  color: var(--thtdcolor)
}

th {
  background: linear-gradient(135deg, #9574CA, #C5B1E3);
  color: var(--thcolor);
}

td {
  background-color: var(--tdcolor);
}

tr:nth-child(even) td {
  background-color: var(--thchildcolor);
}

.status {
  font-weight: bold;
  padding: 5px;
  border-radius: 5px;
  display: inline-block;
  width: auto;
  height: auto;
  text-transform: uppercase;
  color: white;
}

.traduzione.compatibile {
  background-color: #008eff;
  color: white; 
}
.traduzione.aggiornata {
  background-color: #00d517;
  color: white; 
}
.traduzione.da-aggiornare {
  background-color: blue;
  color: white; 
}

.traduzione.da-controllare {
    background-color: #000000;
    color: white; 
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}

.traduzione.non-disponibile {
    background-color: #b174e7; 
    color: white; 
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}


.traduzione.nuova {
    background-color: #6b1fad;
    color: white; 
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}
.traduzione {
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
  text-align: center;
  display: inline-block;
  white-space: nowrap;
}
.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--navbarbackground);
  color: var(--navbarcolor);
  padding: 20px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  z-index: 1000;
  text-align: center;
}

.popup-content button {
  margin: 10px;
  padding: 10px;
  border: none;
  cursor: pointer;
}

#download-btn {
  background: #28a745;
  color: white;
}

#close-btn {
  background: #dc3545;
  color: white;
}

@media (max-width: 600px) {
  .tooltip {
    font-size: 12px;
    max-width: 80%;
    left: 50%;
    transform: translateX(-50%);
  }
  
  h1 {
    font-size: 1.5rem;
    padding: 10px;
  }

  .navbar a, .navbar button {
    font-size: 14px;
    padding: 10px;
    width: 100%;
  }

  .form-container {
    flex-direction: column;
    align-items: flex-start;
  }
}

.star-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.star {
  font-size: 24px;
  cursor: pointer;
  color: grey;
  transition: transform 0.2s;
}

.star.favorite {
  color: gold;
}

.star:hover {
  transform: scale(1.2);
}

/* Riduzione dimensioni colonne specifiche */
#mods-table th:nth-child(1), /* PREFERITE */
#mods-table td:nth-child(1) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

#mods-table th:nth-child(2), /* AUTORE */
#mods-table td:nth-child(2) {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

#mods-table th:nth-child(3), /* MOD */
#mods-table td:nth-child(3) {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  word-wrap: break-word;
  white-space: normal;
}

/* Assicurati che il testo nelle celle ridotte si adatti */
#mods-table td {
  font-size: 14px;
  padding: 10px 8px;
  word-break: break-word;
}

/* Riduci ulteriormente il padding per le colonne strette */
#mods-table th:nth-child(1),
#mods-table td:nth-child(1),
#mods-table th:nth-child(2),
#mods-table td:nth-child(2) {
  padding: 8px 5px;
}

/* Migliora la visualizzazione delle stelle nelle colonne ridotte */
.star-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.star {
  font-size: 20px;
}

/* Colonne ultra compatte */
#mods-table th:nth-child(1), /* PREFERITE */
#mods-table td:nth-child(1) {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  padding: 5px 2px;
}

/* ALLARGATA - DATA ULTIMA MODIFICA */
#mods-table th:nth-child(6), /* DATA ULTIMA MODIFICA */
#mods-table td:nth-child(6) {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  padding: 10px 8px;
  font-size: 14px;
}

/* ALLARGATA - TRADUZIONE */
#mods-table th:nth-child(7), /* TRADUZIONE */
#mods-table td:nth-child(7) {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  padding: 10px 8px;
}

/* ALLARGATA - STATO */
#mods-table th:nth-child(4), /* STATO */
#mods-table td:nth-child(4) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  padding: 8px 5px;
}

/* Riduzione AUTORE e MOD */
#mods-table th:nth-child(2), /* AUTORE */
#mods-table td:nth-child(2) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding: 8px 5px;
}

#mods-table th:nth-child(3), /* MOD */
#mods-table td:nth-child(3) {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  padding: 8px 5px;
}

/* Stelle più piccole per colonna ultra stretta */
.star {
  font-size: 18px;
}

/* Testo più compatto per le colonne ridotte */
#mods-table td:nth-child(6) {
  font-size: 14px;
  line-height: 1.2;
}

/* Status e traduzione - testo più leggibile */
.status, .traduzione {
  padding: 4px 8px;
  font-size: 12px;
  display: inline-block;
  text-align: center;
  width: auto;
  min-width: 80px;
  box-sizing: border-box;
  white-space: nowrap;
}

/* Status colors - mantenuti ma con testo più leggibile */
.status.nuova {
  background-color: #6b1fad;
  color: white;
}

.status.obsoleta {
  background-color: #7a4900;
  color: white;
}

.status.compatibile {
  background-color: #008eff;
  color: white;
}

.status.rotta {
  background-color: #cc0000;
  color: white;
}

.status.sconosciuta {
  background-color: #737373;
  color: white;
}

.status.aggiornata {
  background-color: #00d517;
  color: white;
}

/* Traduzione colors - migliorata leggibilità */
.traduzione.inclusa {
  background-color: #f6c400;
  color: white;
}

.traduzione.non-necessaria {
  background-color: #ff751f;
  color: white;
}

.traduzione.in-lavorazione {
  background-color: #ff1fa9;
  color: white;
}

.traduzione.da-scaricare {
  background-color: #ff9800;
  color: white;
}

/* Link più compatti */
#mods-table td:nth-child(5) {
  padding: 8px 5px;
}
/* Aggiungi queste regole alla fine del file */

/* Larghezza specifica per ogni colonna */
#mods-table th:nth-child(1), /* AUTORE */
#mods-table td:nth-child(1) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding: 8px 5px;
}

#mods-table th:nth-child(2), /* MOD */
#mods-table td:nth-child(2) {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  padding: 8px 5px;
}

#mods-table th:nth-child(3), /* STATO PATCH */
#mods-table td:nth-child(3) {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  padding: 8px 5px;
}

#mods-table th:nth-child(4), /* DATA ULTIMO AGGIORNAMENTO */
#mods-table td:nth-child(4) {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  padding: 8px 5px;
}

#mods-table th:nth-child(5), /* STATO TRADUZIONE */
#mods-table td:nth-child(5) {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  padding: 8px 5px;
}

#mods-table th:nth-child(6), /* TRADUTTORE */
#mods-table td:nth-child(6) {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  padding: 8px 5px;
}

#mods-table th:nth-child(7), /* DATA TRADUZIONE */
#mods-table td:nth-child(7) {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  padding: 8px 5px;
}

#mods-table th:nth-child(8), /* MOD RICHIESTE */
#mods-table td:nth-child(8) {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  padding: 8px 5px;
}

#mods-table th:nth-child(9), /* DLC RICHIESTI */
#mods-table td:nth-child(9) {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  padding: 8px 5px;
}

/* Stili per le stelle dei preferiti */
.author-with-star {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.author-with-star .star {
  font-size: 18px;
  cursor: pointer;
  color: #ccc;
  transition: all 0.2s ease;
}

.author-with-star .star.favorite {
  color: gold;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.author-with-star .star:hover {
  transform: scale(1.2);
}

/* Assicura che il testo sia leggibile anche nelle colonne strette */
#mods-table td {
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Permetti lo scrolling orizzontale su mobile */
@media (max-width: 768px) {
  .main-content {
    overflow-x: auto;
  }
  
  #mods-table {
    min-width: 800px;
  }
}


/* Aggiungi alla fine di tables.css */

/* TOOLTIP GLOBALE */
.global-tooltip {
  position: fixed !important;
  z-index: 10000 !important;
  background-color: rgba(0, 0, 0, 0.95) !important;
  color: white !important;
  padding: 12px !important;
  border-radius: 6px !important;
  max-width: 350px !important;
  min-width: 200px !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.4) !important;
  pointer-events: none !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  opacity: 1 !important;
  visibility: visible !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Assicurati che il tooltip nella cella sia nascosto */
.tooltip {
  display: none !important;
}

/* Rimuovi lo stile che mostra il tooltip al passaggio del mouse */
.mod-name:hover .tooltip {
  display: none !important;
}
.navbar a.active {
  background-color: #0f7041 !important;
  border: 2px solid #8e61d6!important;
  box-shadow: 0 0 10px rgb(199, 192, 255);
  transform: scale(1.05);
}

/* Stile per il container autore con stellina */
.author-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Stile per la stellina preferiti */
.star {
    cursor: pointer;
    font-size: 1.2em;
    color: #ccc;
    transition: color 0.3s;
    display: inline-block;
    user-select: none;
}

.star:hover {
    color: #ffd700;
}

.star.favorite {
    color: #ffd700;
}
/* Stili per il tooltip delle descrizioni */
.author-tooltip {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Per dispositivi mobili */
@media (max-width: 768px) {
    .author-tooltip {
        max-width: 250px;
        font-size: 12px;
        padding: 6px 10px;
    }
}

.mod-requirement-link {
    color: #2196F3;
    text-decoration: none;
    border-bottom: 1px dashed #2196F3;
    cursor: pointer;
    font-weight: 500;
}

.mod-requirement-link:hover {
    color: #0b7dda;
    border-bottom: 1px solid #0b7dda;
    background-color: rgba(33, 150, 243, 0.05);
}

/* Stile per l'evidenziazione quando si clicca su un link */
.highlight-row {
    animation: highlightFade 2s ease-out;
}

@keyframes highlightFade {
    0% { background-color: #ffff99; }
    70% { background-color: #ffff99; }
    100% { background-color: transparent; }
}
