/* Cookie Consent Banner Styles */
:root {
  --cc-bg: #1a1a1a;
  --cc-text: #f4f4f4;
  --cc-accent: #8F3D05;
  --cc-accent-hover: #b04e0a;
  --cc-border: #333333;
  --cc-btn-bg: #2a2a2a;
  --cc-btn-hover: #3a3a3a;
  --cc-focus: #ff7a29;
}

/* Base resets for the banner */
#cf-cookie-banner, #cf-cookie-preferences {
  box-sizing: border-box;
  font-family: var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif);
}

#cf-cookie-banner *, #cf-cookie-preferences * {
  box-sizing: inherit;
}

/* Banner Container */
#cf-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--cc-bg);
  color: var(--cc-text);
  padding: 1.5rem;
  z-index: 9999;
  border-top: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  visibility: hidden;
}

#cf-cookie-banner.cf-show {
  transform: translateY(0);
  visibility: visible;
}

.cf-cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .cf-cookie-banner-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cf-cookie-banner-text p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--cc-text);
}

.cf-cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .cf-cookie-banner-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) {
  .cf-cookie-banner-actions {
    align-items: center;
    flex-wrap: nowrap;
  }
}

/* Buttons */
.cf-cc-btn {
  appearance: none;
  border: 1px solid transparent;
  background-color: var(--cc-btn-bg);
  color: var(--cc-text);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.cf-cc-btn:focus-visible {
  outline: 2px solid var(--cc-focus);
  outline-offset: 2px;
}

/* Equal weight for Accept All and Reject Non-Essential */
.cf-cc-btn-primary, .cf-cc-btn-secondary {
  background-color: var(--cc-accent);
  color: white;
  border-color: var(--cc-accent);
}

.cf-cc-btn-primary:hover, .cf-cc-btn-secondary:hover {
  background-color: var(--cc-accent-hover);
  border-color: var(--cc-accent-hover);
}

/* Make Reject visually equal to Accept */
.cf-cc-btn-secondary {
  background-color: transparent;
  border-color: var(--cc-text);
  color: var(--cc-text);
}

.cf-cc-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Manage preferences button */
.cf-cc-btn-outline {
  background-color: transparent;
  border: none;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0.75rem 0.5rem;
}

.cf-cc-btn-outline:hover {
  color: var(--cc-focus);
}

/* Preferences Modal */
#cf-cookie-preferences {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

#cf-cookie-preferences.cf-show {
  opacity: 1;
  visibility: visible;
}

.cf-cc-modal {
  background-color: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#cf-cookie-preferences.cf-show .cf-cc-modal {
  transform: scale(1);
}

.cf-cc-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cf-cc-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--cc-text);
}

.cf-cc-close {
  background: none;
  border: none;
  color: var(--cc-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  border-radius: 4px;
}

.cf-cc-close:hover {
  color: var(--cc-focus);
}

.cf-cc-close:focus-visible {
  outline: 2px solid var(--cc-focus);
  outline-offset: 2px;
}

.cf-cc-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.cf-cc-modal-body p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #cccccc;
}

.cf-cc-category {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cc-border);
}

.cf-cc-category:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cf-cc-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cf-cc-category-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--cc-text);
}

.cf-cc-category p {
  margin: 0;
  font-size: 0.875rem;
  color: #aaaaaa;
}

/* Toggle Switch */
.cf-cc-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.cf-cc-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--cc-btn-bg);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--cc-border);
}

.cf-cc-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #888;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .cf-cc-slider {
  background-color: var(--cc-accent);
  border-color: var(--cc-accent);
}

input:checked + .cf-cc-slider:before {
  transform: translateX(24px);
  background-color: white;
}

input:focus-visible + .cf-cc-slider {
  outline: 2px solid var(--cc-focus);
  outline-offset: 2px;
}

input:disabled + .cf-cc-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

input:disabled:checked + .cf-cc-slider {
  background-color: #444;
  border-color: #444;
}

input:disabled + .cf-cc-slider:before {
  background-color: #aaa;
}

.cf-cc-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--cc-border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #cf-cookie-banner,
  .cf-cc-slider,
  .cf-cc-slider:before,
  #cf-cookie-preferences,
  .cf-cc-modal,
  .cf-cc-btn {
    transition: none !important;
  }
}
