/* ============================================================
   PhotoAI.cloud — Cookie Consent Banner
   Adapted from ChemAtlas universal consent config
   ============================================================ */

/* ── Banner base ─────────────────────────────────────────────── */
#cc-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 48px);
  max-width: 680px;
  background: #111219;
  border: 1px solid #2a2d3e;
  border-radius: 16px;
  padding: 20px 24px;
  z-index: 9999;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,255,0.06);
  font-family: 'DM Sans', sans-serif;
  transition: transform 400ms cubic-bezier(0.16,1,0.3,1), opacity 400ms ease;
  opacity: 0;
  pointer-events: none;
}
#cc-banner.cc-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}
#cc-banner.cc-hidden {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
}

/* ── Banner header ───────────────────────────────────────────── */
.cc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.cc-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f0f4ff;
  margin: 0;
}
.cc-desc {
  font-size: 13px;
  color: #6b7394;
  line-height: 1.6;
  margin: 0 0 16px;
}
.cc-desc a {
  color: #00d4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Buttons row ─────────────────────────────────────────────── */
.cc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.cc-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
  border: none;
}
.cc-btn--accept {
  background: #00d4ff;
  color: #0a0b0f;
}
.cc-btn--accept:hover { background: #26dbff; }

.cc-btn--reject {
  background: transparent;
  border: 1px solid #2a2d3e;
  color: #6b7394;
}
.cc-btn--reject:hover { border-color: #6b7394; color: #f0f4ff; }

.cc-btn--customize {
  background: transparent;
  border: 1px solid #00d4ff;
  color: #00d4ff;
}
.cc-btn--customize:hover { background: rgba(0,212,255,0.08); }

.cc-btn--save {
  background: #00d4ff;
  color: #0a0b0f;
}
.cc-btn--save:hover { background: #26dbff; }

/* ── Manage link (footer) ────────────────────────────────────── */
#cc-manage-link {
  position: fixed;
  bottom: 16px;
  left: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #6b7394;
  background: #111219;
  border: 1px solid #2a2d3e;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 9998;
  display: none;
  transition: all 180ms ease;
}
#cc-manage-link:hover { color: #00d4ff; border-color: #00d4ff; }
#cc-manage-link.cc-show { display: block; }

/* ── Customize panel ─────────────────────────────────────────── */
.cc-customize-panel {
  display: none;
  margin-top: 16px;
  border-top: 1px solid #2a2d3e;
  padding-top: 16px;
  gap: 10px;
  flex-direction: column;
}
.cc-customize-panel.cc-open { display: flex; }

/* Category row */
.cc-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #1a1c26;
  border: 1px solid #2a2d3e;
  border-radius: 10px;
  padding: 12px 14px;
}
.cc-category__info { flex: 1; }
.cc-category__name {
  font-size: 13px;
  font-weight: 600;
  color: #f0f4ff;
  margin-bottom: 3px;
}
.cc-category__desc {
  font-size: 11px;
  color: #6b7394;
  line-height: 1.55;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-toggle__track {
  position: absolute; inset: 0;
  background: #2a2d3e;
  border-radius: 10px;
  transition: background 180ms ease;
  cursor: pointer;
}
.cc-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #6b7394;
  transition: transform 280ms cubic-bezier(0.16,1,0.3,1), background 180ms ease;
}
.cc-toggle input:checked + .cc-toggle__track { background: rgba(0,212,255,0.2); }
.cc-toggle input:checked + .cc-toggle__track::after {
  transform: translateX(16px);
  background: #00d4ff;
}
.cc-toggle input:disabled + .cc-toggle__track { opacity: 0.5; cursor: not-allowed; }

/* Always-on badge */
.cc-always-on {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00e5a0;
  background: rgba(0,229,160,0.1);
  border: 1px solid rgba(0,229,160,0.2);
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 4px;
  display: inline-block;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #cc-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(120%);
    border-radius: 16px 16px 0 0;
  }
  #cc-banner.cc-visible { transform: translateY(0); }
  #cc-banner.cc-hidden  { transform: translateY(120%); }
  .cc-actions { flex-direction: column; }
  .cc-btn { width: 100%; text-align: center; }
}
