/**
 * SoCare Cookie Consent – Universal Styles v1.0
 * Wiederverwendbar für alle Projekte
 * Zentriertes Modal mit Overlay, DSGVO-konform
 */

/* ==========================================
   Overlay
   ========================================== */

.cookie-consent-overlay,
.cookie-banner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

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

/* ==========================================
   Banner / Modal (zentriert)
   ========================================== */

.cookie-consent-banner,
.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
  pointer-events: none;
}

.cookie-consent-banner.visible,
.cookie-banner.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html:has(.cookie-consent-banner.visible),
html:has(.cookie-banner.visible) {
  overflow: hidden;
}

/* ==========================================
   Inner Card
   ========================================== */

.cookie-consent-inner,
.cookie-banner__inner {
  max-width: 520px;
  width: 100%;
  background: rgba(10, 10, 10, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.cookie-consent-banner.visible .cookie-consent-inner,
.cookie-banner.visible .cookie-banner__inner {
  transform: scale(1);
}

/* ==========================================
   Title & Text
   ========================================== */

.cookie-consent-title,
.cookie-banner__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-consent-title::before,
.cookie-banner__title::before {
  content: '\1F36A';
  font-size: 18px;
}

.cookie-consent-text,
.cookie-banner__text {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.cookie-consent-text a,
.cookie-banner__text a {
  color: #e63946;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.cookie-consent-text a:hover,
.cookie-banner__text a:hover {
  color: #ff6b7a;
}

/* ==========================================
   Categories / Options
   ========================================== */

.cookie-consent-categories,
.cookie-banner__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 260px;
  overflow-y: auto;
}

.cookie-consent-category,
.cookie-banner__option {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cookie-consent-category:last-child,
.cookie-banner__option:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cookie-consent-category label,
.cookie-banner__option > label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
}

.cookie-consent-category input[type="checkbox"],
.cookie-banner__option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #e63946;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.cookie-consent-category-info,
.cookie-banner__option-info {
  flex: 1;
}

.cookie-consent-category-info strong,
.cookie-banner__option-info strong {
  font-size: 0.875rem;
  color: #fff;
}

.cookie-consent-badge,
.cookie-banner__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  margin-left: 6px;
  vertical-align: middle;
}

.cookie-consent-category-desc,
.cookie-banner__option-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin: 4px 0 0;
}

/* ==========================================
   Buttons / Actions
   ========================================== */

.cookie-consent-actions,
.cookie-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.cookie-consent-btn,
.cookie-banner__btn {
  padding: 14px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
  border: none;
  font-family: inherit;
}

/* Alle akzeptieren */
.cookie-consent-btn--accept,
.cookie-banner__btn--accept {
  background: #e63946;
  color: #fff;
  border: 1px solid #e63946;
}

.cookie-consent-btn--accept:hover,
.cookie-banner__btn--accept:hover {
  background: #d63447;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4);
}

/* Auswahl speichern */
.cookie-consent-btn--save,
.cookie-banner__btn--save {
  background: transparent;
  color: #e63946;
  border: 1px solid #e63946;
}

.cookie-consent-btn--save:hover,
.cookie-banner__btn--save:hover {
  background: rgba(230, 57, 70, 0.15);
}

/* Ablehnen */
.cookie-consent-btn--reject,
.cookie-banner__btn--reject {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-consent-btn--reject:hover,
.cookie-banner__btn--reject:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================
   Floating Settings Button
   ========================================== */

.cookie-settings-float,
.cookie-float-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cookie-settings-float:hover,
.cookie-float-btn:hover {
  background: rgba(20, 20, 20, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}

.cookie-settings-float svg,
.cookie-float-btn svg {
  width: 24px;
  height: 24px;
}

/* ==========================================
   Mobile
   ========================================== */

@media (max-width: 640px) {
  .cookie-consent-banner,
  .cookie-banner {
    padding: 12px;
    align-items: flex-end;
  }

  .cookie-consent-inner,
  .cookie-banner__inner {
    padding: 24px;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    gap: 16px;
  }

  .cookie-consent-categories,
  .cookie-banner__options {
    max-height: 200px;
  }

  .cookie-consent-title,
  .cookie-banner__title {
    font-size: 1.1rem;
  }

  .cookie-settings-float,
  .cookie-float-btn {
    bottom: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }
}
