/**
 * CookieBannerDemo component styles.
 * Prefixed with .ccbd- to avoid conflicts.
 * Supports light/dark via .dark-theme parent.
 */

/* Container */
.ccbd-container {
  width: 520px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 60px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
}
.dark-theme .ccbd-container,
:root[data-theme="dark"] .ccbd-container {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 40px rgba(16,185,129,0.06);
}

/* Browser chrome */
.ccbd-browser-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.dark-theme .ccbd-browser-bar,
:root[data-theme="dark"] .ccbd-browser-bar {
  background: #334155;
  border-bottom-color: #475569;
}
.ccbd-dots { display: flex; gap: 5px; }
.ccbd-dots span { width: 10px; height: 10px; border-radius: 50%; }
.ccbd-dots span:nth-child(1) { background: #ef4444; }
.ccbd-dots span:nth-child(2) { background: #f59e0b; }
.ccbd-dots span:nth-child(3) { background: #10b981; }
.ccbd-url {
  flex: 1; border-radius: 6px; padding: 5px 10px;
  font-size: 12px; display: flex; align-items: center; gap: 6px;
  background: #ffffff;
  color: #64748b;
}
.dark-theme .ccbd-url,
:root[data-theme="dark"] .ccbd-url {
  background: #1e293b;
  color: #94a3b8;
}
.ccbd-lock { color: #10b981; font-size: 10px; }

/* Viewport */
.ccbd-viewport {
  position: relative;
  height: 380px;
  overflow: hidden;
}

/* Mini site */
.ccbd-site {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.ccbd-site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.dark-theme .ccbd-site-header,
:root[data-theme="dark"] .ccbd-site-header {
  background: #1e293b;
  border-bottom-color: #334155;
}
.ccbd-site-logo {
  font-weight: 700; font-size: 13px;
  color: #0f172a;
}
.dark-theme .ccbd-site-logo,
:root[data-theme="dark"] .ccbd-site-logo {
  color: #f1f5f9;
}
.ccbd-site-nav {
  display: flex; gap: 12px; font-size: 11px;
  color: #64748b;
}
.dark-theme .ccbd-site-nav,
:root[data-theme="dark"] .ccbd-site-nav {
  color: #94a3b8;
}
.ccbd-site-body {
  flex: 1; padding: 20px 16px;
}
.ccbd-site-hero-text {
  font-size: 12px; line-height: 1.6;
  color: #475569;
  margin-bottom: 16px;
}
.dark-theme .ccbd-site-hero-text,
:root[data-theme="dark"] .ccbd-site-hero-text {
  color: #94a3b8;
}
.ccbd-site-placeholder {
  height: 14px; border-radius: 4px;
  background: #e2e8f0;
  margin-bottom: 10px;
  width: 100%;
}
.ccbd-site-placeholder.ccbd-short { width: 65%; }
.dark-theme .ccbd-site-placeholder,
:root[data-theme="dark"] .ccbd-site-placeholder {
  background: #334155;
}

/* Cookie banner */
.ccbd-banner {
  position: absolute;
  bottom: 12px; left: 12px;
  width: calc(100% - 24px);
  max-width: 320px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 10;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.dark-theme .ccbd-banner,
:root[data-theme="dark"] .ccbd-banner {
  background: #1e293b;
  border-color: #475569;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.ccbd-banner.ccbd-show {
  transform: translateY(0);
  opacity: 1;
}
.ccbd-banner-inner {
  padding: 14px;
}
.ccbd-banner-title {
  font-size: 13px; font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}
.dark-theme .ccbd-banner-title,
:root[data-theme="dark"] .ccbd-banner-title {
  color: #f1f5f9;
}
.ccbd-banner-desc {
  font-size: 11px; line-height: 1.5;
  color: #64748b;
  margin-bottom: 12px;
}
.dark-theme .ccbd-banner-desc,
:root[data-theme="dark"] .ccbd-banner-desc {
  color: #94a3b8;
}

/* Categories */
.ccbd-cats {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  opacity: 0;
}
.ccbd-cats.ccbd-expanded {
  max-height: 200px;
  opacity: 1;
}
.ccbd-cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.dark-theme .ccbd-cat,
:root[data-theme="dark"] .ccbd-cat {
  border-bottom-color: #334155;
}
.ccbd-cat:last-child { border-bottom: none; }
.ccbd-cat-info { flex: 1; min-width: 0; }
.ccbd-cat-name {
  font-size: 11px; font-weight: 600;
  color: #0f172a;
  display: block;
}
.dark-theme .ccbd-cat-name,
:root[data-theme="dark"] .ccbd-cat-name {
  color: #f1f5f9;
}
.ccbd-cat-desc {
  font-size: 9px;
  color: #94a3b8;
  display: block;
}

/* Toggle switch */
.ccbd-toggle {
  position: relative;
  width: 32px; height: 18px;
  flex-shrink: 0;
  margin-left: 8px;
}
.ccbd-toggle input {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.ccbd-slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.3s;
}
.dark-theme .ccbd-slider,
:root[data-theme="dark"] .ccbd-slider {
  background: #475569;
}
.ccbd-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.ccbd-toggle input:checked + .ccbd-slider {
  background: #10b981;
}
.ccbd-toggle input:checked + .ccbd-slider::before {
  transform: translateX(14px);
}
.ccbd-toggle-locked .ccbd-slider {
  opacity: 0.6;
  cursor: default;
}

/* Buttons */
.ccbd-btns {
  display: flex; gap: 6px;
  margin-bottom: 8px;
}
.ccbd-btn {
  flex: 1; border: none; border-radius: 6px;
  padding: 7px 4px;
  font-size: 10px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.ccbd-btn.ccbd-pressed {
  transform: scale(0.92);
}
.ccbd-btn-accept {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.ccbd-btn-reject {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.dark-theme .ccbd-btn-reject,
:root[data-theme="dark"] .ccbd-btn-reject {
  background: #334155;
  color: #94a3b8;
  border-color: #475569;
}
.ccbd-btn-settings {
  background: transparent;
  color: #10b981;
  border: 1px solid #10b981;
}
.ccbd-btn-settings.ccbd-active {
  background: transparent;
  color: #10b981;
  border-color: #10b981;
}

/* Branding */
.ccbd-branding {
  font-size: 9px;
  color: #94a3b8;
  text-align: center;
}
.ccbd-branding span {
  color: #10b981;
  font-weight: 600;
}

/* Success toast */
.ccbd-toast {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10b981;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 20;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  white-space: nowrap;
}
.ccbd-toast.ccbd-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ccbd-toast-icon { font-size: 14px; }

/* Progress bar — hidden by default, available for debug */
.ccbd-progress {
  height: 0;
  overflow: hidden;
}
.dark-theme .ccbd-progress,
:root[data-theme="dark"] .ccbd-progress {
  background: #334155;
}
.ccbd-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transform: scaleX(0);
  transform-origin: left;
}

/* Responsive */
@media (max-width: 640px) {
  .ccbd-container { width: 100%; }
  .ccbd-viewport { height: 300px; }
  .ccbd-banner { max-width: none; width: calc(100% - 16px); left: 8px; bottom: 8px; }
  .ccbd-btns { flex-wrap: wrap; }
  .ccbd-btn { min-width: calc(50% - 4px); }
  .ccbd-site-nav { display: none; }
}

@media (max-width: 480px) {
  .ccbd-viewport { height: 280px; }
  .ccbd-banner-inner { padding: 10px; }
  .ccbd-banner-title { font-size: 12px; }
}
