/**
 * Cookie Consent Styles for Take My Pet
 * Responsive and accessible design
 */

/* Cookie Banner */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  border-top: 3px solid var(--primary-orange, #ff8c00);
}

#cookie-consent-banner.show {
  transform: translateY(0);
}

#cookie-consent-banner.hide {
  transform: translateY(100%);
}

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

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

.cookie-banner-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-orange, #ff8c00);
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #ecf0f1;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* Modal */
#cookie-preferences-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cookie-preferences-modal.show {
  opacity: 1;
  visibility: visible;
}

#cookie-preferences-modal.hide {
  opacity: 0;
  visibility: hidden;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-orange, #ff8c00);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.modal-close:hover {
  color: #333;
  background-color: #f0f0f0;
}

.modal-body {
  padding: 1.5rem;
}

.cookie-category {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

.cookie-category:last-child {
  margin-bottom: 0;
}

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

.category-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #2c3e50;
}

.cookie-category p {
  margin: 0 0 1rem 0;
  color: #555;
  line-height: 1.5;
}

.cookie-details {
  font-size: 0.85rem;
  color: #666;
  background: white;
  padding: 0.75rem;
  border-radius: 4px;
  border-left: 3px solid var(--primary-orange, #ff8c00);
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
}

.toggle-container input[type="checkbox"] {
  display: none;
}

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

.toggle-label input:disabled + .toggle-label {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.toggle-switch:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

input:checked + .toggle-label .toggle-switch {
  background-color: var(--primary-orange, #ff8c00);
}

input:checked + .toggle-label .toggle-switch:before {
  transform: translateX(26px);
}

input:disabled + .toggle-label .toggle-switch {
  background-color: #4CAF50 !important;
  opacity: 0.6;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-link {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1;
}

.btn-primary {
  background-color: var(--primary-orange, #ff8c00);
  color: white;
}

.btn-primary:hover {
  background-color: #e07b00;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}

.btn-link {
  background-color: transparent;
  color: var(--primary-orange, #ff8c00);
  text-decoration: underline;
  padding: 0.5rem 1rem;
}

.btn-link:hover {
  color: #e07b00;
  text-decoration: none;
}

.modal-footer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}


/* Responsive Design */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .cookie-banner-actions {
    flex-direction: column;
    width: 100%;
  }

  .cookie-banner-actions button {
    width: 100%;
    margin: 0;
  }

  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #cookie-consent-banner {
    padding: 1rem;
  }

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

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

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .cookie-category {
    padding: 1rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #cookie-consent-banner {
    border: 2px solid white;
  }
  
  .modal-content {
    border: 2px solid #000;
  }
  
  .toggle-switch {
    border: 1px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #cookie-consent-banner,
  .modal-content,
  .toggle-switch:before,
  .btn-primary,
  .btn-secondary {
    transition: none;
  }
  
  @keyframes modalSlideIn {
    from, to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}