/**
 * Cookie Consent Banner Styles
 * Pattern: Full-width bottom bar (Sylvan-style)
 * Palette: PhonoLogic Literate Warmth
 */

.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(53, 75, 94, 0.1);
  padding: 16px 24px;
  display: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

.cc-banner.visible {
  display: flex;
  align-items: center;
  gap: 20px;
  animation: ccSlideUp 0.3s ease;
}

@keyframes ccSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cc-text {
  flex: 1;
  min-width: 0;
}

.cc-text a {
  color: #5B8F8A;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-text a:hover {
  color: #354B5E;
}

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

.cc-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  border: none;
}

.cc-btn-primary {
  background: #dc9435;
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 148, 53, 0.2);
}

.cc-btn-primary:hover {
  background: #c4842f;
}

.cc-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.cc-btn-secondary:hover {
  background: #e5e7eb;
}

/* Preferences panel (inline expand) */
.cc-prefs {
  display: none;
  padding: 16px 0 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 12px;
}

.cc-prefs.visible {
  display: block;
}

.cc-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.cc-pref-row:last-child {
  border-bottom: none;
}

.cc-pref-label {
  font-weight: 500;
  color: #354B5E;
}

.cc-pref-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.cc-pref-label small {
  font-weight: 400;
  color: #9ca3af;
  margin-left: 6px;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.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.2s;
}

.cc-toggle input:checked + .cc-toggle-track {
  background: #5B8F8A;
}

.cc-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.cc-toggle input:checked + .cc-toggle-track::after {
  transform: translateX(20px);
}

.cc-toggle input:disabled + .cc-toggle-track {
  opacity: 0.5;
  cursor: not-allowed;
}

.cc-prefs-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .cc-banner.visible {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }
  .cc-actions {
    justify-content: stretch;
  }
  .cc-btn {
    flex: 1;
    text-align: center;
  }
}

/* Dark mode */
[data-theme="dark"] .cc-banner {
  background: var(--color-bg-card, #1e1e2e);
  border-top-color: var(--color-border, #374151);
  color: var(--color-text, #e5e7eb);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cc-text a {
  color: #7ec8c0;
}

[data-theme="dark"] .cc-btn-secondary {
  background: var(--color-bg-subtle, #2d2d44);
  color: var(--color-text, #e5e7eb);
}

[data-theme="dark"] .cc-prefs {
  border-top-color: var(--color-border, #374151);
}

[data-theme="dark"] .cc-pref-row {
  border-bottom-color: var(--color-border, #2d2d44);
}

[data-theme="dark"] .cc-pref-label {
  color: var(--color-text, #e5e7eb);
}

[data-theme="dark"] .cc-toggle-track {
  background: var(--color-border, #4b5563);
}
