/* ═══════════════════════════════════════════════════════════════
   Resonance Threads — Cookie Consent Styles
   Banner, modal, toggles — mobile-first responsive
═══════════════════════════════════════════════════════════════ */

/* ── Cookie Banner ───────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1a1a1e;
  border-top: 1px solid #2a2a2e;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.cookie-banner__text {
  flex: 1;
  font-size: 13px;
  color: #b0b0b8;
  line-height: 1.5;
}

.cookie-banner__text a {
  color: #ff4ecd;
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Cookie Buttons ──────────────────────────────────────────── */
.cookie-btn-accept {
  padding: 9px 20px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(90deg, #ff4ecd, #4fdcff);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: opacity 0.15s;
}

.cookie-btn-accept:hover {
  opacity: 0.88;
}

.cookie-btn-manage {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid #3a3a3e;
  background: transparent;
  color: #e0e0e4;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.cookie-btn-manage:hover {
  border-color: #ff4ecd;
  color: #ff4ecd;
}

/* ── Modal Overlay ───────────────────────────────────────────── */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Modal Card ──────────────────────────────────────────────── */
.cookie-modal {
  background: #1a1a1e;
  border: 1px solid #2a2a2e;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.cookie-modal__header {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal__title {
  font-size: 16px;
  font-weight: 800;
  color: #e0e0e4;
}

.cookie-modal__close {
  background: transparent;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-family: inherit;
}

.cookie-modal__close:hover {
  color: #e0e0e4;
}

.cookie-modal__body {
  padding: 16px 20px;
}

.cookie-modal__desc {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 16px;
}

.cookie-modal__footer {
  padding: 16px 20px 20px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #2a2a2e;
}

.cookie-modal__footer .cookie-btn-accept {
  flex: 1;
}

/* ── Cookie Category Row ─────────────────────────────────────── */
.cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #2a2a2e;
}

.cookie-category:last-child {
  border-bottom: none;
}

.cookie-category__info {
  flex: 1;
}

.cookie-category__name {
  font-size: 13px;
  font-weight: 700;
  color: #e0e0e4;
  margin-bottom: 2px;
}

.cookie-category__desc {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.cookie-category__badge {
  font-size: 10px;
  font-weight: 700;
  color: #4fdcff;
  background: rgba(79, 220, 255, 0.1);
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
}

/* ── iOS-style Toggle Switch ─────────────────────────────────── */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle__track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #333;
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle__track {
  background: linear-gradient(90deg, #ff4ecd, #a855f7);
}

.cookie-toggle input:disabled + .cookie-toggle__track {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle__track::after {
  transform: translateX(20px);
}

/* ── Mobile Responsive ───────────────────────────────────────── */
@media (max-width: 767px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .cookie-banner__actions {
    flex-direction: column;
    gap: 8px;
  }

  .cookie-btn-accept,
  .cookie-btn-manage {
    width: 100%;
    text-align: center;
    padding: 11px 20px;
  }

  .cookie-modal {
    max-height: calc(100vh - 32px);
    border-radius: 12px;
  }

  .cookie-modal__footer {
    flex-direction: column;
  }
}
