/**
 * LEEGA - Cookie Consent Styles (LGPD)
 * Design moderno, acessível e responsivo
 */

/* ========================================
   BANNER DE COOKIES
======================================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  padding: 24px;
  border-top: 3px solid #ffc359;
  animation: slideUp 0.4s ease-out;
  font-family: "Inter Tight", sans-serif;
}

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

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

.cookie-consent-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1c;
  margin: 0 0 8px 0;
}

.cookie-consent-description {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}

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

.cookie-consent-footer {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.cookie-consent-footer a {
  color: #ffc359;
  text-decoration: underline;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.cookie-consent-footer a:hover {
  color: #e6a940;
}

/* ========================================
   BOTÕES DO COOKIE CONSENT
======================================== */
.cookie-btn-primary,
.cookie-btn-primary-full {
  background: #ffc359;
  color: #1a1a1c;
  border: none;
  padding: 12px 24px;
  border-radius: 999px; /* Full rounded como o botão original */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-btn-primary:hover,
.cookie-btn-primary-full:hover {
  background: #e6a940;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 195, 89, 0.3);
}

.cookie-btn-primary-full {
  width: 100%;
  padding: 14px 24px;
}

.cookie-btn-secondary {
  background: transparent;
  color: #475569;
  border: 2px solid #e5e7eb;
  padding: 12px 24px;
  border-radius: 999px; /* Full rounded como o botão original */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-btn-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

/* ========================================
   MODAL DE CONFIGURAÇÕES
======================================== */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
  pointer-events: auto;
}

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

.cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  overflow: hidden;
  pointer-events: auto;
  z-index: 0;
  /* Não capturar eventos de scroll - deixar passar para o modal-content */
  touch-action: pan-y;
}

.cookie-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.3s ease-out;
  font-family: "Inter Tight", sans-serif;
  pointer-events: auto;
  z-index: 1;
  overflow: hidden;
  /* Garantir que eventos de scroll funcionem */
  touch-action: pan-y;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 2px solid #e5e7eb;
  background: linear-gradient(135deg, #ffc359 0%, #ffb633 100%);
}

.cookie-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1c;
  margin: 0;
}

.cookie-modal-close {
  background: rgba(26, 26, 28, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.cookie-modal-close:hover {
  background: rgba(26, 26, 28, 0.2);
  transform: rotate(90deg);
}

.cookie-modal-close svg {
  color: #1a1a1c;
}

.cookie-modal-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  pointer-events: auto;
  overscroll-behavior: contain;
  will-change: scroll-position;
}

.cookie-modal-intro {
  font-size: 14px;
  color: #475569;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.cookie-category {
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.cookie-category:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.cookie-category-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-category-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1c;
  margin: 0;
}

.cookie-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: #e5e7eb;
  color: #475569;
}

.cookie-badge-required {
  background: #ffc359;
  color: #1a1a1c;
}

.cookie-category-description {
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

.cookie-category-description small {
  display: block;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
}

/* ========================================
   TOGGLE SWITCH
======================================== */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.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: #cbd5e1;
  transition: 0.3s;
  border-radius: 28px;
}

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

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

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

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

.cookie-toggle-disabled .cookie-toggle-slider {
  cursor: not-allowed;
}

.cookie-modal-footer {
  padding: 20px 24px;
  border-top: 2px solid #e5e7eb;
  background: #f8fafc;
}

/* ========================================
   DARK MODE
======================================== */
.dark .cookie-consent-banner {
  background: #1f2937;
  border-top-color: #ffc359;
}

.dark .cookie-consent-title {
  color: #f3f4f6;
}

.dark .cookie-consent-description {
  color: #d1d5db;
}

.dark .cookie-btn-secondary {
  color: #d1d5db;
  border-color: #374151;
}

.dark .cookie-btn-secondary:hover {
  border-color: #4b5563;
  background: #111827;
}

.dark .cookie-modal-content {
  background: #1f2937;
}

.dark .cookie-modal-header {
  border-bottom-color: #374151;
}

.dark .cookie-modal-title {
  color: #1a1a1c;
}

.dark .cookie-modal-body {
  background: #1f2937;
}

.dark .cookie-modal-intro {
  color: #d1d5db;
}

.dark .cookie-category {
  background: #111827;
  border-color: #374151;
}

.dark .cookie-category:hover {
  border-color: #4b5563;
}

.dark .cookie-category-title {
  color: #f3f4f6;
}

.dark .cookie-category-description {
  color: #9ca3af;
}

.dark .cookie-modal-footer {
  border-top-color: #374151;
  background: #111827;
}

/* ========================================
   RESPONSIVO
======================================== */
@media (min-width: 768px) {
  .cookie-consent-content {
    flex-direction: row;
    align-items: center;
  }
  
  .cookie-consent-text {
    flex: 1;
  }
  
  .cookie-consent-actions {
    flex-shrink: 0;
  }
}

@media (max-width: 767px) {
  .cookie-consent-banner {
    padding: 20px 16px;
  }
  
  .cookie-consent-actions {
    flex-direction: column;
  }
  
  .cookie-consent-actions button {
    width: 100%;
  }
  
  .cookie-modal {
    padding: 10px;
  }
  
  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding: 16px;
  }
  
  .cookie-category-header {
    flex-wrap: wrap;
  }
}

