/* SWEDev Cookie Consent Banner — ConsentLite-style */

/* ── Banner ─────────────────────────────────────────────── */
#swedev-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 20px 24px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: #1a1a1a;
  transform: translateY(100%);
  transition: transform 300ms ease;
}

#swedev-cookie-banner.cl-visible {
  transform: translateY(0);
}

#swedev-cookie-banner.cl-hiding {
  transform: translateY(100%);
}

.cl-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.cl-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

.cl-text {
  font-size: 14px;
  color: #4b5563;
  margin: 0 0 16px;
  line-height: 1.5;
}

.cl-text a {
  color: #2563eb;
  text-decoration: underline;
}

.cl-text a:hover {
  color: #1d4ed8;
}

/* ── Buttons ─────────────────────────────────────────────── */
.cl-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.cl-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.cl-btn-primary:hover {
  background: #1d4ed8;
}

.cl-btn-secondary {
  background: #e5e7eb;
  color: #1a1a1a;
}

.cl-btn-secondary:hover {
  background: #d1d5db;
}

/* ── Branding ────────────────────────────────────────────── */
.cl-branding {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  margin-top: 8px;
}

.cl-branding a {
  color: #9ca3af;
  text-decoration: none;
}

.cl-branding a:hover {
  text-decoration: underline;
}

/* ── Settings panel ──────────────────────────────────────── */
.cl-settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000000;
  align-items: center;
  justify-content: center;
}

.cl-settings-overlay.cl-open {
  display: flex;
}

.cl-settings-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  font-family: system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 300ms ease, opacity 300ms ease;
}

.cl-settings-overlay.cl-open .cl-settings-panel {
  transform: translateY(0);
  opacity: 1;
}

.cl-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cl-settings-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.cl-settings-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cl-settings-close:hover {
  color: #1a1a1a;
}

.cl-settings-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── Category rows ───────────────────────────────────────── */
.cl-category {
  border-top: 1px solid #e5e7eb;
  padding: 16px 0;
}

.cl-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cl-category-label {
  font-size: 14px;
  font-weight: 500;
}

.cl-category-desc {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}

.cl-always-active {
  font-size: 12px;
  color: #2563eb;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Toggle switch ───────────────────────────────────────── */
.cl-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.cl-toggle-track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cl-toggle input:checked + .cl-toggle-track {
  background: #2563eb;
}

.cl-toggle input:disabled + .cl-toggle-track {
  background: #93c5fd;
  cursor: default;
}

.cl-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cl-toggle input:checked + .cl-toggle-track::after {
  transform: translateX(20px);
}

/* ── Save button ─────────────────────────────────────────── */
.cl-settings-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* ── Re-open button ──────────────────────────────────────── */
#swedev-cookie-reopen {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 999998;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  color: #6b7280;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

#swedev-cookie-reopen:hover {
  color: #1a1a1a;
  border-color: #9ca3af;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 639px) {
  #swedev-cookie-banner {
    font-size: 14px;
    padding: 16px;
  }

  .cl-buttons {
    flex-direction: column;
  }

  .cl-btn {
    width: 100%;
  }

  .cl-settings-panel {
    margin: 16px;
    max-width: none;
    width: calc(100% - 32px);
    border-radius: 8px;
    padding: 20px;
  }
}
