/* =============================================================================
   COOKIE.CSS — Cookie Consent Banner + Settings Modal
   ============================================================================= */

/* ── Banner ── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 9999;
  padding: 16px 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(124, 58, 237, 0.12);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(124,58,237,0.08);
  max-width: 680px;
  width: calc(100vw - 32px);
  animation: cookie-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cookie-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  pointer-events: none;
}

.cookie-banner-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-banner-text strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.cookie-banner-text span {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.cookie-banner-text a {
  color: var(--purple);
  text-decoration: underline;
}

.cookie-btn-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn-accept,
.cookie-btn-deny,
.cookie-btn-settings {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
  border: none;
}

.cookie-btn-accept {
  background: var(--gradient-brand);
  color: #fff;
}
.cookie-btn-accept:hover { opacity: 0.88; }

.cookie-btn-deny {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.cookie-btn-deny:hover { background: rgba(0,0,0,0.04); }

.cookie-btn-settings {
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple);
}
.cookie-btn-settings:hover { background: rgba(124, 58, 237, 0.15); }

@keyframes cookie-slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(24px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Modal overlay ── */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 5, 30, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cookie-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal box ── */
.cookie-modal {
  background: #fff;
  border-radius: 20px;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px 28px 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.cookie-modal-overlay.open .cookie-modal {
  transform: scale(1) translateY(0);
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cookie-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.cookie-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.cookie-modal-close:hover { background: rgba(0, 0, 0, 0.1); }

.cookie-modal-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── Category rows ── */
.cookie-category {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.cookie-category:last-of-type { border-bottom: 1px solid var(--border); }

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-category-header > div strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.cookie-category-header > div p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ── Always-on badge ── */
.cookie-toggle-locked {
  display: flex;
  align-items: center;
}

.cookie-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--purple);
  background: rgba(124, 58, 237, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Toggle switch ── */
.cookie-toggle-switch {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.cookie-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #D1D5DB;
  position: relative;
  transition: background 0.2s;
}

.cookie-toggle-switch input:checked + .cookie-toggle-track {
  background: var(--purple);
}

.cookie-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-toggle-switch input:checked + .cookie-toggle-track .cookie-toggle-thumb {
  transform: translateX(20px);
}

/* ── Modal actions ── */
.cookie-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 20px;
}

.cookie-modal-actions .cookie-btn-accept,
.cookie-modal-actions .cookie-btn-deny {
  padding: 10px 22px;
  font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    bottom: 12px;
  }
  .cookie-btn-group {
    width: 100%;
  }
  .cookie-btn-accept,
  .cookie-btn-deny,
  .cookie-btn-settings {
    flex: 1;
    text-align: center;
  }
}
