

/*******************************************/

/* Stili per la tavola periodica */
#periodic-table-modal {
  width: auto;
  /* Aumentato per adattarsi a 18 colonne */
  height: auto;
  padding: 20px;
}

.periodic-table {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 4px;
  max-width: 1000px;
  width: auto;
  height: auto;
  border-radius: 8px;
  margin: 0 10px;
}

.element {
  border: none;
  border-radius: 3px;
  padding: 8px 4px;
  text-align: center;
  font-size: 0.7em;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(45deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.5) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.element:hover {
  transform: scale(1.05) translateY(-2px);
  z-index: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.atomic-number {
  font-size: 0.75em;
  display: block;
  opacity: 0.7;
}

.symbol {
  font-weight: bold;
  font-size: 1.2em;
  display: block;
  margin: 1px 0;
}

.name {
  font-size: 0.55em;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colori per gruppi di elementi con gradienti */
.alkali-metal {
  background: linear-gradient(45deg, #ffedad, #ffd700);
}

.alkaline-earth {
  background: linear-gradient(45deg, #ffddb0, #ffb347);
}

.transition-metal {
  background: linear-gradient(45deg, #ffc0c0, #ff69b4);
}

.post-transition-metal {
  background: linear-gradient(45deg, #cccccc, #a9a9a9);
}

.metalloid {
  background: linear-gradient(45deg, #ccf, #b19cd9);
}

.nonmetal {
  background: linear-gradient(45deg, #a0ffa0, #00ff7f);
}

.halogen {
  background: linear-gradient(45deg, #ff9999, #ff6347);
}

.noble-gas {
  background: linear-gradient(45deg, #c0ffff, #40e0d0);
}

.lanthanide {
  background: linear-gradient(45deg, #ffbfff, #ff00ff);
}

.actinide {
  background: linear-gradient(45deg, #ff99cc, #ff1493);
}

.lanthanides-actinides {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  margin-top: 20px;
}

.spacer {
  grid-column: span 3;
}

/* Legenda */
.legend {
  color: rgb(0, 0, 0);
  max-width: 1000px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 0.8em;
}

.legend-color {
  width: 20px;
  height: 20px;
  margin-right: 5px;
  border-radius: 3px;
}

/* Animazioni */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.element {
  animation: fadeIn 0.5s ease-out;
}

/* Stili per il modal dei dettagli */
.element-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-in-out;
}

/* Responsive design */
@media (max-width: 768px) {
  .periodic-table {
    grid-template-columns: repeat(9, 1fr);
  }
}

@media (max-width: 480px) {
  .periodic-table {
    grid-template-columns: repeat(6, 1fr);
  }
}

/*******************************************/