.logo.vanilla:hover {
  filter: drop-shadow(0 0 2em #ffe21c);
}
:root {
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;

  color: #0f0f0f;
  background-color: #f6f6f6;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

.container {
  margin: 0;
  padding-top: 10vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-bottom: 8rem;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: 0.75s;
}

.logo.tauri:hover {
  filter: drop-shadow(0 0 2em #24c8db);
}

.row {
  display: flex;
  justify-content: center;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}

a:hover {
  color: #535bf2;
}

h1 {
  text-align: center;
}

input,
button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  color: #0f0f0f;
  background-color: #ffffff;
  transition: border-color 0.25s;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
}
button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.8em 1.5em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
  width: 100%;
}

button {
  cursor: pointer;
}

button:hover {
  border-color: #396cd8;
}
button:active {
  border-color: #396cd8;
  background-color: #e8e8e8;
}

input,
button {
  outline: none;
}

#greet-input {
  margin-right: 5px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color: #f6f6f6;
    background-color: #2f2f2f;
  }

  a:hover {
    color: #24c8db;
  }

  input,
  button {
    color: #ffffff;
    background-color: #0f0f0f98;
  }
  button:active {
    background-color: #0f0f0f69;
  }
}

:root {
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

h1 {
  font-size: 2.2em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

p {
  color: #a0a0a0;
  max-width: 500px;
  margin: 0 auto 2rem auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  text-align: left;
  margin-bottom: 2rem;
}

label {
  font-weight: bold;
  margin-bottom: -0.5rem;
}

input[type="file"],
textarea {
  width: 100%;
  padding: 0.6em 0.8em;
  border-radius: 8px;
  border: 1px solid transparent;
  background-color: #1a1a1a;
  box-sizing: border-box;
  transition: border-color 0.25s;
}

input[type="file"] {
    color: #a0a0a0;
}

textarea {
  font-family: inherit;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #646cff;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.8em 1.5em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
  width: 100%;
}

button:hover {
  border-color: #646cff;
}

button:disabled {
  background-color: #333;
  color: #777;
  cursor: not-allowed;
  border-color: transparent;
}

#status-container {
  margin-top: 1.5rem;
  min-height: 24px;
}

#status {
  font-weight: bold;
}

#status.success {
  color: #42b883;
}

#status.error {
  color: #ff4d4d;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

header h1 {
    margin-bottom: 0;
}

#show-cpi-modal-btn {
    width: auto;
    padding: 0.6em 1em;
    font-size: 0.9em;
}

.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #2f2f2f;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #444;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-buttons button {
    width: auto;
}

#modal-cancel-btn {
    background-color: #444;
}
#modal-cancel-btn:hover {
    border-color: #888;
}

#modal-connect-btn {
    background-color: #646cff;
    color: white;
}
#modal-connect-btn:hover {
    border-color: #8c92ff;
}

hr {
    border: none;
    border-top: 1px solid #444;
    margin: 2rem 0;
}

select {
    width: 100%;
    padding: 0.6em 0.8em;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: #1a1a1a;
    color: rgba(255, 255, 255, 0.87);
    box-sizing: border-box;
    transition: border-color 0.25s;
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-text {
    margin-top: 1rem;
    min-height: 20px;
    text-align: left;
    color: #a0a0a0;
}

#generateBtn {
  width: 60px;  /* Larghezza fissa */
  height: 60px; /* Altezza fissa per renderlo un cerchio */
  border-radius: 50%; /* La magia per farlo tondo */
  background-color: #646cff;
  color: white;
  
  /* Centra l'icona e il testo al suo interno */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px; /* Spazio tra icona e testo */

  padding: 0; /* Rimuoviamo il padding per un controllo preciso */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden; /* Nasconde il testo che "esce" dal cerchio */

  /* Transizione fluida per l'allargamento */
  transition: width 0.3s ease, border-radius 0.3s ease, transform 0.2s ease-out;
}

/* 3. Stili per il testo "Genera", nascosto di default */
#generateBtn span {
  display: none; /* Nascosto di default */
  font-size: 1em;
  font-weight: 500;
  white-space: nowrap; /* Evita che il testo vada a capo */
}

/* 4. Effetto al passaggio del mouse: il pulsante si allarga e mostra il testo */
#generateBtn:hover {
  width: 150px; /* Larghezza aumentata per contenere il testo */
  border-radius: 30px; /* Raggio per mantenere i bordi arrotondati */
  transform: translateY(-3px);
}

#generateBtn:hover span {
  display: inline; /* Mostra il testo quando il mouse è sopra */
}

/* 5. Icona SVG dentro il pulsante */
#generateBtn svg {
  min-width: 24px; /* Assicura che l'icona non si restringa */
}

/* 6. Stile quando è disabilitato */
#generateBtn:disabled {
  background-color: #333;
  color: #777;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#generateBtn:disabled:hover {
  width: 60px; /* Impedisce l'allargamento se disabilitato */
  border-radius: 50%;
}
#generateBtn:disabled:hover span {
  display: none;
}

.floating-action-button-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
}

.file-uploader-container {
    text-align: left;
}

.file-uploader-container label {
    display: block;
    margin-bottom: 0.5rem;
}

/* Stile per la dropzone */
.dropzone {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background-color: #1a1a1a;
    transition: background-color 0.2s, border-color 0.2s;
}

.dropzone:hover {
    background-color: #2a2a2a;
    border-color: #646cff;
}

/* Stile per quando un file viene trascinato sopra la dropzone */
.dropzone.drag-over {
    border-color: #42b883;
    background-color: #2f443a;
}

.dropzone p {
    margin: 0 0 1rem 0;
    color: #a0a0a0;
}

/* Stile per il pulsante "Aggiungi File" */
.button-secondary {
    border-radius: 8px;
    border: 1px solid #555;
    padding: 0.6em 1.2em;
    font-size: 0.9em;
    font-weight: 500;
    background-color: transparent;
    cursor: pointer;
    transition: border-color 0.25s, background-color 0.25s;
    color: #a0a0a0;
}

.button-secondary:hover {
    border-color: #888;
    background-color: #333;
}


/* Contenitore per la lista dei file */
#file-list-container {
    margin-top: 1.5rem;
}

#file-list-container h4 {
    margin: 0 0 0.5rem 0;
    font-weight: normal;
    color: #a0a0a0;
    font-size: 0.9em;
}

#file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Stile per ogni elemento nella lista dei file */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a1a1a;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid #333;
    animation: fadeIn 0.3s ease-out;
}

.file-item span {
    /* Evita che nomi di file troppo lunghi escano dal contenitore */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}

/* Stile per il pulsante di rimozione (la X) */
.remove-file-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    transition: color 0.2s;
}

.remove-file-btn:hover {
    color: #ff4d4d;
}


/* Animazione per l'aggiunta di un file */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contenitore per label, input+bottone, e dropdown */
.input-group {
    position: relative; /* Necessario per posizionare il dropdown */
    text-align: left;
}

/* Contenitore per l'input file e il suo pulsante accanto */
.input-with-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Fa in modo che l'input occupi lo spazio rimanente */
.input-with-button input[type="file"] {
    flex-grow: 1;
}

/* Stile per il pulsante "Scegli da salvati" */
.load-saved-btn {
    width: auto;
    padding: 0.6em 0.8em;
    background-color: #333;
    border: 1px solid #555;
    font-size: 1em;
}

.load-saved-btn:hover {
    border-color: #888;
    background-color: #444;
}

/* Contenitore del menu a tendina */
.dropdown-menu {
    position: absolute;
    top: 100%; /* Posizionato subito sotto l'input */
    left: 0;
    right: 0;
    background-color: #2f2f2f;
    border: 1px solid #555;
    border-radius: 8px;
    margin-top: 0.25rem;
    z-index: 100;
    max-height: 200px; /* Altezza massima, poi scroll */
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Singolo elemento nel menu */
.dropdown-item {
    padding: 0.8em 1em;
    cursor: pointer;
    color: #f6f6f6;
    border-bottom: 1px solid #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.dropdown-item:hover {
    background-color: #646cff;
}

/* Stile per mostrare il file selezionato dal dropdown */
.selected-file-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a1a1a;
    color: #a0a0a0;
    padding: 0.6em 0.8em;
    border-radius: 8px;
    border: 1px solid #646cff;
    width: 100%;
    box-sizing: border-box;
}

.selected-file-display .clear-selection-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 0.5rem;
}

.selected-file-display .clear-selection-btn:hover {
    color: #ff4d4d;
}