/* Reset di base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Font e colori in stile Apple */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #f7f7f7;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden; /* Previene lo scroll orizzontale */
}
html {
  scroll-padding-top: 140px; /* o l’altezza del tuo header */
}
/* Top Toolbar: per logout, username e lingua */
.top-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background-color: #333;
  color: #fff;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 5px 15px; /* Aggiunto padding */
  z-index: 2100;
  font-size: 0.9em;
}
.top-toolbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 15px;
  display: inline-flex;
  align-items: center;
}

.language-menu select {
  padding: 0px;
  margin: 7px;
}

/* Selettore lingua: versioni desktop e mobile */
.language-select-desktop { display: inline-block; }
.language-select-mobile { display: none; }
@media (max-width: 600px) {
  .language-select-desktop { display: none; }
  .language-select-mobile { display: inline-block; }
}

/* Header principale: parte subito dopo la top toolbar */
header {
  position: fixed;
  top: 30px; /* Inizio dopo la top toolbar (30px) */
  left: 0;
  width: 100%;
  height: 70px; /* Altezza fissa */
  background-color: #000;
  color: #fff;
  z-index: 2000;
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  padding: 0 20px;
}

/* Menu di navigazione */
.desktop-menu {
  display: flex;
  gap: 15px;
}
.desktop-menu a {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.desktop-menu a i {
  margin-right: 5px;
}

/* Mobile menu hamburger: posizionato a destra */
.mobile-menu {
  display: inline-block;
}
.desktop-menu { display: none; }

#hamburger {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
}
/*@media (max-width: 600px) {
  .desktop-menu { display: none; }
  .mobile-menu { display: inline-block; }
}*/

/* Mobile menu dropdown */
#mobileMenuContent {
  display: none;
  position: absolute;
  right: 20px;
  top: 100px; /* top toolbar (30px) + header (70px) */
  background-color: #000;
  border: 1px solid #444;
  padding: 10px;
  z-index: 2200;

}
#mobileMenuContent a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 5px 0;
  text-align: center;
}

/* Toolbar della pagina: posizionata subito dopo l'header */
.toolbar {
  position: fixed;
  top: 100px; /* 30px (top toolbar) + 70px (header) */
  left: 0;
  width: 100%;
  height: 50px; /* Altezza fissa */
  background-color: #fff;
  padding: 5px;
  text-align: right;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1500;
}

/* Messaggio sticky: subito dopo la toolbar */
#message {
  position: fixed;
  top: 150px; /* 30px + 70px + 50px */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1600;
}

/* Footer fisso in basso, full width */
footer {
  display: none;
  position: relative;
  left: 0;

  width: 100%;
  background-color: #000;
  color: #fff;
  text-align: center;
  padding: 10px;
  z-index: 2000;
}

/* Main content: parte sotto top-toolbar, header e toolbar */
.main-content {
  margin-top: 160px; /* Spazio per top-toolbar (30px) + header (70px) + toolbar (50px) + 10px extra */
  width: 100%;
  max-width: 100%;
  padding: 0 10px;
}

/* Container per la tabella */
.table-container {
  overflow-x: auto;
}

/* Tabelle */
table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
table thead {
  background-color: #f2f2f2;
}
table th, table td {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
}
table tbody tr:hover {
  background-color: #f9f9f9;
}

/* Troncamento per celle se necessario */
table td.nomeparagrafo, table td.testo {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colonne extra visibili solo su desktop */
.desktop-only {
  display: table-cell;
}



/* Form generico */
form {
  width: 100%;
}
form label {
  display: block;
  /*margin-bottom: 10px;*/
  font-weight: 500;
  color: #444;
}
form input[type="password"],
form input[type="date"],
form input[type="text"],
form input[type="email"],
form textarea,
form select,
form input[type="number"],
form input[type="time"],
form input[type="url"] {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
  margin-bottom: 1em;
}

form textarea {
  resize: vertical;
  min-height: 80px;
}

.password-wrapper {
    position: relative;
    display: inline-block;
  }

  .password-wrapper input {
    padding-right: 30px;
  }

  .toggle-visibility {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    color: #555;
  }

  label {
    display: inline-grid;
    /*margin-bottom: 1em;*/
  }

/* Bottoni: solo icone */
button, input[type="submit"] {
  padding: 10px 20px;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
button:hover, input[type="submit"]:hover {
  background-color: #333;
}
.action-btn {
  margin: 2px;
}

/* Messaggi sticky */
.message {
  text-align: center;
  padding: 15px;
  margin: 15px auto;
  width: 100%;
  max-width: 960px;
  border-radius: 8px;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}
.success {
  background-color: #34c759;
  color: #fff;
}
.error {
  background-color: #ff3b30;
  color: #fff;
}
.fade-out {
  opacity: 0;
}

.fa {
  color: #ffffff;
}


/* Responsive design */
@media (max-width: 768px) {
  .main-content {
    margin-top: 160px;
  }
  table, form {
    width: 100%;
    margin: 10px auto;
  }
  table th, table td {
    padding: 10px;
  }
  h1 {
    font-size: 1.8em;
  }
  .desktop-only {
    display: none;
  }
  .table-container {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6em;
  }
  button, input[type="submit"] {
    padding: 8px 16px;
    font-size: 0.9em;
  }
}

/* Dashboard Styles */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding-bottom: 50px;
}
.dashboard-card {
  width: 100%;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 1 1 300px;
  max-width: 300px;
  text-align: center;
}
@media (max-width: 600px) {
  .dashboard {
    flex-direction: column;
    align-items: center;
  }
}
.dashboard-card h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
  background-color: #f2f2f2;
  padding: 5px;
  border-radius: 4px;
}
.dashboard-card p {
  font-size: 1.1em;
  margin-bottom: 15px;
}
.dashboard-card a.card-link {
  text-decoration: none;
  color: #000;
  font-size: 1.2em;
}
/* Anteprima Configurazione Email */
.email-preview {
  text-align: left;
  font-size: 0.9em;
  margin-bottom: 10px;
}
.email-preview label {
  font-weight: bold;
  display: block;
  margin-top: 5px;
}
.email-preview span {
  display: block;
}
.test-email-btn {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  margin-top: 10px;
}
.test-email-btn i {
  margin-right: 5px;
}
/* Aggiungi padding in fondo al contenuto */
.main-content {
  padding-bottom: 60px;
}
.header-sito{
  top: 0;
  position: relative;
}

/*pagina agenda*/
.calendar {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.calendar table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.calendar th, .calendar td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  vertical-align: top;
  min-height: 100px;
}
.calendar th {
  background-color: #f2f2f2;
}
.calendar td div.appointment {
  padding: 5px;
  margin: 3px 0;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
}
/* Visualizza l'orario in formato da - a */
.calendar td div.appointment span.orario {
  font-weight: bold;
  display: block;
  margin-bottom: 3px;
}
.calendar td button.add-app {
  margin-top: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: #000;
}
/* Toolbar per navigazione del calendario */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  position: relative;
}
.toolbar h2 {
  margin: 0 15px;
  font-size: 1.2em;
  font-weight: normal;
}
.toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5em;
  margin: 0 10px;
}
/* Pulsante aggiungi appuntamento nella toolbar (a destra) */
.toolbar-right {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.toolbar-right button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5em;
}
/* Classe per le icone Font Awesome nere */
.fa-icon-black {
  color: #000;
}
.fa-icon-grigio{
  color: #ccc;
}

/* Campo di ricerca cliente con suggerimenti */
#clientSearch, #clientSearchEdit {
  padding: 8px;
  margin-bottom: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
#clientSuggestions, #clientSuggestionsEdit {
  border: 1px solid #ddd;
  display: none;
  max-height: 150px;
  overflow-y: auto;
  background: #fff;
  position: relative;
  width: 100%;
  z-index: 3100;
}
#clientSuggestions div, #clientSuggestionsEdit div {
  padding: 8px;
  cursor: pointer;
}
#clientSuggestions div:hover, #clientSuggestionsEdit div:hover {
  background: #f2f2f2;
}
/* Main content: padding in fondo */
.main-content {
  padding-bottom: 60px;
}

/*loader spinner*/
#loader {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  z-index: 9999;
}

.spinner-rotate {
  width: 100px;
  height: 100px;
  animation: rotate-spinner 2s linear infinite;
}

@keyframes rotate-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bar-spinner {
  position: relative;
  width: 100px;
  height: 100px;
  left: -2px;
  top: -9px;
}

.bar {
  --total: 24;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 20px;
  background: black;
  border-radius: 2px;

  /* CENTRATURA PRECISA */
  transform: rotate(calc(var(--i) * 360deg / var(--total))) translateY(-40px);
  transform-origin: center;
}

</style>
