/* ============================================
   COOKIE CONSENT BANNER - DSGVO/TDDDG Compliant
   Matches Light Hunters Design System
   ============================================ */

/* --- Overlay --- */
.cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity var(--transition-medium);
  pointer-events: none;
}

.cc-overlay.cc-visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Banner Card --- */
.cc-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 520px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 28px 28px 24px;
  opacity: 0;
  transition: opacity var(--transition-medium), transform var(--transition-slow);
  pointer-events: none;
  font-family: var(--font-body);
}

.cc-banner.cc-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* --- Header --- */
.cc-banner__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cc-banner__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.cc-banner__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-black);
  line-height: 1.3;
}

/* --- Description --- */
.cc-banner__text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-light);
  margin-bottom: 20px;
}

.cc-banner__text a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.cc-banner__text a:hover {
  color: var(--color-accent);
}

/* --- Category Toggles --- */
.cc-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.cc-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  transition: border-color var(--transition-fast);
}

.cc-category:hover {
  border-color: var(--color-border);
}

.cc-category__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cc-category__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.cc-category__desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* --- Toggle Switch --- */
.cc-toggle {
  position: relative;
  flex-shrink: 0;
}

.cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle__slider {
  display: block;
  width: 40px;
  height: 22px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.cc-toggle__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--color-white);
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.cc-toggle input:checked + .cc-toggle__slider {
  background: var(--color-accent);
}

.cc-toggle input:checked + .cc-toggle__slider::after {
  transform: translateX(18px);
}

.cc-toggle input:disabled + .cc-toggle__slider {
  background: var(--color-accent);
  opacity: 0.6;
  cursor: not-allowed;
}

.cc-toggle input:focus-visible + .cc-toggle__slider {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Buttons --- */
.cc-banner__actions {
  display: flex;
  gap: 10px;
}

.cc-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  line-height: 1.3;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cc-btn--accept {
  background: var(--gradient-accent);
  color: var(--color-white);
}

.cc-btn--accept:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 149, 106, 0.3);
}

.cc-btn--reject {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.cc-btn--reject:hover {
  background: var(--color-border-light);
  border-color: var(--color-text-muted);
}

.cc-btn--save {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.cc-btn--save:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

/* --- Details Toggle --- */
.cc-details-toggle {
  display: inline-block;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.cc-details-toggle:hover {
  color: var(--color-accent-dark);
}

.cc-details-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Categories hidden by default, shown when expanded */
.cc-categories {
  display: none;
}

.cc-banner.cc-expanded .cc-categories {
  display: flex;
}

.cc-banner.cc-expanded .cc-banner__actions--initial {
  display: none;
}

.cc-banner__actions--detail {
  display: none;
}

.cc-banner.cc-expanded .cc-banner__actions--detail {
  display: flex;
}

/* --- Reopen Button (Cookie Icon) --- */
.cc-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9990;
  width: 44px;
  height: 44px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0;
  pointer-events: none;
  padding: 0;
}

.cc-reopen.cc-visible {
  opacity: 1;
  pointer-events: auto;
}

.cc-reopen:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

.cc-reopen:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cc-reopen__icon {
  width: 22px;
  height: 22px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .cc-banner {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 22px 20px 20px;
  }

  .cc-banner__actions {
    flex-direction: column;
    gap: 8px;
  }

  .cc-reopen {
    bottom: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .cc-overlay,
  .cc-banner,
  .cc-reopen {
    transition: none;
  }

  .cc-toggle__slider::after {
    transition: none;
  }
}
