/* Stile per i pulsanti in una sola riga */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Contenitore destro per ospitare la campanella e il menu */
.header-right {
    display: flex;
    align-items: center;
}

.user-actions-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.action-button-container {
  flex: 1;
  min-width: 150px;
  max-width: 200px;
}

/* QR Code Modal */
.qr-image-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.qr-image {
  max-width: 250px;
  max-height: 250px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.qr-info {
  text-align: center;
  margin-bottom: 20px;
}

.qr-regenerated {
  color: #28a745;
  font-weight: bold;
  margin-top: 10px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

/* Consensi utente */
.user-consents-container {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-consents-container h2 {
  color: #006400;
  font-size: 22px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(0, 80, 0, 0.3);
  padding-bottom: 8px;
  text-align: center;
}

.consensi-container {
  max-height: 320px;
  overflow-y: auto;
  margin: 15px 0;
}

.consenso-item {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0, 100, 0, 0.2);
  transition: all 0.3s ease;
}

.consenso-item:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.consenso-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  margin-right: 15px;
}

.consenso-titolo {
  font-size: 16px;
  margin: 0;
  color: #333;
}

.toggle-switch {
  position: relative;
  display: flex;
  align-items: center;
}

.toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-label {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  cursor: pointer;
}

.switch-label:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 24px;
  background-color: #ccc;
  border-radius: 24px;
  transition: all 0.3s;
}

.switch-label:after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s;
}

input[type="checkbox"]:checked + .switch-label:before {
  background-color: #28a745;
}

input[type="checkbox"]:checked + .switch-label:after {
  transform: translateX(26px);
}

/* Consensi disabilitati */
.toggle-switch.disabled .switch-label {
  cursor: not-allowed;
}

.toggle-switch.disabled .switch-label:before {
  background-color: rgba(40, 167, 69, 0.5);
  opacity: 0.7;
}

.obbligatorio-tag {
  font-size: 11px;
  background-color: #dc3545;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 10px;
  font-weight: bold;
}

.no-consents-message {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

@media screen and (max-width: 767px) {
  .dropdown-menu {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    z-index: 9999 !important;
    background-color: rgba(0, 80, 0, 0.95) !important;
  }

  .dropdown-menu a {
    padding: 15px !important;
    font-size: 16px !important;
  }

  /* Per assicurarsi che il menu sia visibile anche se nascosto da altre regole CSS */
  .dropdown.open .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .user-actions-container {
    flex-direction: column;
    align-items: center;
  }

  .action-button-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
  }

  .consenso-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .consenso-header {
    margin-bottom: 10px;
    margin-right: 0;
    width: 100%;
  }

  .consenso-options {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Stili per il sistema di notifiche */
.notifications-container {
    position: relative;
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.notifications-icon {
    cursor: pointer;
    font-size: 22px;
    color: white; /* Colore bianco per la campana per visibilità nell'header verde */
    position: relative;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff3333; /* Rosso più vivace */
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    text-align: center;
    line-height: 18px;
    padding: 0 3px;
    font-weight: bold;
}

.notifications-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    right: -10px;
    width: 350px;
    max-height: 500px;
    background-color: #006400; /* Verde scuro come sfondo principale */
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    color: white;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #005500; /* Verde ancora più scuro per l'header */
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
    color: white;
}

.mark-all-read {
    background: none;
    border: none;
    color: #ffff99; /* Giallo chiaro per visibilità */
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.notifications-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
    background-color: #006400; /* Verde scuro per il corpo */
}

.banner-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #006400;
    color: white;
    padding: 10px 20px;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.banner-notification a {
    color: #ffff00;
    text-decoration: underline;
}

.banner-notification-actions {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
}

.banner-notification-action {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 5px;
}

.banner-notification-action:hover {
    color: #ffff00;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: background-color 0.2s;
    background-color: #007500; /* Verde leggermente più chiaro */
    color: white;
}

.notification-item:hover {
    background-color: #008600; /* Verde ancora più chiaro all'hover */
}

.notification-item.unread {
    background-color: #008500; /* Verde più vivace per non lette */
    border-left: 3px solid #ffff00; /* Bordo giallo per maggior contrasto */
}

.notification-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8); /* Bianco leggermente trasparente */
    margin-top: 5px;
}

.notification-content {
    margin-right: 30px; /* Spazio per le icone di azione */
}

.notification-actions {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 10px;
}

.notification-action {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.notification-action:hover {
  color: #ffffff;
}

.notification-delete:hover {
    color: #dc3545;
}

.notification-read:hover {
    color: #28a745;
}

.notification-link {
    display: inline-block;
    margin-top: 5px;
    color: #ffff99; /* Giallo chiaro per i link */
    text-decoration: none;
    font-size: 13px;
}

.notification-link:hover {
    text-decoration: underline;
}

.notifications-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #005500; /* Verde più scuro per il footer */
}

.clear-all {
    background: none;
    border: 1px solid #ffaa00; /* Arancione per il bottone */
    color: #ffaa00;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.clear-all:hover {
    background-color: #ffaa00;
    color: #006400; /* Verde scuro quando hoverato */
}

.no-notifications {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    background-color: #007500;
}

@media screen and (max-width: 767px) {
  .notifications-dropdown {
    width: 100%;
    right: 0;
    left: 0;
    position: fixed;
    top: 60px;
    border-radius: 0;
  }
}

/* Stile per l'indicatore di caricamento */
.loading-indicator {
    padding: 20px;
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 100, 0, 0.3);
    border-radius: 50%;
    border-top-color: #006400;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-indicator span {
    display: block;
    color: #555;
    font-size: 13px;
}

.error-message {
    padding: 20px;
    text-align: center;
    color: #d9534f;
}

.btn-retry {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-retry:hover {
    background-color: #e0e0e0;
}

@media screen and (max-width: 767px) {
    .notifications-dropdown {
        width: 100%;
        right: 0;
        left: 0;
        position: fixed;
        top: 60px;
        border-radius: 0;
    }
    
    .banner-notification {
        padding: 15px 10px;
    }
    
    .banner-notification-actions {
        position: static;
        margin-top: 10px;
        transform: none;
        justify-content: center;
    }
}