/* ===== ROOT ===== */

#cl-manager {
  position: fixed;
  z-index: 999999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #111827;

  /* domyślny akcent – nadpisywany inline z PHP */
  --cl-accent: #ec4899;
}

/* Pozycje */
.cl--pos-bottom-left {
  bottom: 16px;
  left: 16px;
}

.cl--pos-bottom-right {
  bottom: 16px;
  right: 16px;
}

.cl--pos-bottom-center {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.cl--pos-top-center {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

/* Pozycja ikony (nadpisuje tylko położenie przycisku) */
.cl--icon-bottom-left .cl-toggle {
  bottom: 16px;
  left: 16px;
}

.cl--icon-bottom-right .cl-toggle {
  bottom: 16px;
  right: 16px;
}

.cl--icon-bottom-center .cl-toggle {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.cl--icon-top-center .cl-toggle {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

/* ===== TOGGLE (IKONA) ===== */

.cl-toggle {
  position: fixed;
  width: 42px !important;
  height: 42px;
  border-radius: 999px !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0px 0px 0px 0px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  background: #ffffff;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.cl-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.cl-toggle-icon {
  height: 27px;
  display: block;
}

.cl-toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none !important;
  stroke-width: 2px;
}

/* ukryta ikona */
.cl-toggle--hidden {
  display: none !important;
}

/* ===== BANNER ===== */

.cl-banner {
  box-sizing: border-box;
  max-width: 420px;
  min-width: 320px;
  padding: 20px 20px 16px;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, .35);
  border: 1px solid rgba(148, 163, 184, .3);
  background: #ffffff;
  color: #0f172a;
}

.cl-banner--hidden {
  display: none !important;
}

.cl-banner-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.cl-banner-description {
  font-size: 13px;
  color: #4b5563;
}

.cl-banner-main {
  margin-bottom: 16px;
}

/* ===== TEMATY ===== */

.cl--theme-dark .cl-banner {
  background: #020617;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, .25);
}

.cl--theme-dark .cl-banner-description {
  color: #9ca3af;
}

/* ===== BUTTONY ===== */

.cl-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* bazowy przycisk – tylko w ramach naszego managera */
#cl-manager .cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  transition:
    background-color .15s ease,
    color .15s ease,
    border-color .15s ease,
    transform .1s ease,
    filter .1s ease;
}

#cl-manager .cl-btn:focus-visible {
  outline: 2px solid var(--cl-accent);
  outline-offset: 2px;
}

/* PRIMARY */
#cl-manager .cl-btn.cl-btn--primary {
  background: var(--cl-accent) !important;
  border-color: var(--cl-accent) !important;
  color: #ffffff !important;
}

#cl-manager .cl-btn.cl-btn--primary:hover {
  filter: brightness(0.92);
}

/* SECONDARY */
#cl-manager .cl-btn.cl-btn--secondary {
  border-color: var(--cl-accent) !important;
  color: #ffffff !important;
  background: var(--cl-accent) !important;
}

.cl--theme-dark #cl-manager .cl-btn.cl-btn--secondary {
  background: transparent !important;
}

#cl-manager .cl-btn.cl-btn--secondary:hover {
  background: rgba(148, 163, 184, .1);
  filter: brightness(0.92);
}

/* GHOST */
#cl-manager .cl-btn.cl-btn--ghost {
  border-color: transparent !important;
  color: var(--cl-accent) ;
  border-color: var(--cl-accent) !important;
}

#cl-manager .cl-btn.cl-btn--ghost:hover {
  background: rgba(248, 248, 248, 0.11);
}

.cl--theme-dark #cl-manager .cl-btn.cl-btn--ghost {
  color: #e5e7eb !important;
}


/* ===== SZCZEGÓŁY / KATEGORIE ===== */

.cl-banner-details {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, .35);
  display: none;
}

.cl-banner-details--open {
  display: block;
}

.cl-category {
  margin-bottom: 10px;
}

.cl-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.cl-category-name {
  font-size: 13px;
  font-weight: 500;
}

.cl-category-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .18);
  color: #475569;
}

.cl--theme-dark .cl-category-pill {
  background: rgba(148, 163, 184, .22);
  color: #e5e7eb;
}

.cl-category-desc {
  font-size: 12px;
  color: #6b7280;
}

.cl--theme-dark .cl-category-desc {
  color: #9ca3af;
}

.cl-banner-bottom {
  margin-top: 12px;
  text-align: right;
}

/* ===== SWITCH ===== */

.cl-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
}

.cl-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cl-switch-slider {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: #e5e7eb;
  border-radius: 999px;
  transition: background-color .15s ease;
}

.cl-switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}

.cl-switch input:checked+.cl-switch-slider {
  background: var(--cl-accent);
}

.cl-switch input:checked+.cl-switch-slider::before {
  transform: translateX(14px);
}

/* ===== RESPONSYWNOŚĆ ===== */

@media (max-width: 480px) {
  .cl-banner {
    max-width: calc(100vw - 24px);
    min-width: 0;
  }
}