/* Cookie Consent Banner - Style Zkriva */

/* Overlay fond */
.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Container du popup */
.cookie-consent-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 9999;
  width: 90%;
  max-width: 520px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-banner.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Card principale */
.cookie-consent-card {
  background: var(--zk-bg-modal, #fff);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: visible;
  position: relative;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

/* Image mascotte */
.cookie-consent-mascot {
  position: absolute;
  top: -40px;
  right: 20px;
  width: 120px;
  height: auto;
  z-index: 10;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  pointer-events: none;
}

/* Wrapper scrollable */
.cookie-consent-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(85vh - 80px);
  background: var(--zk-bg-modal, #fff);
  border-radius: 16px 16px 0 0;
}

/* Contenu */
.cookie-consent-body {
  padding: 2rem 2rem 1rem;
  position: relative;
}

.cookie-consent-greeting {
  font-family: "Caveat", cursive;
  font-size: 2rem;
  font-weight: 700;
  color: var(--zk-yellow, #f2d123);
  margin: 0 0 0.25rem;
  line-height: 1;
}

.cookie-consent-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--zk-text-primary, #1f2937);
  margin: 0 0 1rem;
}

.cookie-consent-title .hand {
  font-family: "Caveat", cursive;
  color: var(--zk-yellow, #f2d123);
}

/* Themes pour le style hand */
[data-theme="dark"] .cookie-consent-greeting,
[data-theme="dark"] .cookie-consent-title .hand {
  color: #f2d123;
}

[data-theme="zkriva"] .cookie-consent-greeting,
[data-theme="zkriva"] .cookie-consent-title .hand {
  color: #d2b491;
}

.cookie-consent-text {
  font-size: 0.9rem;
  color: var(--zk-text-secondary, #6b7280);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  padding-right: 80px;
}

.cookie-consent-text a {
  color: var(--zk-primary, #6366f1);
  text-decoration: underline;
}

/* Box des options */
.cookie-consent-options {
  background: var(--zk-bg-secondary, #f9fafb);
  border: 1px solid var(--zk-border, #e5e7eb);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.cookie-consent-options-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--zk-text-primary, #1f2937);
  margin: 0 0 0.75rem;
}

.cookie-consent-option {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.85rem;
  color: var(--zk-text-secondary, #6b7280);
  line-height: 1.5;
}

.cookie-consent-option + .cookie-consent-option {
  margin-top: 0.5rem;
}

.cookie-consent-option-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: var(--zk-text-primary, #1f2937);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.cookie-consent-option-icon svg {
  width: 12px;
  height: 12px;
  color: #fff;
}

.cookie-consent-hint {
  font-size: 0.85rem;
  color: var(--zk-text-muted, #9ca3af);
  margin: 0 0 1.25rem;
}

/* Footer avec boutons - toujours visible */
.cookie-consent-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid var(--zk-border, #e5e7eb);
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--zk-bg-modal, #fff);
  border-radius: 0 0 16px 16px;
}

.cookie-consent-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Boutons style Zkriva (pas arrondis) */
.cookie-consent-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* Bouton texte (personnaliser) */
.cookie-consent-btn-text {
  background: transparent;
  border: none;
  color: var(--zk-text-secondary, #6b7280);
  padding-left: 0;
}

.cookie-consent-btn-text:hover {
  color: var(--zk-text-primary, #1f2937);
  text-decoration: underline;
}

/* Bouton outline (essentiels) */
.cookie-consent-btn-outline {
  background: transparent;
  border: 1px solid var(--zk-border, #d1d5db);
  color: var(--zk-text-primary, #1f2937);
}

.cookie-consent-btn-outline:hover {
  background: var(--zk-bg-secondary, #f3f4f6);
  border-color: var(--zk-text-muted, #9ca3af);
}

/* Bouton primary (accepter) */
.cookie-consent-btn-primary {
  background: var(--zk-primary, #f2d123);
  border: none;
  color: #1f2937;
}

.cookie-consent-btn-primary:hover {
  background: var(--zk-primary-hover, #e5c31f);
  transform: translateY(-1px);
}

/* Bouton fermer (cercle en bas a gauche) */
.cookie-consent-close {
  position: absolute;
  bottom: -20px;
  left: 24px;
  width: 40px;
  height: 40px;
  background: var(--zk-bg-modal, #1f2937);
  border: 2px solid var(--zk-border, #374151);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--zk-text-secondary, #9ca3af);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cookie-consent-close:hover {
  background: var(--zk-text-primary, #111827);
  color: #fff;
  transform: scale(1.05);
}

.cookie-consent-close i {
  font-size: 1rem;
}

/* Panel des parametres detailles */
.cookie-consent-settings {
  display: none;
  padding: 0 2rem 1rem;
}

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

.cookie-consent-settings-inner {
  border-top: 1px solid var(--zk-border, #e5e7eb);
  padding-top: 1rem;
}

.cookie-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.cookie-setting-item + .cookie-setting-item {
  border-top: 1px solid var(--zk-border-light, #f3f4f6);
}

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

.cookie-setting-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--zk-text-primary, #1f2937);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-setting-label .badge {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--zk-text-muted, #9ca3af);
  background: var(--zk-bg-tertiary, #e5e7eb);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

.cookie-setting-desc {
  font-size: 0.8rem;
  color: var(--zk-text-muted, #9ca3af);
  margin-top: 0.25rem;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--zk-bg-tertiary, #d1d5db);
  border-radius: 12px;
  transition: background 0.2s;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--zk-primary, #f2d123);
}

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

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

/* Bouton save dans settings */
.cookie-consent-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

/* Responsive */
@media (max-width: 560px) {
  .cookie-consent-banner {
    width: 95%;
    max-width: none;
  }

  .cookie-consent-mascot {
    width: 80px;
    top: -25px;
    right: 10px;
  }

  .cookie-consent-body {
    padding: 1.5rem 1.25rem 1rem;
  }

  .cookie-consent-text {
    padding-right: 60px;
  }

  .cookie-consent-title {
    font-size: 1.25rem;
  }

  .cookie-consent-footer {
    padding: 1rem 1.25rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-footer-actions {
    flex-direction: column;
    width: 100%;
    margin-left: 0;
  }

  .cookie-consent-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .cookie-consent-btn-text {
    order: 3;
    padding: 0.5rem;
  }

  .cookie-consent-close {
    left: 50%;
    transform: translateX(-50%);
  }

  .cookie-consent-settings {
    padding: 0 1.25rem 1rem;
  }
}

/* Dark mode adjustments */
[data-theme="dark"] .cookie-consent-close {
  background: #374151;
  border-color: #4b5563;
}

[data-theme="dark"] .cookie-consent-close:hover {
  background: #4b5563;
}
