/*----------annunci.css------------*/
/* ================================
   Box di ricerca
================================ */
.search-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 1rem;
  padding: 0.8rem;
  box-shadow: 0 3px 6px rgba(0,0,0,.05);
  position: sticky;
  top: 1rem;
  z-index: 10;
}
.search-box .form-control,
.search-box .form-select {
  border-radius: 0.5rem;
}
.search-box button {
  border-radius: 0.5rem;
  font-weight: bold;
}

/* Box colonne (es. select filtri affiancate) */
.colonne {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
@media (max-width: 768px) {
  .colonne {
    flex-direction: column;
    gap: 10px;
  }
  .container-select select {
    width: 100%;
    flex: none;
  }
}
/* stile per i bottoni --*/
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease-in-out;
}

.category-btn:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-text {
    font-size: 1rem;
    text-align: center;
}

/* ================================
   Card categorie e sottocategorie
================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.category-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.2rem;
  background-color: #f8f9fa;
  border: 2px solid #ddd;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.category-btn:hover {
  background-color: #eef3f8;
  border-color: #0d6efd;
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.category-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.category-text {
  font-size: 0.9rem;
  font-weight: bold;
  color: #333;
}

/* Pulsante indietro */
.btn-back {
  background: #6c757d;
  color: #fff;
  border: none;
  padding: .6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-back:hover {
  background: #5a6268;
}

/* Step form pubblica/modifica */
.step { display: none; }
.step.active { display: block; }

/* cuoricino ciclo annunci */
.annuncio-meta .preferito {
  margin-left: 0.5rem;
  font-size: 1.2rem;
  vertical-align: middle;
}
/* cuoricino ciclo annunci */

/* ================================
   Card annunci (lista + dettaglio)
================================ */
.annunci-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.annuncio-card {
  display: flex;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.annuncio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.annuncio-img {
  flex: 0 0 130px;
  max-height: 130px;
  object-fit: cover;
  border-right: 1px solid #ddd;
}
.annuncio-card.vertical .annuncio-img {
  width: 100%;
  height: 300px;
  border-right: none;
}

.annuncio-content {
  flex: 1;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.annuncio-details {
  padding: 0.8rem 1rem;
  margin: 0 0 0.3rem;
}

.annuncio-title {
  font-size: 1rem;
  font-weight: bold;
  margin: 0 0 0.3rem;
  color: #222;
  text-decoration: none;
}
.annuncio-title:hover {
	text-decoration: underline; 
}

.annuncio-price {
  font-size: 1.1rem;
  font-weight: bold;
  color: #007bff;
  margin: 0.2rem 0;
}
.annuncio-meta {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.3rem;
}
.annuncio-extra {
  font-size: 0.95rem;
  color: #333;
}

.foto-wrapper {
  position: relative;
}
.foto-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: .5rem;
  font-size: .9rem;
  border-bottom-left-radius: .3rem;
  border-bottom-right-radius: .3rem;
}
/* SCOMPARSA CARD/BOTTONI ---*/
.hidden { display: none !important; }

/* ----- IMMAGINI ----*/
/* aggiunto per descrizione trasparente sopra l'immagine */
.foto-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
.foto-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: .5rem;
  font-size: .9rem;
  text-align: center;
  border-bottom-left-radius: .3rem;
  border-bottom-right-radius: .3rem;
}
/* anche ne carosello */
.foto-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.foto-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: .5rem;
  font-size: .9rem;
  text-align: center;
  border-bottom-left-radius: .3rem;
  border-bottom-right-radius: .3rem;
}

/* Overlay su thumbs */
.gallery-thumb {
  position: relative;
  display: inline-block;
  margin: .3rem;
}
.gallery-thumb img {
  max-width: 160px;
  cursor: pointer;
  border: 1px solid #ddd;
}
.foto-caption-thumb {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: .75rem;
  padding: .2rem;
  text-align: center;
  opacity: 0;
  transition: opacity .3s;
}
.gallery-thumb:hover .foto-caption-thumb {
  opacity: 1;
}
/* ----------- check box in linea in Modifica annuncio----------*/
.in_linea {
    display: inline-flex; /* Allinea gli elementi in linea */
    /* align-items: center; /* Centra gli elementi verticalmente */
	/* font-weight: none;
	  display: flex; */
	/*display: flex; /* Allinea gli elementi in riga */
	justify-content: space-between; /* Spinge la checkbox a sinistra e il testo a destra */
	/*align-items: center; /* Allinea verticalmente gli elementi (opzionale) */
	/* width: 300px; /* Imposta la larghezza totale */
	padding: 5px; /* Spazio interno (opzionale) */
    cursor: pointer; /* Indica che è cliccabile */
}
.in_linea input[type="checkbox"] {
  /* Puoi aggiungere qui stili specifici per la checkbox se necessario */
  width: 34px;
  margin-right: 3px; /* Aggiunge un piccolo spazio tra la checkbox e il testo */
}
.in_linea-text {
  /* Imposta la larghezza massima del testo */
  max-width: 340px; /* Sostituisci 210px con il valore desiderato */
  /* O usa flex-basis per controllare la dimensione in un contesto flex */
  /* flex-basis: 100px; */
  white-space: nowrap; /* Per evitare che il testo vada a capo */
  overflow: hidden; /* Nasconde il testo se supera la larghezza */
  text-overflow: ellipsis; /* Mostra "..." se il testo è troncato */
}



/* ================================
   Annunci in evidenza (carosello)
================================ */
.featured-announcements {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
}
.featured-announcement-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0,0,0,.05);
  padding: 0.8rem;
  width: 220px;
  transition: transform 0.2s;
}
.featured-announcement-card:hover {
  transform: translateY(-3px);
}

/* ---- Dettaglio annuncio layout ---- */
.annuncio-dettaglio {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

/* header: immagine a sinistra, info a destra */
.annuncio-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* immagine principale */
.annuncio-foto {
  flex: 0 0 320px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .6rem;
}
.annuncio-foto img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  max-width: 500px;
}

/* cuoricino cliccabile */
.preferito {
  font-size: 1.8rem;
  cursor: pointer;
  margin-left: 1rem;
  transition: transform 0.2s;
}
.preferito:hover {
  transform: scale(1.3);
}


/* utente-avatar */
.utente-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
}
.utente-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
/* utente-avatar */

/* Pulsante Modifica */
.annuncio-actions {
  margin-top: 0.8rem;
}
.btn-modifica {
  display: inline-block;
  background: #0d6efd;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-modifica:hover {
  background: #0b5ed7;
}

/* info a destra */
.annuncio-info {
	flex: 1; 
	min-width: 220px; 
}
.annuncio-categoria .badge {
  display:inline-block; 
  padding: .3rem .6rem; 
  background:#0d6efd; 
  color:#fff; 
  border-radius:6px; 
  font-size:.85rem;
}
.annuncio-meta-top {
	font-size: .85rem; 
	color:#555; 
	margin: .4rem 0; 
	display:flex; gap: .8rem; 
	align-items:center; 
}
.preferito { 
	background:none; border:none; 
	font-size:1.2rem; color:#e74c3c; 
	cursor:pointer; 
}
.annuncio-titolo { 
	font-size:1.4rem; 
	font-weight:700; 
	margin: .2rem 0; }
.annuncio-luogo { 
	font-size:.95rem; 
	color:#666; 
	margin-bottom:.4rem; }
.annuncio-prezzo {
	font-size:1.6rem; 
	font-weight:800; 
	color:#007bff; 
	margin-bottom:.6rem; }
.annuncio-pubblicita {
	min-height:40px; 
	border:1px dashed #ccc; 
	border-radius:6px; 
	text-align:center; 
	color:#888; 
	padding:.5rem; }

/* Spostamento blocco autore */
.annuncio-utente {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

/* Altre informazioni (meta) */
.annuncio-meta-dinamica {
  margin-top: 1rem;
}
.meta-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.meta-card {
  display: flex;
  max-width: 550px;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
}
.meta-label {
  font-weight: 600;
  color: #333;
}
.meta-value {
  color: #555;
}

/* responsive */
@media (max-width: 900px) {
  .meta-card {
	  flex-direction: column; 
	  align-items: flex-start; 
	 }
}


/* dati principali sotto */
.annuncio-dati-principali {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 0.5rem;
}

.annuncio-dati-principali .dato {
  font-size: 0.85rem;
  color: #333;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

.annuncio-dati-principali h2, .annuncio-descrizione h2 {
	font-size:1.1rem; 
	font-weight:700; 
	margin-bottom:.5rem; 
}
.dati-riga { display:flex; flex-wrap:wrap; gap:.6rem; }
.dati-riga .dato { background:#f8f9fa; border-radius:6px; padding:.35rem .6rem; font-size:.95rem; color:#333; }

/* descrizione */
.annuncio-descrizione p {
	font-size:.98rem; 
	line-height:1.5; 
	color:#333; 
}
.checkbox-info {
	font-size:.95rem; 
	color:#444; 
	margin-top:.6rem; 
}

/* layout responsive */
@media (max-width: 900px) {
  .annuncio-header { flex-direction: column; }
  .annuncio-foto {
	  width:100%; 
	  max-width:400px; 
	  flex: none; 
  }
  .annuncio-info { width:100%; }
  .annuncio-utente { justify-content:flex-start; }
}

/* gallery immagini extra */
.annuncio-gallery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.annuncio-gallery img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .2s;
}
.annuncio-gallery img:hover { transform: scale(1.05); }

/* lightbox fullscreen */
#lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left:0; top:0; width:100%; height:100%;
  background: rgba(0,0,0,0.9);
  text-align: center;
}

#lightbox .close {
  position: absolute;
  top:20px; right:35px;
  color:#fff;
  font-size:40px;
  cursor:pointer;
}
/* lightbox con carosello */
#lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  text-align: center;
}
#lightbox img {
  max-width: 100%;
  max-height: 95%;
  margin-top: 2%;
  border-radius: 8px;
  text-align: center;
}

#lightbox .close {
  position: absolute;
  top: 20px; right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}
#lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  padding: 0 15px;
}
#lightbox .nav.prev { left: 10px; }
#lightbox .nav.next { right: 10px; }
#lightbox-caption {
  margin-top: 10px;
  color: #ccc;
  font-size: 0.9rem;
}
/* Mappa annuncio */
.annuncio-mappa {
  margin-top: 1rem;
}
#map {
  width: 80%;
  height: 300px;
  border-radius: 8px;
  border: 1px solid #ddd;
    text-align: center;

}

/* ---notifiche in annunci.css--*/
/* Toast notifiche */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #333;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInOut 4s forwards;
}

.toast.success {
  background: #28a745;
}
.toast.error {
  background: #dc3545;
}
.toast.info {
  background: #007bff;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* MODIFICA ANNUNCIO */
.fixed-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    box-sizing: border-box;
}

@media (min-width: 1000px) {
    .fixed-buttons {
        max-width: 1000px;
        left: 50%;
        transform: translateX(-50%);
    }
}