/* ═══════════════════════════════════════
   Cookie Consent — Self-contained styles
   Matches SEO Audit Tool design system
═══════════════════════════════════════ */

/* ── Banner (centered popup) ────────── */
.cc-banner {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 23, 0.4);
  backdrop-filter: blur(4px);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1f2e;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.cc-banner.cc-visible {
  opacity: 1;
  visibility: visible;
}

.cc-banner-inner {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 40px rgba(0, 0, 0, 0.15);
  max-width: 480px;
  width: 92%;
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-banner.cc-visible .cc-banner-inner {
  transform: translateY(0) scale(1);
}

.cc-banner-text {
  min-width: 0;
}

.cc-banner-text p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.cc-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Buttons ────────────────────────── */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
}

.cc-btn:active {
  transform: scale(0.97);
}

.cc-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.cc-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.cc-btn-secondary {
  background: transparent;
  color: #1a1f2e;
  border: 1.5px solid #e5e7eb;
}

.cc-btn-secondary:hover {
  background: #f8f9fb;
  border-color: #d1d5db;
}

.cc-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px 2px;
  transition: color 0.2s;
}

.cc-link:hover {
  color: #2563eb;
}

/* ── Modal overlay ──────────────────── */
.cc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(13, 17, 23, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cc-modal-overlay.cc-visible {
  opacity: 1;
  visibility: visible;
}

/* ── Modal ──────────────────────────── */
.cc-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 40px rgba(0, 0, 0, 0.12);
  width: 92%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-modal-overlay.cc-visible .cc-modal {
  transform: translateY(0) scale(1);
}

.cc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.cc-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a1f2e;
  line-height: 1.3;
}

.cc-modal-close {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  font-size: 20px;
  transition: background 0.15s;
}

.cc-modal-close:hover {
  background: #f3f4f6;
}

.cc-modal-body {
  padding: 16px 24px 24px;
}

/* ── Category rows ──────────────────── */
.cc-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.cc-category:last-child {
  border-bottom: none;
}

.cc-category-info {
  flex: 1;
  min-width: 0;
}

.cc-category-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1f2e;
  margin: 0 0 2px;
}

.cc-category-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ── Toggle switch ──────────────────── */
.cc-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}

.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cc-toggle-track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.25s;
}

.cc-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cc-toggle input:checked + .cc-toggle-track {
  background: #2563eb;
}

.cc-toggle input:checked + .cc-toggle-track::after {
  transform: translateX(20px);
}

.cc-toggle input:disabled + .cc-toggle-track {
  background: #2563eb;
  opacity: 0.5;
  cursor: not-allowed;
}

.cc-toggle input:disabled:checked + .cc-toggle-track {
  opacity: 0.5;
}

/* ── Modal footer ───────────────────── */
.cc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px 20px;
}

/* ── Responsive ─────────────────────── */
@media (max-width: 640px) {
  .cc-banner-inner {
    padding: 24px 20px 20px;
    gap: 16px;
    width: 94%;
  }

  .cc-banner-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .cc-btn {
    width: 100%;
  }

  .cc-link {
    text-align: center;
  }

  .cc-modal {
    width: 96%;
    max-height: 90vh;
  }

  .cc-modal-footer {
    flex-direction: column;
  }

  .cc-modal-footer .cc-btn {
    width: 100%;
  }
}
