/* =============================================================
   SOCIALKING — COOKIE CONSENT SYSTEM
   GDPR + Google Consent Mode V2 Compliant
   Brand: #7c3aed (purple) / #0d0820 (dark)
   ============================================================= */

/* ---- BANNER ---- */
#sk-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 900px;
  z-index: 99998;
  background: rgba(10, 6, 24, 0.92);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 20px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(124, 58, 237, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 20px 24px;
  animation: sk-cb-slide-up 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#sk-cookie-banner[hidden] { display: none !important; }

@keyframes sk-cb-slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(28px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.sk-cb__inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sk-cb__icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: #a78bfa;
}
.sk-cb__icon svg { width: 20px; height: 20px; }

.sk-cb__text { flex: 1; min-width: 0; }
.sk-cb__text strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.1px;
}
.sk-cb__text p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.81rem;
  line-height: 1.55;
  margin: 0;
}
.sk-cb__text a {
  color: #a78bfa;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.sk-cb__text a:hover { color: #c4b5fd; }

.sk-cb__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* ---- SHARED BUTTON BASE ---- */
.sk-cb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
}

/* Accept — primary */
.sk-cb__btn--primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6120a8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.sk-cb__btn--primary:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b1fa0 100%);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

/* Reject — EQUAL PROMINENCE (AEPD requirement) */
.sk-cb__btn--secondary {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.sk-cb__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Customize — outline */
.sk-cb__btn--outline {
  background: transparent;
  color: rgba(167, 139, 250, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.35);
}
.sk-cb__btn--outline:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: #7c3aed;
  color: #c4b5fd;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ---- MODAL OVERLAY ---- */
#sk-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#sk-cookie-modal[hidden] { display: none !important; }

.sk-cm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sk-cm__panel {
  position: relative;
  background: #0c0820;
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 22px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(124, 58, 237, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: sk-cm-pop-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

@keyframes sk-cm-pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal header */
.sk-cm__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.sk-cm__header-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: #a78bfa;
  flex-shrink: 0;
}
.sk-cm__header-icon svg { width: 16px; height: 16px; }
.sk-cm__header-text { flex: 1; }
.sk-cm__title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1px;
  letter-spacing: -0.15px;
}
.sk-cm__subtitle {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
}
.sk-cm__close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.sk-cm__close svg { width: 16px; height: 16px; }
.sk-cm__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

/* Modal body */
.sk-cm__body {
  padding: 18px 24px 4px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.3) transparent;
}
.sk-cm__body::-webkit-scrollbar { width: 4px; }
.sk-cm__body::-webkit-scrollbar-track { background: transparent; }
.sk-cm__body::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.3); border-radius: 4px; }

.sk-cm__intro {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  line-height: 1.65;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sk-cm__intro a { color: #a78bfa; text-decoration: underline; text-underline-offset: 2px; }

/* Category cards */
.sk-cm__category {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: border-color 0.2s;
}
.sk-cm__category:hover { border-color: rgba(124, 58, 237, 0.22); }
.sk-cm__category:last-child { margin-bottom: 18px; }

.sk-cm__cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
  cursor: default;
}
.sk-cm__cat-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.sk-cm__cat-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sk-cm__cat-icon svg { width: 15px; height: 15px; }
.sk-cm__cat-icon--necessary { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.2); color: #34d399; }
.sk-cm__cat-icon--analytics { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.2); color: #60a5fa; }
.sk-cm__cat-icon--marketing { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.2); color: #fbbf24; }
.sk-cm__cat-icon--functional { background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.2); color: #a78bfa; }

.sk-cm__cat-labels { min-width: 0; }
.sk-cm__cat-name {
  display: block;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.1px;
  line-height: 1.3;
}
.sk-cm__cat-badge {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.sk-cm__cat-badge--always {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.22);
  color: #34d399;
}
.sk-cm__cat-badge--third {
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.2);
  color: #a78bfa;
}

.sk-cm__cat-desc {
  padding: 0 16px 14px 58px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.77rem;
  line-height: 1.65;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 0;
  padding-top: 10px;
}
.sk-cm__cat-desc small {
  display: block;
  margin-top: 7px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Toggle switch */
.sk-cm__toggle {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.sk-cm__toggle--disabled { cursor: not-allowed; }
.sk-cm__toggle input {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}
.sk-cm__toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.25s, border-color 0.25s;
}
.sk-cm__toggle-thumb {
  position: absolute;
  width: 20px; height: 20px;
  top: 2px; left: 2px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.sk-cm__toggle input:checked ~ .sk-cm__toggle-track {
  background: #7c3aed;
  border-color: #7c3aed;
}
.sk-cm__toggle input:checked ~ .sk-cm__toggle-thumb {
  transform: translateX(20px);
  background: #fff;
}
.sk-cm__toggle--disabled .sk-cm__toggle-track { opacity: 0.5; }
.sk-cm__toggle input:focus-visible ~ .sk-cm__toggle-track {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
}

/* Modal footer */
.sk-cm__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  gap: 8px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
}
.sk-cm__footer-right { display: flex; gap: 8px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 680px) {
  #sk-cookie-banner {
    bottom: 12px;
    padding: 16px;
    border-radius: 16px;
  }
  .sk-cb__icon { display: none; }
  .sk-cb__inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .sk-cb__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .sk-cb__actions #sk-btn-accept-all { grid-column: 1 / -1; }
  .sk-cb__btn { padding: 10px 12px; font-size: 0.82rem; }

  .sk-cm__panel { border-radius: 18px; }
  .sk-cm__cat-desc { padding-left: 16px; }
  .sk-cm__footer { flex-direction: column; }
  .sk-cm__footer .sk-cb__btn--secondary { width: 100%; }
  .sk-cm__footer-right { width: 100%; }
  .sk-cm__footer-right .sk-cb__btn { flex: 1; }
}
