/**
 * Cookie Consent Styles for The Crooked House
 * Standalone CSS implementation adapted from FFC template
 */

/* Cookie Banner Styles */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background-color: #ffffff;
  border-top: 2px solid #e5e7eb;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
}

.cookie-banner-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cookie-banner-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

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

.cookie-banner h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.cookie-banner p {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.cookie-banner-links {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.cookie-banner-links a {
  color: #2563eb;
  text-decoration: none;
}

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

.cookie-banner-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .cookie-banner-buttons {
    flex-direction: row;
    width: auto;
  }
}

/* Cookie Button Styles */
.cookie-btn {
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
}

.cookie-btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}

.cookie-btn-primary:hover {
  background-color: #1d4ed8;
}

.cookie-btn-secondary {
  background-color: #e5e7eb;
  color: #374151;
}

.cookie-btn-secondary:hover {
  background-color: #d1d5db;
}

/* Cookie Preferences Modal */
.cookie-preferences-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.cookie-modal-content {
  position: relative;
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 42rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.cookie-modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem 0;
}

.cookie-modal-content > p {
  color: #4b5563;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Cookie Category Styles */
.cookie-category {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
}

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

.cookie-category h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.cookie-category-desc {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0.5rem 0 0 0;
  line-height: 1.5;
}

/* Toggle Switch Styles */
.cookie-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.cookie-toggle label {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Custom Toggle Switch */
.cookie-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

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

.cookie-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.3s;
}

.cookie-toggle-input:checked + .cookie-toggle-label .cookie-toggle-slider {
  background-color: #2563eb;
}

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

.cookie-toggle-input:focus + .cookie-toggle-label .cookie-toggle-slider {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Modal Buttons */
.cookie-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .cookie-modal-buttons {
    flex-direction: row;
  }
}

.cookie-modal-buttons .cookie-btn {
  flex: 1;
}

/* Accessibility improvements */
.cookie-btn:focus,
.cookie-toggle-input:focus + .cookie-toggle-label {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Smooth scrolling for modal content */
.cookie-modal-content {
  scroll-behavior: smooth;
}

/* Ensure text is readable on all backgrounds */
.cookie-category p,
.cookie-category-desc {
  color: #374151;
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
  .cookie-banner-content {
    padding: 1rem;
  }
  
  .cookie-banner h3 {
    font-size: 1rem;
  }
  
  .cookie-banner p {
    font-size: 0.8125rem;
  }
  
  .cookie-modal-content {
    padding: 1rem;
  }
  
  .cookie-modal-content h2 {
    font-size: 1.25rem;
  }
  
  .cookie-category {
    padding: 0.75rem;
  }
}
