/**
 * Stili per Cookie Consent Banner e Modal Preferenze
 */

/* Banner Cookie */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #2b3445;
  background-color: rgba(43, 52, 69, 0.9);
  color: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 2040; /* Sotto le modal (2060) ma sopra altri elementi */
  display: none;
}

/* Quando una modal è aperta, nascondi il banner cookie */
body.modal-open #cookie-consent-banner {
  display: none !important;
}

body.cookie-banner-visible {
  padding-bottom: 120px; /* Spazio per il banner su mobile */
}

@media (min-width: 768px) {
  body.cookie-banner-visible {
    padding-bottom: 80px;
  }
}

#cookie-consent-banner .cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

#cookie-consent-banner .cookie-banner-text {
  flex: 1 1 300px;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0;
}

#cookie-consent-banner .cookie-banner-text a {
  color: #ffffff;
  text-decoration: underline;
}

#cookie-consent-banner .cookie-banner-text a:hover {
  color: rgba(255, 255, 255, 0.8);
}

#cookie-consent-banner .cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

#cookie-consent-banner .btn-cookie {
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

#cookie-consent-banner .btn-cookie-accept {
  background: #FFCC00;
  color: #000;
  position: relative;
}

#cookie-consent-banner .btn-cookie-accept::before {
  content: "✓";
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: bold;
  color: #000;
}

#cookie-consent-banner .btn-cookie-accept:hover {
  background: #e6b800;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(255, 204, 0, 0.3);
}

#cookie-consent-banner .btn-cookie-reject {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

#cookie-consent-banner .btn-cookie-reject::before {
  content: "✕";
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: bold;
  color: #ffffff;
}

#cookie-consent-banner .btn-cookie-reject:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

#cookie-consent-banner .btn-cookie-preferences {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#cookie-consent-banner .btn-cookie-preferences:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Modal Preferenze Cookie */
#cookie-preferences-modal .modal-header {
  background: #2b3445;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#cookie-preferences-modal .modal-header .close {
  color: #ffffff;
  opacity: 0.8;
}

#cookie-preferences-modal .modal-header .close:hover {
  opacity: 1;
}

#cookie-preferences-modal .cookie-category {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

#cookie-preferences-modal .cookie-category:last-child {
  border-bottom: none;
}

#cookie-preferences-modal .cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

#cookie-preferences-modal .cookie-category-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

#cookie-preferences-modal .cookie-category-description {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

#cookie-preferences-modal .cookie-category-required {
  font-size: 0.75rem;
  color: #6c757d;
  font-style: italic;
}

#cookie-preferences-modal .form-check {
  margin-top: 0.5rem;
}

#cookie-preferences-modal .form-check-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#cookie-preferences-modal .modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1rem;
}

#cookie-preferences-modal .btn-save-preferences {
  background: #FFCC00;
  color: #000;
  border: none;
  font-weight: 600;
}

#cookie-preferences-modal .btn-save-preferences:hover {
  background: #e6b800;
}

/* Responsive */
@media (max-width: 575.98px) {
  #cookie-consent-banner {
    padding: 0.75rem 1rem;
  }
  
  #cookie-consent-banner .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  #cookie-consent-banner .cookie-banner-text {
    margin-bottom: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    flex: none;
    width: 100%;
  }
  
  #cookie-consent-banner .cookie-banner-actions {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0;
  }
  
  #cookie-consent-banner .btn-cookie {
    width: 100%;
    padding: 0.5rem 1rem;
  }
}

