/* Cookie Consent Banner Styles */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 20px;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  display: none; /* Hidden by default */
}

.cookie-consent-banner.show {
  display: block;
}

.cookie-message {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.cookie-message p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.cookie-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-controls button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cookie-controls button:first-child {
  background-color: #28a745;
  color: white;
}

.cookie-controls button:first-child:hover {
  background-color: #218838;
}

.cookie-controls button:nth-child(2) {
  background-color: #6c757d;
  color: white;
}

.cookie-controls button:nth-child(2):hover {
  background-color: #5a6268;
}

.cookie-controls a {
  color: #ffc107;
  text-decoration: none;
  padding: 10px;
  font-size: 14px;
}

.cookie-controls a:hover {
  text-decoration: underline;
}

/* Cookie Settings Modal Styles */
.cookie-settings-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.cookie-settings-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-modal-content {
  background-color: white;
  margin: 20px;
  padding: 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  /* Let the body inside handle scrolling */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex; /* enable column layout for sticky footer */
  flex-direction: column;
  /* Allow children to size/shrink correctly within flex container */
  min-height: 0;
}

/* Scrollable body area within the modal */
.cookie-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0; /* ensures proper flexbox scrolling */
}

.cookie-modal-content h3 {
  margin-top: 0;
  color: #333;
  font-size: 24px;
  margin-bottom: 20px;
}

.cookie-category {
  margin-bottom: 25px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.cookie-category h4 {
  margin: 0 0 10px 0;
  color: #444;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-category p {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
}

.cookie-category label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.cookie-category input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}

.cookie-category input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.cookie-modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  /* Push footer to the bottom of the modal using flex layout */
  margin-top: auto;
  /* Keep a little separation from content */
  padding-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  /* Fit-content width aligned to the right (full width on mobile overridden below) */
  align-self: flex-end;
  width: -moz-fit-content;
  width: fit-content;
  flex: 0 0 auto;
  background: transparent;
  box-shadow: none;
}

.cookie-modal-buttons button {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cookie-modal-buttons button:first-child {
  background-color: #28a745;
  color: white;
}

.cookie-modal-buttons button:first-child:hover {
  background-color: #218838;
}

.cookie-modal-buttons button:last-child {
  background-color: #6c757d;
  color: white;
}

.cookie-modal-buttons button:last-child:hover {
  background-color: #5a6268;
}

.cookie-always-active {
  color: #28a745;
  font-weight: 500;
  font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cookie-message {
    flex-direction: column;
    text-align: center;
  }

  .cookie-controls {
    justify-content: center;
    width: 100%;
  }

  .cookie-controls button {
    flex: 1;
    min-width: 120px;
  }

  .cookie-modal-content {
    margin: 10px;
    padding: 20px;
  }

  .cookie-modal-buttons {
  flex-direction: column;
  /* On mobile, let the footer span full width for stacked buttons */
  align-self: stretch;
  width: 100%;
  }

  .cookie-modal-buttons button {
    width: 100%;
  }
}

/* Animation for banner */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent-banner.show {
  animation: slideUp 0.3s ease-out;
}
