/* Stili per l'admin */
.uploader {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.pb-upload-button {
    white-space: nowrap;
}

/* Stile per il color picker */
.wp-picker-container {
    vertical-align: middle;
}

/* Stili per il frontend - MULTIPLI */
.pb-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.pb-popup {
  background: #fff;
  position: relative;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease-in-out;
  max-width: 90%;
  max-height: 90%;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.pb-popup.open {
  opacity: 1;
  transform: scale(1);
}

.pb-close {
  position: absolute;
  top: 5px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: background 0.3s;
}

.pb-close:hover {
  background: rgba(0,0,0,0.8);
}

.pb-popup img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-popup a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.pb-timer {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-family: sans-serif;
  z-index: 5;
}

/* Stili per quando ci sono più popup sovrapposti */
.pb-overlay:nth-of-type(1) { z-index: 10000; }
.pb-overlay:nth-of-type(2) { z-index: 10001; }
.pb-overlay:nth-of-type(3) { z-index: 10002; }
.pb-overlay:nth-of-type(4) { z-index: 10003; }
.pb-overlay:nth-of-type(5) { z-index: 10004; }

@media (max-width: 768px) {
  .pb-popup {
    width: 90% !important;
    height: auto !important;
    max-height: 80vh;
    aspect-ratio: 1 / 1;
  }
  
  .pb-close {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }
  
  .pb-timer {
    font-size: 12px;
    padding: 4px 8px;
    bottom: 5px;
    left: 5px;
  }
}

/* Animazione per popup successivi */
@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pb-popup.open {
  animation: popupFadeIn 0.3s ease-out;
}