/* =========================================================================
   Cookie Consent Banner & Preferences Panel
   Standalone CSS for the Punchly Admin app
   ========================================================================= */

/* Banner — fixed bottom, slides up */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.cookie-banner-title {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  margin: 0 0 0.25rem;
}

.cookie-banner-desc {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.cookie-banner-link {
  color: #005BB2;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Shared button base */
.cookie-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.cookie-btn-accept {
  background: #005BB2;
  color: #fff;
}
.cookie-btn-accept:hover {
  background: #004A91;
}

.cookie-btn-reject {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.cookie-btn-reject:hover {
  background: #e5e7eb;
}

.cookie-btn-manage {
  background: transparent;
  color: #005BB2;
  border: 1px solid #005BB2;
}
.cookie-btn-manage:hover {
  background: #eff6ff;
}

/* Preferences overlay */
.cookie-prefs-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-prefs-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-prefs-panel {
  background: #fff;
  border-radius: 1rem;
  max-width: 32rem;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.cookie-prefs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.cookie-prefs-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.cookie-prefs-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.cookie-prefs-close:hover {
  color: #111827;
}

.cookie-prefs-body {
  padding: 1.5rem;
}

.cookie-prefs-category {
  padding: 1rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.cookie-prefs-category:last-child {
  border-bottom: none;
}

.cookie-prefs-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-prefs-cat-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem;
}

.cookie-prefs-cat-desc {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.cookie-prefs-always-on {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  white-space: nowrap;
}

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

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  transition: background-color 0.3s;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: #005BB2;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
}

.cookie-prefs-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .cookie-banner-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .cookie-prefs-footer {
    flex-direction: column;
  }
}
