/**
 * Cookie Consent Banner Styles
 * GDPR-Compliant Cookie Consent UI
 */

/* ==========================================
   BANNER STYLES
   ========================================== */

.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

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

.cookie-consent-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.cookie-consent-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex: 1;
}

.cookie-icon {
  flex-shrink: 0;
  color: #022C22;
  width: 32px;
  height: 32px;
}

.cookie-text {
  flex: 1;
}

.cookie-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #1f2937;
}

.cookie-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
}

.cookie-link {
  color: #022C22;
  text-decoration: underline;
  transition: color 0.2s;
  font-weight: 500;
}

.cookie-link:hover {
  color: #065F46;
}

.cookie-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 767px) {
  .cookie-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cookie-btn {
    width: 100%;
  }
}

/* ==========================================
   BUTTON STYLES
   ========================================== */

.cookie-btn {
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #022C22;
  color: #ffffff;
  border-color: #022C22;
}

.cookie-btn-accept:hover {
  background: #044d3b;
  border-color: #044d3b;
  color: #fff;
}

.cookie-btn-settings {
  background: transparent;
  color: #022C22;
  border-color: #022C22;
}

.cookie-btn-settings:hover {
  background: #022C22;
  color: #ffffff;
}

.cookie-btn-reject {
  background: transparent;
  color: #4C524F;
  border-color: #D9DEDD;
}

.cookie-btn-reject:hover {
  background: #EDF2F1;
  color: #1D1F1E;
  border-color: #C7CFCD;
}

.cookie-btn-secondary {
  background: transparent;
  color: #022C22;
  border-color: #022C22;
}

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

/* ==========================================
   MODAL STYLES
   ========================================== */

.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

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

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.cookie-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 1rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.cookie-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
}

.cookie-modal-close:hover {
  color: #1f2937;
  background: #f3f4f6;
}

.cookie-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cookie-modal-intro {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
  margin: 0 0 1.5rem 0;
}

/* ==========================================
   COOKIE CATEGORIES
   ========================================== */

.cookie-category {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

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

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

.cookie-category-info {
  flex: 1;
}

.cookie-category-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.cookie-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: #EDF2F1;
  color: #4C524F;
  font-weight: 500;
}

.cookie-badge-required {
  background: #D1FAE5;
  color: #065F46;
}

.cookie-category-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
}

/* ==========================================
   TOGGLE SWITCH
   ========================================== */

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

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

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

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

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: #022C22;
}

.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-toggle input:disabled {
  cursor: not-allowed;
}

/* ==========================================
   MODAL FOOTER
   ========================================== */

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

@media (max-width: 640px) {
  .cookie-modal-footer {
    flex-direction: column-reverse;
  }

  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}

.cookie-modal-footer-text {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.cookie-modal-footer-text p {
  margin: 0;
  line-height: 1.5;
}

.cookie-modal-footer-text a {
  color: #022C22;
  text-decoration: underline;
  font-weight: 500;
}

.cookie-modal-footer-text a:hover {
  color: #065F46;
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.cookie-btn:focus-visible,
.cookie-modal-close:focus-visible,
.cookie-toggle:focus-within {
  outline: 2px solid #BEF264;
  outline-offset: 2px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-settings-modal,
  .cookie-btn,
  .cookie-toggle-slider,
  .cookie-toggle-slider:before {
    transition: none;
  }
}
