/**
 * Cookie Consent Banner Styles
 * Cute, modern and RGPD-compliant design
 * Compatible with HelloKomparo theme
 */

/* ============================================
   Cookie Banner Container
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 420px;
  width: calc(100% - 40px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.cookie-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Dark theme support */
[data-bs-theme="dark"] .cookie-banner {
  background: #1f2937;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Banner Content
   ============================================ */
.cookie-banner-content {
  padding: 20px;
}

/* ============================================
   Header
   ============================================ */
.cookie-banner-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.cookie-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: cookieBounce 2s ease-in-out infinite;
}

@keyframes cookieBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.cookie-banner-title h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #111827;
}

[data-bs-theme="dark"] .cookie-banner-title h3 {
  color: #f9fafb;
}

.cookie-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

[data-bs-theme="dark"] .cookie-subtitle {
  color: #9ca3af;
}

.cookie-banner-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.cookie-banner-close:hover {
  background: #f3f4f6;
  color: #111827;
  transform: rotate(90deg);
}

[data-bs-theme="dark"] .cookie-banner-close:hover {
  background: #374151;
  color: #f9fafb;
}

/* ============================================
   Body
   ============================================ */
.cookie-banner-body {
  margin-bottom: 16px;
}

.cookie-description {
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
  margin-bottom: 16px;
}

[data-bs-theme="dark"] .cookie-description {
  color: #d1d5db;
}

/* ============================================
   Cookie Options (Collapsed by default)
   ============================================ */
.cookie-options {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.cookie-banner.expanded .cookie-options {
  max-height: 500px;
  opacity: 1;
  margin-bottom: 16px;
}

.cookie-category {
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
}

[data-bs-theme="dark"] .cookie-category {
  background: #111827;
  border-color: #374151;
}

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

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

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

.cookie-category-info i {
  font-size: 20px;
}

.cookie-category-info > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-category-info strong {
  font-size: 14px;
  color: #111827;
}

[data-bs-theme="dark"] .cookie-category-info strong {
  color: #f9fafb;
}

.cookie-category-description {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  padding-left: 28px;
}

[data-bs-theme="dark"] .cookie-category-description {
  color: #9ca3af;
}

/* ============================================
   Toggle Switch
   ============================================ */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

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

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

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-slider {
  background: #10b981;
}

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

.cookie-switch input:disabled + .cookie-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   Links
   ============================================ */
.cookie-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.cookie-banner.expanded .cookie-links {
  max-height: 100px;
  opacity: 1;
  margin-top: 12px;
}

.cookie-links a {
  font-size: 13px;
  color: #3b82f6;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.cookie-links a:hover {
  color: #2563eb;
  text-decoration: underline;
}

[data-bs-theme="dark"] .cookie-links a {
  color: #60a5fa;
}

[data-bs-theme="dark"] .cookie-links a:hover {
  color: #93c5fd;
}

/* ============================================
   Footer / Actions
   ============================================ */
.cookie-banner-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.cookie-banner-footer .btn {
  flex: 1;
  min-width: fit-content;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-customize {
  flex: 0 0 auto;
  order: -1;
  width: 100%;
  margin-bottom: 8px;
}

.cookie-banner.expanded .btn-customize {
  background: #f3f4f6;
  color: #111827;
}

[data-bs-theme="dark"] .cookie-banner.expanded .btn-customize {
  background: #374151;
  color: #f9fafb;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-outline-secondary {
  border: 1px solid #d1d5db;
  color: #6b7280;
  background: transparent;
}

.btn-outline-secondary:hover {
  background: #f3f4f6;
  color: #111827;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  border-color: #4b5563;
  color: #9ca3af;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background: #374151;
  color: #f9fafb;
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.bg-success {
  background: #10b981 !important;
  color: white;
}

.badge.bg-info {
  background: #3b82f6 !important;
  color: white;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 576px) {
  .cookie-banner {
    bottom: 0;
    right: 0;
    left: 0;
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

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

  .cookie-banner-content {
    padding: 16px;
  }

  .cookie-banner-title h3 {
    font-size: 16px;
  }

  .cookie-subtitle {
    font-size: 12px;
  }

  .cookie-description {
    font-size: 13px;
  }

  .cookie-banner-footer {
    flex-direction: column;
  }

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

  .btn-customize {
    order: 1;
    margin-bottom: 0;
    margin-top: 8px;
  }
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Cookie Settings Button in Footer
   ============================================ */
.cookie-settings-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
}

.cookie-settings-trigger:hover {
  color: #111827;
  background: #f3f4f6;
}

[data-bs-theme="dark"] .cookie-settings-trigger {
  color: #9ca3af;
}

[data-bs-theme="dark"] .cookie-settings-trigger:hover {
  color: #f9fafb;
  background: #374151;
}

/* ============================================
   Print Media
   ============================================ */
@media print {
  .cookie-banner {
    display: none !important;
  }
}
