*,
*::before,
*::after {
  box-sizing: border-box;
}


body {
  font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #e9ecf2, #d5e0e8);
  margin: 0; 
  padding-bottom: 100px;
  display: flex; flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
}
header {
  background: linear-gradient(to right, #6a11cb, #2575fc);
  padding: 1rem;
  text-align: center;
  color: white;
  border-radius: 0 0 20px 20px;
  width: 100%;
}
header {
  cursor: pointer;
}

header img {
  width: 80px; height: 80px;
}
.title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: 0.5rem;
}
.subtitle {
  font-size: 1.2rem;
}

.intro-text {
  text-align: center;
  margin-top: 10px;
  margin-left: 8px;
  margin-right: 8px;
  padding: 2px;
  color: blue;
  font-size: 0.95em;
}

.toggle-buttons {
  margin: 1.5rem 0;
}
.toggle-buttons button {
  background: #FFA500; /* Orange */
  padding: 10px 20px;
  margin: 0 5px;
  border: none;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
}

.toggle-buttons .active {
  background-color: red !important;
  color: white !important;
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
}

.prof-btn {
	background: orange;
	color: white; 
	}

.prof-btn:hover {
  background-color: red; 
  color: white; 
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19)
}

.school-btn { 
	background: orange; 
	color: white; 
}

 .school-btn:hover {
  background-color: red;
  color: white; 
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19)
}


.search-container {
  position: relative;
  width: 100%;
  text-align: center;
  margin: 0 auto; margin-left: 0px
}
.search-box {
  max-width: 90%; width: 90%; padding: 18px;
  font-size: 1.5rem;
  border-radius: 12px;
  border: 2px solid #3b9cff;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  text-align: center;
  margin: 0 auto;
}

.suggestion-list {
  position: absolute;
  z-index: 9999;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  width: 100%;
  font-size: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.suggestion-list li {
  padding: 10px 14px;
  cursor: pointer;
}

.suggestion-list li:hover {
  background-color: #f0f0f0;
}

.tip {
  font-size: 0.8rem;
  color: #777;
  margin-top: 4px;
  text-align: left;
}



#scuolaTags ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 4px;
}

#scuolaTags ul li {
  padding: 8px;
  border: 1px solid #ddd;
  border-top: none;
  background-color: #fff;
  cursor: pointer;
}

#scuolaTags ul li:hover {
  background-color: #f0f0f0;
}


.result-box {
  box-sizing: border-box;
  background: white;
  padding: 0.5rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  margin-top: 1rem;
  margin-left: 0 auto; margin-right: 0 auto;
  width: 100%;
  max-width: 600px;
  text-align: center;
}
.result-box h2 {
  font-style: italic;
  color: #333;
}
.result-box .media {
  margin-top: 0.5rem;
  font-size: 1rem;
  text-align: center;
}
.media {
  text-align: center;
  width: 100%;
}
.review-form {
  /*margin-top: 1rem;*/
  max-width: 500px;
  width: 100%;
}
.review-form label {
  padding-left: 10px;
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}
.review-form .stars {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: white;
  border-radius: 10px;
  justify-content: center;
}
.review-form textarea {
  width: 100%;
  height: 100px;
  margin-top: 10px;
  margin-left: 0 auto; 
  margin-right: 0 auto;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #ccc;
}
.review-form button {
  margin-top: 1rem;
  padding: 10px 20px;
  background: #3b9cff;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.hidden {
  display: none !important;
}


.stars img {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.stars img:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}


#scuolaSuggestions
#scuolaProfSuggestions {
  list-style: none;
  margin: 0;
  padding: 0;
}
#scuolaSuggestions li
#scuolaProfSuggestions li {
  padding: 10px 14px;
  cursor: pointer;
}
#scuolaSuggestions li:hover 
#scuolaProfSuggestions li:hover {
  background-color: #f0f0f0;
  font-weight: bold;
}


.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  background: white;
  max-height: 150px;
  overflow-y: auto;
  width: 100%;
}

.autocomplete-list li {
  padding: 5px 10px;
  cursor: pointer;
}

.autocomplete-list li:hover {
  background-color: #f0f0f0;
}

.tag-input {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border: 1px solid #ccc;
  min-height: 40px;
}

.tag-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 100px;
}

.tag {
  background-color: #e0e0e0;
  padding: 5px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
}

.tag span {
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
}


.wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stella-animata:hover {
  transform: scale(1.1) rotate(-3deg);
}

#mediaVoti.flash {
  animation: flash 1.2s ease-out;
  border-radius: 6px;
  box-shadow: 0 0 12px 4px rgba(255, 187, 0, 0.6);
}

@keyframes flash {
  0%   { background-color: #ffcc00; }
  100% { background-color: transparent; }
}

input.inattivo {
  opacity: 0.3;
  pointer-events: none;
  filter: blur(1px);
  transition: all 0.3s ease;
}

input.attivo {
  opacity: 1;
  pointer-events: auto;
  filter: none;
}

#previewScuola {
  transition: box-shadow 0.3s ease;
}
#previewScuola:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}
#previewScuola .nome-scuola {
  font-size: 1.3rem;
  font-weight: 600;
  color: #222;
}
#previewScuola .comune {
  font-size: 1rem;
  color: #555;
}
#previewScuola a {
  font-size: 0.95rem;
  color: #0077cc;
}
#previewScuola a:hover {
  text-decoration: underline;
}

.voto-scritta{
  text-align: center;
  font-size: 1.3em;
  color: orange;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 15px;
}
/*ANIMAZIONE FRECCE*/

.voto-scritta i {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

/*FINE ANIMAZIONE FRECCE*/

.leggi-termini {
  font-size: 0.7rem;     
  color: #888;           
  text-align: center;
  display: block;
  margin-top: 12px;
  text-decoration: none;
}

.leggi-termini:hover {
  text-decoration: underline;
}



#ultimeRecensioniBox {
  margin-top: 20px;
  padding: 10px 15px 15px;
  background-color: #fefefe;
  border-top: 2px solid #eee;
}

#ultimeRecensioni {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  justify-content: center;
}


.recensione-card {
  flex: 1 1 250px;
  background-color: #fff8e1;
  border: 1px solid #ffd54f;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.recensione-card:hover {
  transform: scale(1.03);
  background-color: #fff3cd;
}

.recensione-card h3 {
  margin-top: 0;
  color: #bf360c;
}

.media-libro {
  margin: 8px 0;
}

.starbook {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.mini-recensione {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 12px;
}

.stelle-e-media {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.testo-commento {
  font-size: 0.95rem;
  color: #333;
}

.titolo-recensito {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #bf360c;
}

.recensione-singola {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

.recensione-singola:last-child {
  border-bottom: none;
}

#notificaSuccesso {
  transition: all 0.5s ease;
  border: 2px solid #3c763d;
}

.notifica-successo {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #dff0d8;
  color: #3c763d;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  z-index: 1000;
  pointer-events: none;
  font-weight: bold;
  font-size: 16px;
}

.notifica-successo.attiva {
  opacity: 1;
  visibility: visible;
}

#previewScuola {
  background: #eaf5ff;
  border: 2px dashed #3399cc;
  padding: 14px;
  border-radius: 10px;
  margin-top: 14px;
  font-family: sans-serif;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#previewScuola {
  margin-top: 16px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
  max-width: 100%;
  background: #f1f5fb;
  padding: 12px;
  text-align: center;
}

#previewScuola .background-img {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
}

#previewScuola .nome-scuola {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 10px;
}

#previewScuola .comune,
#previewScuola .indirizzo {
  font-size: 1rem;
  color: #555;
}

#previewScuola a {
  margin: 0 6px;
  text-decoration: none;
  color: #0077cc;
}

#previewScuola #docentiScuola {
  margin-top: 14px;
  font-size: 0.95rem;
  color: #444;
}

#docentiScuola {
  margin-top: 10px;
  padding: 8px 10px;
  background: #fffaf0;
  border-left: 4px solid #f0a500;
  font-size: 0.95rem;
}

#formSuggerisciScuola {
  margin-top: 20px;
  padding: 10px;
  background: #fdf6e3;
  border: 1px dashed #f39c12;
  border-radius: 8px;
}
#formSuggerisciScuola input {
  display: block;
  margin: 5px 0;
  padding: 6px;
  width: 100%;
}
#formSuggerisciScuola button {
  margin-top: 10px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}

.logo-area img {
  width: 80px;
  height: 80px;
}

.login-area {
  font-size: 0.9rem;
  text-align: right;
  color: white;
}

.login-link {
  color: white;
  text-decoration: none;
  margin-left: 8px;
  font-weight: bold;
}

.login-link:hover {
  text-decoration: underline;
}

.header-top {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: relative;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header-top img {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.auth-links {
  position: absolute;
  top: 0;
  right: 1rem;
  font-size: 0.9rem;
  color: white;
  white-space: nowrap;
}

/* badge + link */
.auth-links a {
  color: white;
  text-decoration: none;
  margin-left: 10px;
  font-weight: bold;
}

.auth-links a:hover {
  text-decoration: underline;
}

.benvenuto {
  margin-right: 6px;
}

.badge {
  background: #fff;
  color: #333;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.75rem;
  margin-left: 5px;
  font-weight: bold;
}

.badge.utente {
  background: #d1ecf1;
  color: #0c5460;
}
.badge.professore {
  background: #ffeeba;
  color: #856404;
}
.badge.scuola {
  background: #c3e6cb;
  color: #155724;
}

/* 📱 Mobile: link sotto al logo */
@media (max-width: 600px) {
  .header-top {
    flex-direction: column;
    align-items: center;
  }

  .auth-links {
    position: static;
    margin-top: 10px;
    white-space: normal;
    text-align: center;
  }
}

.btn-promuovi {
  background-color: #eafaf1;
  border: 1px solid #2ecc71;
  color: #2e7d32;
  border-radius: 12px;
  padding: 3px 3px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-promuovi:hover {
  background-color: #d4f5e3;
  transform: scale(1.03);
}


.btn-replica {
  background-color: #eafaf1;
  border: 1px solid #2ecc71;
  color: #2e7d32;
  border-radius: 12px;
  padding: 3px 3px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-replica:hover {
  background-color: #d4f5e3;
  transform: scale(1.03);
}


.notifica-promozione {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1000;
  background-color: #d4edda;
  color: #155724;
  opacity: 0;
  visibility: hidden;
}

/* Riquadro form-registrazione */
.form-box {
  margin: 18px auto 24px auto;
  padding: 28px 22px 22px 22px;
  max-width: 100%;
  background: #f4f8ff;
  border-radius: 18px;
  border: 1.5px solid #a2c4e6;
  box-shadow: 0 2px 22px 0 rgba(140, 176, 225, 0.09);
}

/* Toggle role buttons */
.role-btn {
  padding: 13px 26px;
  margin: 12px 9px 22px 9px;
  font-size: 1.07rem;
  border-radius: 11px;
  border: 1.4px solid #89b7ec;
  background: linear-gradient(90deg, #d1e5fa 30%, #e2efff 100%);
  color: #285489;
  font-weight: 600;
  box-shadow: 0 1px 9px 0 rgba(122, 180, 225, 0.07);
  transition: background 0.13s, color 0.13s, border-color 0.13s;
  cursor: pointer;
}
.role-btn.active,
.role-btn:hover,
.role-btn:focus {
  background: linear-gradient(90deg, #8fc6ff 25%, #a5d1fb 100%);
  color: #18395c;
  border-color: #3a82c2;
}


/* Box messaggio highlight */
.msg-highlight {
  background: #ffeede;
  color: #bb4e00;
  border: 1.5px solid #f5b37e;
  border-radius: 10px;
  padding: 15px 18px;
  margin: 18px auto 12px auto;
  max-width: 420px;
  text-align: left;
  font-size: 1.07rem;
  font-weight: 600;
}
.msg-highlight a {
  color: #d36c20;
  font-weight: 700;
  text-decoration: underline;
}

.replica-box {
  margin-top: 8px;
  margin-left: 32px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  border-radius: 7px;
  font-size: 0.98em;
  color: #234;
  box-shadow: 0 2px 4px rgba(80,100,200,0.06);
  max-width: 85%;
  text-align: left;
  position: relative;
}
.replica-label {
  font-weight: 600;
  color: #246;
  letter-spacing: 0.02em;
}
.replica-freccia {
  font-size: 1.2em;
  margin-right: 4px;
  vertical-align: middle;
}
.replica-testo {
  margin-left: 6px;
}

.testo-recensione.recensione-moderata {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 8px 10px;
  border-radius: 6px;
  font-style: italic;
}

.btn-admin-moderate {
  background: #c00;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-admin-moderate:hover {
  background: #a00;
}