/* ============================================================
   Cookie Consent Banner — GDPR / ePrivacy compliant
   Fixed-bottom bar, respects site color scheme.
   ============================================================ */

.cph-cc-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  display: none; /* shown by JS when consent missing */
  font-family: "PingFang SC","Microsoft YaHei","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height: 1.5;
}

.cph-cc-bar {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 16px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 12px 12px 0 0;
}

.cph-cc-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}

.cph-cc-text {
  flex: 1 1 300px;
  font-size: 14px;
  color: #ccc;
}

.cph-cc-text strong {
  color: #fff;
}

.cph-cc-text a {
  color: #6ea8fe;
  text-decoration: underline;
}

.cph-cc-text a:hover {
  color: #9ec5fe;
}

.cph-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.cph-cc-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
}

.cph-cc-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.cph-cc-btn-accept {
  background: #2563eb;
  color: #fff;
}

.cph-cc-btn-reject {
  background: #374151;
  color: #e0e0e0;
}

.cph-cc-btn-settings {
  background: transparent;
  color: #9ca3af;
  text-decoration: underline;
  padding: 10px 8px;
}

/* Floating settings trigger (shown in footer & anywhere) */
.cph-cc-trigger {
  display: inline-block;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}

.cph-cc-trigger:hover {
  color: #6ea8fe;
}

/* Preference panel (modal style for changing consent) */
.cph-cc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000000;
  align-items: center;
  justify-content: center;
}

.cph-cc-overlay.active {
  display: flex;
}

.cph-cc-panel {
  background: #fff;
  color: #111;
  max-width: 520px;
  width: 90%;
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-height: 80vh;
  overflow-y: auto;
}

.cph-cc-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #111;
}

.cph-cc-panel p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 16px;
}

.cph-cc-panel a {
  color: #2563eb;
  text-decoration: underline;
}

.cph-cc-panel-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.cph-cc-panel-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cph-cc-panel-section p {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.cph-cc-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cph-cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cph-cc-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  cursor: pointer;
  transition: background .2s;
}

.cph-cc-toggle-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}

.cph-cc-toggle input:checked + .cph-cc-toggle-slider {
  background: #2563eb;
}

.cph-cc-toggle input:checked + .cph-cc-toggle-slider::before {
  transform: translateX(18px);
}

.cph-cc-panel-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.cph-cc-panel-footer .cph-cc-btn {
  padding: 10px 28px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .cph-cc-bar {
    padding: 14px 16px;
    border-radius: 0;
  }

  .cph-cc-text {
    font-size: 13px;
  }

  .cph-cc-btn {
    padding: 8px 18px;
    font-size: 13px;
  }

  .cph-cc-panel {
    padding: 20px 18px;
  }
}
