body.modal-open {
  overflow: hidden;
}

body.modal-open #chat-icon,
body.modal-open .whatsapp-button,
body.modal-open .aa-skin,
body.modal-open .adv-top,
body.modal-open .main-header,
body.modal-open header,
body.modal-open footer,
body.modal-open .fixed-footer,
body.modal-open .menu,
body.modal-open .menu-mobile,
body.modal-open .sticky-header {
  display: none !important;
}

.header {
  color: white;
  padding: 1rem;
  text-align: center;
}

/* Contenitore della barra di ricerca */
.filters {
  display: flex;
  justify-content: flex-start; /* allinea a sinistra */
  align-items: center;
  gap: 0.5rem;
  background: none !important; /* rimuove fascia blu */
  padding: 1rem 0rem;
}

/* Campo di ricerca migliorato */
.filters input[type="text"],
#searchInput {
  width: 380px;
  max-width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem; /* spazio per icona */
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 30px;
  background: #fff
    url("data:image/svg+xml,%3Csvg fill='%23999' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.471 6.471 0 001.48-5.34C15.27 5.59 12.36 3 8.9 3S2.54 5.59 2.09 8.39c-.61 3.73 2.25 6.91 5.97 6.91 1.61 0 3.09-.59 4.23-1.57l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6.6 0C6.58 14 4.5 11.92 4.5 9.5S6.58 5 9 5s4.5 2.08 4.5 4.5S11.42 14 9 14z'/%3E%3C/svg%3E")
    no-repeat 10px center;
  background-size: 16px;
  transition: all 0.3s ease;
}

.filters select {
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 30px;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filters select:focus,
.filters input[type="text"]:focus {
  border-color: #00986a !important;
}

#universitaContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  max-width: 1280px;
  margin: 0 auto;
  gap: 1rem;
  padding: 1rem;
  min-height: 300px;
}

#compareBar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  z-index: 999999999 !important;
}

#compareItems {
  display: flex;
  gap: 0.5rem;
}

#compareItems img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: white;
  padding: 0.25rem;
  border-radius: 4px;
}

#compareBar .viewCompareBtn {
  background: #00986a;
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-radius: 4px;
}

.viewCompareBtn:disabled {
  background: #aaa;
  cursor: not-allowed;
  opacity: 0.6;
}

.hidden {
  display: none !important;
}

/* Overlay della modale */
#compareModal {
  position: fixed;
  inset: 0;
  z-index: 2147483647 !important;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  background: rgba(20,20,20,0.55);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: fadeIn 0.25s ease-out;
}

/* Contenitore interno */
#compareModal .modalContent {
  position: relative; /* 🔥 fondamentale */
  width: 100%;
  max-width: 1300px;

  background: #fff;
  border-radius: 14px;

  /* 🔥 padding sufficiente per il bottone */
  padding: 3.2rem 2rem 2rem;

  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.05);

  /* 🔥 il TRUCCO che risolve il problema su mobile */
  overflow-x: visible;   
}

/* Tabella scrollabile */
#compareTableWrapper {
  overflow-x: auto;  /* 🚀 SOLO la tabella scorre */
}

/* Bottone chiusura */
#compareModal .closeTopRight {
  position: absolute;   /* resta agganciato a modalContent */
  top: 0px;
  right: 0px;

  background: #38549e;
  color: white;
  border: none;

  width: 36px;
  height: 36px;
  font-size: 20px;

  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  transition: 0.25s ease;
  z-index: 9999; /* 🔥 sopra tutto */
}

#compareModal .closeTopRight:hover {
  background: #2d417a;
}



/* Tabella */
#compareTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0,0,0,0.12);
}

#compareTable th {
  background: linear-gradient(135deg, #00986a, #00b37d);
  color: white;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

#compareTable td {
  background: #ffffff;
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #e7e7e7;
  vertical-align: middle;
  border-right: 1px solid #e7e7e7;
}

#compareTable td:first-child {
  background: #f1f6fc;
  font-weight: 600;
  text-align: left;
  width: 230px;
  border-right: 1px solid #d7e0ea;
}

#compareTable td img {
  max-height: 60px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Mobile */
@media (max-width: 768px) {

  #compareTable {
    font-size: 0.85rem;
    min-width: 850px; /* scroll orizzontale */
  }

  #compareTable th,
  #compareTable td {
    padding: 0.6rem;
  }

  #compareTable td img {
    max-height: 45px;
  }
}

/* ───────────────────────────── */
/*         ANIMAZIONI            */
/* ───────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}



.compareCard {
  background: #f9f9f9;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.compareItemWrapper {
  position: relative;
  display: inline-block;
}

.removeCompare {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #00986a;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 20px;
  padding: 0;
  text-align: center;
  cursor: pointer;
}

#paginationControls {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

#prevWrapper {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  padding: 1rem;
}

#nextWrapper {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  padding: 1rem;
}

.loadMoreBtn {
  background: #00986a;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.loadMoreBtn:hover {
  background: #00b37d;
}

.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 300px;
  min-height: 280px;
  margin-bottom: 40px;
  box-sizing: border-box;
  transition: transform 0.2s;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card .logo-container {
  position: relative;
  background-color: white;
  border-radius: 20px 20px 0 0;
  padding: 1rem; /* aggiungi padding */
  flex: 0 0 auto;
}

.card .logo-container img {
  width: 100%;
  max-height: 100px; /* limita altezza logo */
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.card .logo-container::after {
  content: "\f19c"; /* Font Awesome tempio */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: white;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 152, 106, 0.88);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .logo-container::after {
  opacity: 1;
}

.card h2 {
  transition: color 0.3s ease;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.3em;
  flex: 0 0 auto;
}

.card h2 a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card .content {
  flex: 1 1 auto;
  padding: 0 1rem;
  display: block; /* default */
}

.card .content h2 {
  font-size: 1rem;
  line-height: 1.3em;
  margin: 0;
  /* NON mettere height qui */
}

/* Questo è cruciale: il link dentro h2 deve diventare block clamped */
.card .content h2 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card .checkbox-wrapper {
  flex: 0 0 auto;
  padding: 1rem;
}

.card .checkbox-wrapper label {
  cursor: pointer;
}

.card .checkbox-wrapper input[type="checkbox"] {
  cursor: pointer;
}

.card .super-ranking {
  background-color: #f8aa12;
  color: white;
  width: 80%;
  font-weight: bold;
  padding: 0.5rem;
  border-radius: 100px;
  font-size: 1rem;
  margin: 0 auto;
}

#compareTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
  border-radius: 8px;
  overflow: hidden;
}

#compareTable th {
  background: #00986a;
  color: white;
  font-size: 1rem;
  padding: 1rem;
  text-align: center;
}

#compareTable td {
  background: white;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
  text-align: center;
}

/* Prima colonna (Caratteristiche) */
#compareTable td:first-child {
  background-color: rgba(0, 156, 109, 0.317);
  font-weight: 600;
  text-align: left;
  width: 220px;
}

/* Migliora immagini logo */
#compareTable td img {
  max-height: 60px;
  display: block;
  margin: 0 auto;
}

/* Arrotonda bordi superiori e inferiori */
#compareTable th:first-child {
  border-top-left-radius: 8px;
}
#compareTable th:last-child {
  border-top-right-radius: 8px;
}
#compareTable tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}
#compareTable tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

.info-form {
  background: #e7eef8;
  border-radius: 5px;
  padding: 20px;
  width: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-input {
  background: #fff;
  border-radius: 5px;
  width: 100% !important;
  padding: 12px 20px !important;
  border: 1px solid #e9e9e9 !important;
  margin-bottom: 10px !important;
  box-sizing: border-box;
  font-size: 15px;
  font-family: inherit;
}

.submit-info,
.info-btn {
  color: #ffffff !important;
  border-radius: 15px;
  font-size: 15px;
  background-color: #00986a;
  border: none;
  padding: 10px 30px;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.submit-info:hover,
.info-btn:hover {
  background-color: #00b37d;
}

/* Overlay */
#infoModal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483648 !important;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(3px); /* effetto vetro */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

/* Nascondi */
.info-modal.hidden {
  display: none !important;
}

/* Contenitore principale */
.info-modal-content {
  background: #ffffff;
  padding: 2.2rem;
  border-radius: 14px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;

  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.25s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Pulsante chiusura */
.close-info-modal {
  position: absolute;
  top: 0px;
  right: 0px;

  background: #38549e;
  color: white;
  border: none;

  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;

  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.close-info-modal:hover {
  background: #2d417a;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Animazioni */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}


.card .checkbox-wrapper label {
  font-size: 1.1rem; /* leggermente più grande del default */
  font-weight: 600; /* (opzionale) leggermente più marcato */
}

/* 🔹 Transizione dolce per le card */
#universitaContainer .card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 🔹 Quando attive (dopo caricamento) */
#universitaContainer .card.visible {
  opacity: 1;
  transform: translateY(0);
}