/* =============================================================================
   WP Consent — Frontend Banner Styles
   Version: 1.0.0
   ============================================================================= */

/* ─── Reset & Custom Properties ─────────────────────────────────────────── */
:root {
  --wpc-primary:  #2563eb;
  --wpc-accept:   #16a34a;
  --wpc-reject:   #6b7280;
  --wpc-radius:   8px;
  --wpc-shadow:   0 4px 24px rgba(0,0,0,.15);
  --wpc-z:        999999;
  --wpc-font:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wpc-text:     #111827;
  --wpc-muted:    #6b7280;
  --wpc-bg:       #ffffff;
  --wpc-border:   #e5e7eb;
  --wpc-overlay:  rgba(0, 0, 0, 0.55);
}

/* ─── Banner — Base ──────────────────────────────────────────────────────── */
.wpc-banner {
  position: fixed;
  z-index: var(--wpc-z);
  left: 0;
  right: 0;
  background: var(--wpc-bg);
  font-family: var(--wpc-font);
  font-size: 14px;
  color: var(--wpc-text);
  box-shadow: var(--wpc-shadow);
  animation: wpc-slide-in .35s cubic-bezier(.16,1,.3,1) both;
}

@keyframes wpc-slide-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Banner — Positions ─────────────────────────────────────────────────── */
.wpc-banner--bottom {
  bottom: 0;
  border-top: 1px solid var(--wpc-border);
}

.wpc-banner--center {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: 580px;
  max-width: calc(100vw - 32px);
  border-radius: calc(var(--wpc-radius) + 4px);
  border: 1px solid var(--wpc-border);
  animation: wpc-fade-in .3s ease both;
}

@keyframes wpc-fade-in {
  from { opacity: 0; transform: translate(-50%,-52%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1);   }
}

.wpc-banner--bottom-left,
.wpc-banner--bottom-right {
  left: auto;
  right: auto;
  bottom: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  border-radius: calc(var(--wpc-radius) + 4px);
  border: 1px solid var(--wpc-border);
  animation: wpc-pop-in .35s cubic-bezier(.16,1,.3,1) both;
}

.wpc-banner--bottom-left  { left: 16px; }
.wpc-banner--bottom-right { right: 16px; }

@keyframes wpc-pop-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ─── Banner — Inner Layout ─────────────────────────────────────────────── */
.wpc-banner__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.wpc-banner--center .wpc-banner__inner,
.wpc-banner--bottom-left .wpc-banner__inner,
.wpc-banner--bottom-right .wpc-banner__inner {
  flex-direction: column;
  align-items: stretch;
}

.wpc-banner__content {
  flex: 1;
  min-width: 0;
}

.wpc-banner__logo {
  margin-bottom: 10px;
}

.wpc-banner__logo img {
  display: block;
  max-height: 48px;
  max-width: 160px;
  width: auto;
  height: auto;
}

.wpc-banner__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--wpc-text);
  line-height: 1.3;
}

.wpc-banner__text {
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
  margin: 0;
}

.wpc-banner__links {
  margin-top: 8px;
  display: flex;
  gap: 12px;
}

.wpc-banner__links a {
  font-size: 12px;
  color: var(--wpc-primary);
  text-decoration: underline;
}

/* ─── Banner — Actions ───────────────────────────────────────────────────── */
.wpc-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  min-width: 180px;
}

.wpc-banner--bottom .wpc-banner__actions {
  flex-direction: row;
  min-width: 0;
}

@media (max-width: 640px) {
  .wpc-banner--bottom .wpc-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .wpc-banner--bottom .wpc-banner__actions {
    flex-direction: column;
  }
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.wpc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--wpc-radius);
  font-family: var(--wpc-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s;
  text-align: center;
  white-space: nowrap;
  min-height: 42px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.wpc-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.wpc-btn:active {
  transform: translateY(0);
  filter: brightness(.96);
}

.wpc-btn:focus-visible {
  outline: 3px solid var(--wpc-primary);
  outline-offset: 2px;
}

.wpc-btn--accept {
  color: #fff;
  background: var(--wpc-accept);
}

.wpc-btn--reject {
  color: #fff;
  background: var(--wpc-reject);
}

.wpc-btn--settings {
  color: var(--wpc-text);
  background: #f3f4f6;
  border: 1px solid var(--wpc-border);
}

.wpc-btn--settings:hover {
  background: #e5e7eb;
}

.wpc-btn--save {
  color: #fff;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.wpc-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--wpc-z) + 1);
  font-family: var(--wpc-font);
  font-size: 14px;
  color: var(--wpc-text);
}

.wpc-modal__overlay {
  position: absolute;
  inset: 0;
  background: var(--wpc-overlay);
  animation: wpc-overlay-in .25s ease both;
}

@keyframes wpc-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wpc-modal__box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--wpc-bg);
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  border-radius: calc(var(--wpc-radius) + 4px);
  box-shadow: var(--wpc-shadow), 0 0 0 1px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: wpc-modal-in .3s cubic-bezier(.16,1,.3,1) both;
}

@keyframes wpc-modal-in {
  from { opacity: 0; transform: translate(-50%,-48%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1);   }
}

.wpc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--wpc-border);
  flex-shrink: 0;
}

.wpc-modal__header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.wpc-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--wpc-muted);
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.wpc-modal__close:hover {
  color: var(--wpc-text);
  background: #f3f4f6;
}

.wpc-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 8px;
}

.wpc-modal__footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--wpc-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ─── Category items in modal ────────────────────────────────────────────── */
.wpc-category {
  border-bottom: 1px solid var(--wpc-border);
  padding: 16px 0;
}

.wpc-category:last-child {
  border-bottom: none;
}

.wpc-category__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wpc-category__info {
  flex: 1;
}

.wpc-category__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--wpc-text);
  display: block;
  margin-bottom: 4px;
}

.wpc-category__desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.wpc-category__toggle {
  flex-shrink: 0;
  padding-top: 2px;
}

.wpc-always-active {
  font-size: 12px;
  font-weight: 600;
  color: var(--wpc-accept);
  white-space: nowrap;
}

/* ─── Toggle Switch ──────────────────────────────────────────────────────── */
.wpc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.wpc-switch__slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  cursor: pointer;
  transition: background .2s;
}

.wpc-switch__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.wpc-switch input:checked + .wpc-switch__slider {
  background: var(--wpc-primary);
}

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

.wpc-switch input:focus-visible + .wpc-switch__slider {
  outline: 2px solid var(--wpc-primary);
  outline-offset: 2px;
}

/* ─── Services list inside modal ─────────────────────────────────────────── */
.wpc-services-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wpc-service-item {
  background: #f9fafb;
  border: 1px solid var(--wpc-border);
  border-radius: var(--wpc-radius);
  padding: 10px 12px;
  font-size: 12px;
}

.wpc-service-item__name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.wpc-service-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--wpc-muted);
  margin-bottom: 4px;
}

.wpc-service-item__meta a {
  color: var(--wpc-primary);
}

.wpc-service-item__purpose,
.wpc-service-item__cookies {
  color: #4b5563;
  margin-top: 2px;
}

/* ─── Floating Re-open Button ────────────────────────────────────────────── */
.wpc-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: var(--wpc-z);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
  transition: transform .2s, box-shadow .2s;
  opacity: .85;
}

.wpc-reopen:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  opacity: 1;
}

.wpc-reopen svg {
  stroke: #fff;
}

/* ─── Content Blocker ────────────────────────────────────────────────────── */
.wpc-blocker {
  position: relative;
  overflow: hidden;
  background: #111827;
  border-radius: var(--wpc-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  width: 100%;
}

.wpc-blocker__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(.4);
  transform: scale(1.05);
}

.wpc-blocker__overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wpc-blocker__icon {
  opacity: .9;
}

.wpc-blocker__name {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--wpc-font);
}

.wpc-blocker__message {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,.8);
  max-width: 360px;
  margin: 0;
  font-family: var(--wpc-font);
}

.wpc-blocker__btn {
  padding: 10px 22px;
  border: none;
  border-radius: var(--wpc-radius);
  font-family: var(--wpc-font);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: filter .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.wpc-blocker__btn:hover {
  filter: brightness(1.1);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wpc-banner__inner {
    padding: 16px;
    gap: 14px;
  }

  .wpc-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .wpc-modal__box {
    max-height: calc(100vh - 16px);
  }

  .wpc-modal__body {
    padding: 0 16px 8px;
  }

  .wpc-modal__footer {
    padding: 12px 16px;
  }
}

/* ─── Print: hide banner ─────────────────────────────────────────────────── */
@media print {
  .wpc-banner,
  .wpc-modal,
  .wpc-reopen {
    display: none !important;
  }
}

/* ─── White-Label branding (im Banner & Modal) ───────────────────────────── */
.wpc-powered-by {
  text-align: center;
  padding: 6px 0 2px;
  font-size: 10px;
  line-height: 1;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.wpc-powered-by:hover {
  opacity: 0.8;
}

.wpc-powered-by a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #666;
  text-decoration: none;
}

.wpc-powered-by svg {
  flex-shrink: 0;
  color: #6c63ff;
}
