: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;
  --bg-color: #1a1a1a;
  --button-bg: #16ab63;
  --button-bg-hover: #0f7041;
  --highlight-color: #b510bd;
}

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

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: var(--bodybackground);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}
.theme-label{
    color: var(--text-color);
}
/* Animazione stelle piccole */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 5s infinite;
}

.star.green {
  background-color: #16ab63;
  box-shadow: 0 0 6px #16ab63;
}

.star.purple {
  background-color: #b510bd;
  box-shadow: 0 0 6px #b510bd;
}

@keyframes twinkle {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) translateX(20px);
  }
}

/* Header stile - CORRETTO */
.index-header {
  text-align: center;
  padding: 10px 0;
  position: relative;
  z-index: 10;
}
.main-content {
  position: relative;
  z-index: 10;
}

/* Rimuovi il margin-bottom dall'header se presente */
.index-header {
  margin-bottom: 40px;
}

.index-header img {
  width: 150px;
  margin-bottom: 5px;
  transition: all 0.5s ease;
}

.index-header img:hover {
  transform: rotate(5deg) scale(1.1);
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.scritta-benvenuto:hover {
  transform: scale(1.02);
}
.scritta-benvenuto {
  width: 100vw;
  max-width: 2000px;
  min-width: 800px;
  height: auto;
  margin: 0 auto 20px auto; /* niente margini negativi */
  display: block;
  transition: transform 0.3s ease;
}

.logopum {
  width: 120px;
  height: auto;
  margin: 0 auto 20px auto; /* centrato sotto */
  display: block;
  transition: transform 0.3s ease;
}

.index-header h1 {
  font-size: 36px;
  color: var(--text-color);
  margin: 10px;
  background: linear-gradient(45deg, #16ab63, #b510bd, #f9359d);
  background-size: 300% 300%;
  animation: gradientShift 3s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-text {
  font-size: 17px;
  color: var(--text-color);
  margin: 30px auto; /* Aumenta il margine superiore e inferiore */
  padding: 25px; /* Aumenta il padding interno */
  max-width: 750px;
  line-height: 1.6;
  text-align: center;
  font-weight: 400;
  background: rgba(255,255,255,0.05);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.highlight {
  font-weight: bold;
  font-size: 30px;
  color: var(--text-color);
  position: relative;
  margin: 30px 0;
}

.highlight .version {
  color: var(--highlight-color);
  font-size: 30px;
  animation: pulse 2s infinite;
  text-shadow: 0 0 10px rgba(181, 16, 189, 0.5);
}

.button-hint {
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f9359d;
  margin-bottom: -10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
    /* Animazioni globali */
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes pulse {
      0% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.05);
      }
      100% {
        transform: scale(1);
      }
    }

    @keyframes gradientShift {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }

    /* Container pulsanti */
    .button-container {
      display: flex;
      flex-direction: column;
      gap: 20px;
      width: 90%;
      max-width: 800px;
      margin: 0 auto;
      position: relative;
      z-index: 10;
    }

    .button-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 15px;
      width: 100%;
    }

    .button-row.bottom-row {
      grid-template-columns: repeat(4, 1fr);
    }

    /* Pulsanti riga superiore (verdi) */
    .button-row:first-child a {
      text-decoration: none;
      background: linear-gradient(135deg, var(--button-bg), #0f7041);
      color: var(--text-color);
      padding: 20px;
      border-radius: 15px;
      text-align: center;
      font-weight: bold;
      font-size: 18px;
      transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      display: block;
      position: relative;
      overflow: hidden;
      box-shadow: 0 8px 25px rgba(0,0,0,0.2);
      border: 2px solid transparent;
      transform-style: preserve-3d;
    }

    /* Pulsanti riga inferiore (viola chiaro) */
    .button-row.bottom-row a {
      text-decoration: none;
      background: linear-gradient(135deg, #9574CA, #C5B1E3);
      color: var(--text-color);
      padding: 20px;
      border-radius: 15px;
      text-align: center;
      font-weight: bold;
      font-size: 18px;
      transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      display: block;
      position: relative;
      overflow: hidden;
      box-shadow: 0 8px 25px rgba(0,0,0,0.2);
      border: 2px solid transparent;
      transform-style: preserve-3d;
    }

    .button-container a::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
      transition: left 0.6s;
    }

    .button-container a::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
      opacity: 0;
      transition: opacity 0.3s;
    }

    .button-container a:hover::before {
      left: 100%;
    }

    .button-container a:hover::after {
      opacity: 1;
    }

    /* Hover per pulsanti riga superiore (verdi) */
    .button-row:first-child a: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);
    }

    /* Hover per pulsanti riga inferiore (viola) */
    .button-row.bottom-row a:hover {
      background: linear-gradient(135deg, #7A5DA6, #A895C7);
      transform: translateY(-8px) rotateX(10deg);
      box-shadow: 0 15px 30px rgba(0,0,0,0.3);
      border-color: rgba(255,255,255,0.2);
    }

    .button-container a:active {
      transform: translateY(-2px) scale(0.98);
    }

    /* Footer */
    .index-footer {
      margin-top: 10px;
      text-align: center;
      font-size: 14px;
      color: #888;
      padding: 10px 0px;
      position: relative;
      z-index: 10;
    }

    .index-footer::before {
      content: '';
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100px;
      height: 2px;
      background: linear-gradient(90deg, transparent, var(--button-bg), transparent);
    }

    .social-icons {
      display: flex;
      justify-content: center;
      gap: 15px;
    }

    .social-icons a {
      margin: 0;
      text-decoration: none;
      color: var(--text-color);
      font-size: 24px;
      transition: all 0.4s ease;
      position: relative;
    }

    .social-icons a::before {
      content: '';
      position: absolute;
      top: -5px;
      left: -5px;
      right: -5px;
      bottom: -5px;
      background: var(--button-bg);
      border-radius: 50%;
      z-index: -1;
      opacity: 0;
      transform: scale(0.8);
      transition: all 0.3s ease;
    }

    .social-icons a:hover::before {
      opacity: 0.2;
      transform: scale(1.2);
    }

    .social-icons a:hover {
      color: #4CAF50;
      transform: scale(1.3) rotate(10deg);
    }

    .social-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 10px;
      padding: 0;
    }

    .social-container p {
      margin-bottom: 30px;
      font-size: 20px;
      position: relative;
    }

    .social-container p::after {
      content: '';
      position: absolute;
      bottom: -10px;
      left: 50%;
      transform: translateX(-50%);
      width: 50px;
      height: 3px;
      background: linear-gradient(90deg, var(--button-bg), var(--highlight-color));
      border-radius: 2px;
    }

    .social-container .social-icons {
      margin-top: 0px;
    }

    /* Toggle switches */
    .switch-container, .theme-toggle {
      display: flex;
      align-items: center;
      font-size: 16px;
      position: fixed;
      z-index: 1000;
    }

    .switch-container {
      top: 10px;
      left: 10px;
    }

    .theme-toggle {
      top: 10px;
      right: 10px;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 50px;
      height: 24px;
      margin: 0 8px;
    }

    .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;
      color: white;
      font-size: 12px;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 20px;
      width: 20px;
      left: 2px;
      bottom: 2px;
      background-color: #16ab63;
      transition: 0.4s;
      border-radius: 50%;
    }

    .language-slider:before {
      content: "IT";
    }

    .theme-slider:before {
      content: "TC";
    }

    input#theme-switch:checked + .slider {
      background-color: #ccc;
    }

    input#theme-switch:checked + .slider:before {
      transform: translateX(26px);
      content: "TS";
      background-color: white;
      color: black;
    }

    input#language-switch:checked + .slider {
      background-color: #ccc;
    }

    input#language-switch:checked + .slider:before {
      transform: translateX(26px);
      content: "EN";
      background-color: white;
      color: black;
    }
.patch-warning {
    background-color: #ffcccc;
    border: 3px solid #ff0000;
    border-radius: 10px;
    padding: 15px;
    margin: 20px auto;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.warning-title {
    color: #cc0000;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.warning-text {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.warning-highlight {
    color: #cc0000;
    font-size: 1.2em;
    margin: 5px 0;
}

/* Stile per tema scuro */
body.dark-mode .patch-warning {
    background-color: #660000;
    border-color: #ff6666;
}

body.dark-mode .warning-title {
    color: #ff9999;
}

body.dark-mode .warning-text {
    color: #fff;
}

body.dark-mode .warning-highlight {
    color: #ff9999;
}
    /* Popup */
    .popup {
      display: none;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: var(--bg-color);
      padding: 20px;
      box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
      border-radius: 10px;
      z-index: 1000;
      text-align: center;
      color: var(--h1color);
    }

    .popup-content button {
      margin: 10px;
      padding: 10px;
      border: none;
      cursor: pointer;
      transition: all 0.3s ease;

    }

    .popup-content button:hover {
      transform: scale(1.05);
    }

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

    #close-btn {
      background: #dc3545;
      color: white;
    }
    /* Donazione Ko-fi */
.donation-container {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(52, 58, 64, 0.9);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(22, 171, 99, 0.3);
  border-radius: 15px;
  padding: 20px 15px;
  text-align: center;
  max-width: 220px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.5s ease-out;
  transition: all 0.3s ease;
}

.donation-container:hover {
  border-color: rgba(22, 171, 99, 0.8);
  box-shadow: 0 15px 40px rgba(22, 171, 99, 0.2);
  transform: translateY(-50%) scale(1.02);
}

.donation-text {
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 15px;
  font-weight: 500;
}

.kofi-button {
  display: inline-block;
  transition: transform 0.3s ease;
}

.kofi-button:hover {
  transform: scale(1.1);
}

.kofi-image {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate(50px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* Responsive per mobile */
@media (max-width: 768px) {
  .donation-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    transform: none;
    max-width: 180px;
    padding: 15px 10px;
    animation: slideInUp 0.5s ease-out;
  }
  
  .donation-container:hover {
    transform: scale(1.02);
  }
  
  .donation-text {
    font-size: 14px;
  }
  
  .kofi-image {
    height: 35px;
  }
  
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(50px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
/* Contattaci Telegram a sinistra */
.contact-container {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--contact-bg, rgba(52, 58, 64, 0.9));
  backdrop-filter: blur(10px);
  border: 2px solid var(--contact-border, rgba(0, 136, 204, 0.3));
  border-radius: 15px;
  padding: 20px 15px;
  text-align: center;
  max-width: 250px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInLeft 0.5s ease-out;
  transition: all 0.3s ease;
}

.contact-container:hover {
  border-color: var(--contact-border-hover, rgba(0, 136, 204, 0.8));
  box-shadow: 0 15px 40px var(--contact-shadow, rgba(0, 136, 204, 0.2));
  transform: translateY(-50%) scale(1.02);
}

.contact-text {
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 15px;
  font-weight: 500;
}

.telegram-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0088cc, #005f8c);
  padding: 10px 15px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.telegram-button:hover {
  background: linear-gradient(135deg, #005f8c, #0088cc);
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 136, 204, 0.4);
}

.telegram-image {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.telegram-text {
  color: white;
  font-size: 14px;
  font-weight: bold;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translate(-50px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* Donazione Ko-fi (già esistente, aggiorniamo solo l'animazione) */
.donation-container {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--donation-bg, rgba(52, 58, 64, 0.9));
  border: 2px solid var(--donation-border, rgba(22, 171, 99, 0.3));
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px 15px;
  text-align: center;
  max-width: 220px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.5s ease-out;
  transition: all 0.3s ease;
}

.donation-container:hover {
  border-color: var(--donation-border-hover, rgba(22, 171, 99, 0.8));
  box-shadow: 0 15px 40px var(--donation-shadow, rgba(22, 171, 99, 0.2));
  transform: translateY(-50%) scale(1.02);
}

.donation-text {
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 15px;
  font-weight: 500;
}

.kofi-button {
  display: inline-block;
  transition: transform 0.3s ease;
}

.kofi-button:hover {
  transform: scale(1.1);
}

.kofi-image {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate(50px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

/* Responsive per mobile */
@media (max-width: 768px) {
  .contact-container {
    position: fixed;
    bottom: 90px;
    left: 20px;
    top: auto;
    transform: none;
    max-width: 200px;
    padding: 15px 10px;
    animation: slideInUp 0.5s ease-out;
  }
  
  .contact-container:hover {
    transform: scale(1.02);
  }
  
  .donation-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    transform: none;
    max-width: 180px;
    padding: 15px 10px;
    animation: slideInUp 0.5s ease-out;
  }
  
  .contact-text, .donation-text {
    font-size: 14px;
  }
  
  .telegram-button {
    padding: 8px 12px;
  }
  
  .telegram-text {
    font-size: 12px;
  }
  
  .telegram-image {
    width: 20px;
    height: 20px;
  }
  
  .kofi-image {
    height: 35px;
  }
  
  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(50px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
