/* ======================
   PROFILO BASE
====================== */
.mncg-profile-header { cursor: pointer; }

.mncg-profile {
  width: 100%;
  max-width: 90%;
  margin: 2rem auto;
  font-family: sans-serif;
  display: block;
}

.mncg-profile-header {
  text-align: center;
  margin-bottom: 2rem;
}

.mncg-profile-header h2 {
  color: #3b84b9;
  margin: 0;
}

.mncg-profile-header p {
  color: #555;
  font-size: 1.1rem;
}

/* ======================
   GRID LAYOUT STABILE (4-3–2–1)
====================== */
.mncg-profile-grid {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: repeat(4, 1fr);  /* desktop */
  max-width: 1300px;
  margin: 0 auto;
}

/* Tablet (1000–1400px) → 3 colonne */
@media (max-width: 1400px) {
  .mncg-profile-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1000px;
  }
}
/* Tablet (650–1000px) → 2 colonne */
@media (max-width: 1000px) {
  .mncg-profile-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
  }
}

/* Mobile (<650px) → 1 colonna */
@media (max-width: 650px) {
  .mncg-profile-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 1rem;
  }
}

/* ======================
   CARD BASE
====================== */
.mncg-profile-card {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.mncg-profile-card:hover {
  transform: translateY(-4px);
  background: #fafcffa4;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.mncg-profile-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #3b84b9;
  border-bottom: 1px solid #e1e1e1;
  padding-bottom: 0.5rem;
}

.mncg-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ico-flag { width: 20px; margin-top: -3px; }
.button { margin-top: 10px; }

/* ======================
   TOGGLE SLIDERS
====================== */
.mncg-alert-switch,
.mncg-warning-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
  vertical-align: middle;
}

.mncg-alert-switch input,
.mncg-warning-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mncg-slider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 28px;
  border-radius: 50px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.5s ease;
  border: 2px solid #ccc;
  background: #f7f7f7;
  box-sizing: border-box;
}

.mncg-alert-switch input:checked + .mncg-slider {
  background-color: #e74c3c;
  border-color: #e74c3c;
}
.mncg-warning-switch input:checked + .mncg-slider {
  background-color: #ffee05;
  border-color: #ffee05;
}

.mncg-alert-switch input:checked + .mncg-slider::before { content: "🚨"; }
.mncg-alert-switch input:not(:checked) + .mncg-slider::before { content: "➕"; }
.mncg-warning-switch input:checked + .mncg-slider::before { content: "⚠️"; }
.mncg-warning-switch input:not(:checked) + .mncg-slider::before { content: "➕"; }

.mncg-field-toggle {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.mncg-field-toggle strong { flex: 1; }

/* ======================
   Collapsable Affinities
====================== */
.collapsable-card {
  margin: 10px 0;
  padding: 10px;
}

.collapsable-card h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 10px;
}

.affinity-title {
  margin-right: auto; /* Spinge tutto il resto verso destra */
  font-weight: bold;
  font-size: 1.3rem;
}

.affinity-body {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}
.affinity-body p{
  margin-bottom: 0.2rem;
}

.affinity-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
}

.toggle-affinities {
  cursor: pointer;
  user-select: none;
}

.toggle-affinities:hover,
.mncg-edit-field:hover {
  transform: translateY(-4px);
  background: #c0d9ffa4;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* ======================
   EDITABLE FIELDS
====================== */
.suggestion-item { cursor: pointer; text-align: left; padding: 5px; }
.suggestion-item:hover { background-color: #f0f0f0; }

.mncg-edit,
.mncg-edit-field {
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  word-break: break-word;
}
.mncg-edit:hover,
.mncg-edit-field:hover {
  transform: translateY(-4px);
  background: #c0d9ffa4;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* ======================
   LOADER
====================== */
.mncg-loader-pro {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(255,255,255,0.85);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mncg-loader-pro .spinner {
  width: 40px; height: 40px;
  border: 4px solid #ccc;
  border-top-color: #0b1f3a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.mncg-loader-pro p { margin-top: 12px; font-size: 1rem; color: #0b1f3a; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================
   MODALI
====================== */
.mncg-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}
.mncg-modal.is-open { display: flex !important; }

.mncg-modal-content {
  background: #fff;
  margin: auto;
  padding: 20px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: all 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;       /* ✅ Scroll verticale */
  overflow-x: hidden;     /* ✅ Evita orizzontale */
  position: relative;
  z-index: 1;
}

.mncg-modal-close {
  float: right;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #333;
  transition: color 0.2s ease;
}
.mncg-modal-close:hover { color: #3b84b9; }

#mncg-modal-confirm-totp,
#mncg-totp-modal,
#mncg-modal-edit { display: none; }

.mncg-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1em;
  padding: 0 0.5em;
}
.mncg-modal-footer .btn-primary {
  min-width: 100px;
  text-align: center;
}
.mncg-modal-footer .btn-clear {
  font-size: 0.9em;
  cursor: pointer;
  color: #dc3545;
}
.mncg-modal-footer .btn-clear:hover { text-decoration: underline; }

/* Blocca scroll body quando modale aperto */
body.modal-open { overflow: hidden; }

/* ======================
   COMPATIBILITÀ WORDPRESS WRAPPERS
====================== */
.mncg-profile,
.mncg-profile-grid,
.mncg-profile-card {
  flex: 1 1 auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
.entry-content .mncg-profile,
.site-content .mncg-profile {
  padding: 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

/* ======================
   BIRTH DATE CALENDAR
====================== */
.flatpickr-calendar {
  width: auto !important;
  margin: 8px auto !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  font-size: 13px;
  border: 1px solid #ddd !important;
  overflow: hidden !important;
}
.flatpickr-months {
  border-bottom: 1px solid #ddd !important;
  padding: 6px 0 !important;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.flatpickr-current-month {
  font-size: 15px !important;
  font-weight: 600;
  color: #333;
  margin: 0 12px;
}
.flatpickr-weekdays {
  background: #f7f7f7 !important;
  border-bottom: 1px solid #ddd !important;
}
span.flatpickr-weekday {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.flatpickr-day {
  width: 32px; height: 32px; line-height: 32px;
  margin: 2px; border-radius: 6px;
}
.flatpickr-day:hover { background: #f0f8ff !important; }
.flatpickr-day.selected {
  background: #0073aa !important;
  color: #fff !important;
  font-weight: bold;
}

/* ======================
   TEXT TRUNCATION (no wrap)
====================== */

/* Tutti i campi editabili e sensibili a overflow */
.no-wrap-text {
  white-space: nowrap;          /* evita l'andare a capo */
  overflow: hidden;             /* nasconde il testo in eccesso */
  text-overflow: ellipsis;      /* mostra i puntini (…) */
  display: inline-block;        /* necessario per l'effetto ellissi */
  max-width: 100%;              /* si adatta alla card */
  vertical-align: middle;
}

/* Variante per desktop: taglia meno aggressivamente */
@media (min-width: 1024px) {
  .mncg-profile-card p span,
  .mncg-edit-field {
    max-width: 90%;
  }
}

/* Tooltip all'hover per mostrare il testo completo */
.mncg-profile-card [title],
.mncg-edit-field[title] {
  cursor: help;
}

.org-modal-fullscreen {
  display: none; /* Modal hidden by default */
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.75);
  display: flex;
  justify-content: center;
  align-items: center;
}

.org-modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.org-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

button.close-fullscreen {
  margin-top: 2rem;
}

.org-line {
  margin: 0.1rem 0;
  line-height: 1.1;
}

#org-status p {
margin-bottom: 0 !important;
}

.org-modal-small {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;                     /* cambia da 10% a 0 */
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.75); /* aggiunto sfondo */
  display: flex;
  justify-content: center;
  align-items: center;
}
.org-modal-small-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  min-height: 65vh;
  max-height: 90vh;
  overflow-y: auto;
}

.suggestions {
  top: 100%;           
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.suggestion-item {
  padding: 0.5rem;
  cursor: pointer;
}
.suggestion-item:hover {
  background: #f0f0f0;
}

.autocomplete-wrapper {
  position: relative;
}



.affinity-row {
  display: flex;
  justify-content: flex-end;    /* allinea a sinistra */
  margin-bottom: 0.5rem;
  gap: 0.5rem;                     /* spazio tra label e valore */
  align-items: baseline !important;
}

.affinity-label {
  font-weight: bold;
  min-width: 120px;
  text-align: end;
}

.affinity-value {
  flex: 1;
}

.mncg-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.mncg-password-wrapper input {
  flex: 1;
  padding-right: 2.5rem; /* spazio per l’icona */
}

.toggle-password {
  position: absolute;
  right: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #555;
  user-select: none;
}


.text-lowercase {text-transform: lowercase;}
.text-uppercase {text-transform: uppercase;}
.text-capitalize {text-transform: capitalize;}


.profile-section {
  margin-bottom: 2rem;
}
.profile-section p {
  margin-bottom: 0;
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 1rem;
}

.cert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;

}

.cert-name {
  flex: 1;
}

.cert-actions a {
  margin-left: 8px;
  text-decoration: none !important;
  color: #007bff;
}

.cert-actions a:hover {
  text-decoration: none !important;
}
