/* css/cookie-banner.css - Cookie Banner Styles */

/* ============================================
   COOKIE BANNER
   ============================================ */

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideUp 0.4s ease;
  border-top: 4px solid var(--salvia);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 25px;
  align-items: center;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text h3 {
  font-size: 1.3em;
  color: var(--salvia);
  margin-bottom: 8px;
  font-weight: 700;
}

.cookie-banner-text p {
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0;
  font-size: 0.95em;
}

.cookie-banner-text strong {
  color: var(--ocra);
}

.cookie-banner-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: 'Roboto', sans-serif;
}

.cookie-accept {
  background: var(--salvia);
  color: white;
  box-shadow: 0 4px 12px rgba(95, 142, 125, 0.3);
}

.cookie-accept:hover {
  background: var(--ocra);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(223, 169, 80, 0.4);
}

.cookie-settings {
  background: white;
  color: var(--salvia);
  border: 2px solid var(--salvia);
}

.cookie-settings:hover {
  background: var(--salvia-light);
  border-color: var(--ocra);
  color: var(--ocra);
}

.cookie-decline {
  background: transparent;
  color: #666;
  border: 2px solid #ddd;
}

.cookie-decline:hover {
  background: #f5f5f5;
  border-color: #999;
  color: var(--text-dark);
}

.cookie-banner-links {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 10px;
  font-size: 0.85em;
}

.cookie-banner-links a {
  color: var(--ocra);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.cookie-banner-links a:hover {
  color: var(--salmone);
  text-decoration: underline;
}

/* ============================================
   COOKIE SETTINGS MODAL
   ============================================ */

#cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.cookie-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.cookie-modal-content h2 {
  color: var(--salvia);
  font-size: 1.8em;
  margin-bottom: 15px;
  font-weight: 800;
}

.cookie-category {
  background: var(--salvia-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border: 2px solid rgba(95, 142, 125, 0.2);
  transition: 0.3s;
}

.cookie-category:hover {
  border-color: var(--ocra);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.cookie-category-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px;
  align-items: start;
}

.cookie-category h3 {
  font-size: 1.1em;
  color: var(--text-dark);
  margin-bottom: 5px;
  font-weight: 700;
}

.cookie-category p {
  font-size: 0.9em;
  color: #666;
  line-height: 1.5;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  margin-top: 4px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: var(--salvia);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
  transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.cookie-modal-buttons .cookie-btn {
  flex: 1;
  min-width: 140px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .cookie-banner-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cookie-banner-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  #cookie-banner {
    border-top-width: 3px;
  }

  .cookie-banner-content {
    padding: 20px;
  }

  .cookie-banner-text h3 {
    font-size: 1.1em;
  }

  .cookie-banner-text p {
    font-size: 0.9em;
  }

  .cookie-banner-buttons {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    font-size: 0.9em;
  }

  .cookie-modal-content {
    padding: 30px 25px;
    max-height: 90vh;
  }

  .cookie-modal-content h2 {
    font-size: 1.5em;
  }

  .cookie-category {
    padding: 15px;
  }

  .cookie-category-header {
    gap: 12px;
  }

  .cookie-modal-buttons {
    flex-direction: column;
  }

  .cookie-modal-buttons .cookie-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .cookie-banner-content {
    padding: 15px;
  }

  .cookie-banner-text h3 {
    font-size: 1em;
  }

  .cookie-banner-text p {
    font-size: 0.85em;
  }

  .cookie-btn {
    padding: 8px 12px;
    font-size: 0.85em;
  }

  .cookie-banner-links {
    font-size: 0.8em;
    margin-top: 8px;
  }

  .cookie-modal-content {
    padding: 25px 20px;
    border-radius: 16px;
  }

  .cookie-modal-content h2 {
    font-size: 1.3em;
    margin-bottom: 12px;
  }

  .cookie-category {
    padding: 12px;
    border-radius: 10px;
  }

  .cookie-category h3 {
    font-size: 1em;
  }

  .cookie-category p {
    font-size: 0.85em;
  }

  .cookie-toggle {
    width: 44px;
    height: 24px;
  }

  .cookie-toggle-slider:before {
    height: 18px;
    width: 18px;
  }

  .cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(20px);
  }
}

/* ============================================
   DARK MODE SUPPORT (optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Se in futuro implementi dark mode, puoi aggiungere gli stili qui */
}
