/* --- BANNER COOKIE IN STILE BOOMERPOP --- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a2e;
  color: white;
  padding: 25px;
  text-align: center;
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Segoe UI', sans-serif;
}

#cookie-banner.show {
  transform: translateY(0);
}

#cookie-banner p {
  margin: 0 0 20px 0;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: #e0e0ff;
}

#cookie-banner a {
  color: #8a2be2;
  text-decoration: underline;
  font-weight: 600;
  text-shadow: 0 0 2px rgba(138, 43, 226, 0.3);
}

#cookie-banner a:hover {
  color: #ff80ff;
  text-shadow: 0 0 4px rgba(255, 128, 255, 0.5);
}

.cookie-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cookie-btn {
  background: #6200ea;
  color: white;
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(98, 0, 234, 0.4);
  letter-spacing: 0.5px;
  min-width: 140px;
}

.cookie-btn:hover {
  background: #7c4dff;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(98, 0, 234, 0.5);
}

.cookie-btn.accept {
  background: #00c853;
  box-shadow: 0 4px 12px rgba(0, 200, 83, 0.4);
}

.cookie-btn.accept:hover {
  background: #00e676;
  transform: translateY(-2px) scale(1.05);
}

.cookie-btn.reject {
  background: #d50000;
  box-shadow: 0 4px 12px rgba(213, 0, 0, 0.4);
}

.cookie-btn.reject:hover {
  background: #ff1744;
}

.cookie-btn.secondary {
  background: transparent;
  border: 2px solid #8a2be2;
  color: #bb86fc;
}

.cookie-btn.secondary:hover {
  background: rgba(138, 43, 226, 0.1);
  color: white;
}

/* --- PULSANTE PREFERENZE COOKIE --- */
#cookie-preferences-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #6200ea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(98, 0, 234, 0.4);
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: all 0.3s ease;
  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(98, 0, 234, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(98, 0, 234, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(98, 0, 234, 0);
  }
}

#cookie-preferences-btn:hover {
  transform: scale(1.15) rotate(180deg);
  background: #7c4dff;
  animation: none;
}

#cookie-preferences-btn::after {
  content: "⚙️";
}

/* --- MODAL PREFERENZE COOKIE --- */
#preferences-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #1e1e30;
  border-radius: 16px;
  padding: 32px;
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-family: 'Segoe UI', sans-serif;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #3a3a5c;
}

.modal-header h2 {
  margin: 0;
  color: #bb86fc;
  font-size: 1.6rem;
  font-weight: 600;
}

.close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #9a9a9a;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: rotate(90deg);
}

.preference-item {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #3a3a5c;
}

.preference-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.preference-item h3 {
  margin: 0 0 12px 0;
  color: #e0e0ff;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 500;
}

.preference-item h3::before {
  content: "🔹";
  font-size: 1.2em;
}

.switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  margin-left: 8px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  transition: .3s;
  border-radius: 30px;
  border: 2px solid #555;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background: #6200ea;
  border-color: #7c4dff;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.preference-description {
  font-size: 0.92rem;
  color: #aaa;
  margin-top: 6px;
  line-height: 1.6;
  font-style: italic;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #3a3a5c;
}

.save-preferences {
  background: #6200ea;
  color: white;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(98, 0, 234, 0.4);
  min-width: 140px;
}

.save-preferences:hover {
  background: #7c4dff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(98, 0, 234, 0.5);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  #cookie-banner {
    padding: 20px 15px;
  }
  
  #cookie-banner p {
    font-size: 0.95rem;
    max-width: 100%;
  }
  
  .cookie-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cookie-btn {
    width: 100%;
    max-width: 280px;
    padding: 14px;
  }
  
  .modal-content {
    padding: 24px;
    margin: 15px;
  }
  
  .modal-header h2 {
    font-size: 1.4rem;
  }
  
  #cookie-preferences-btn {
    width: 50px;
    height: 50px;
    bottom: 18px;
    right: 18px;
    font-size: 18px;
  }
}