/* ============================================================
   SITE PREFS - privacy notice (consent) banner, modal, prefs btn
   IDs/classes deliberately neutral so adblocker cosmetic filters
   (I Don't Care About Cookies, uBlock annoyances, Brave Shields)
   don't auto-hide the consent UI.
   Loaded BEFORE style.css and design-system.css.
   ============================================================ */

/* ============================================================
   NOTICE BAR - dark glass floating card, bottom-anchored
   ============================================================ */
.notice-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  margin: 0 auto;
  width: calc(100% - 40px);
  max-width: 1100px;
  z-index: 9990;

  background: linear-gradient(180deg, rgba(22, 22, 26, 0.96) 0%, rgba(14, 14, 18, 0.94) 100%);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  transform: translateY(calc(100% + 40px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease, visibility 0s linear 0.55s;
  overflow: hidden;
}

.notice-bar.shown {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease, visibility 0s linear 0s;
}

/* Yellow accent line at the very top */
.notice-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 204, 0, 0.55) 50%,
    transparent 100%);
}

.notice-bar__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 22px 28px;
}

/* Shield icon */
.notice-bar__inner::before {
  content: '\f3ed';            /* fa-shield-halved */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.18) 0%, rgba(255, 204, 0, 0.06) 100%);
  border: 1px solid rgba(255, 204, 0, 0.28);
  color: #ffcc00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: none;
  flex-shrink: 0;
}

.notice-bar__text { min-width: 0; }

.notice-bar__text strong {
  display: block;
  color: #ffffff;
  font-family: var(--ds-font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}

.notice-bar__text p {
  font-family: var(--ds-font-body);
  font-size: 0.84rem;
  color: #b9b9c2;
  line-height: 1.55;
  margin: 0;
}

.notice-bar__text a {
  color: #ffcc00;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.2s;
}

.notice-bar__text a:hover { color: #ffe066; }

.notice-bar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.notice-btn {
  font-family: var(--ds-font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.02em;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s, background 0.22s, color 0.22s, border-color 0.22s;
}

.notice-btn--primary {
  background: #ffcc00;
  color: #0a0a0b;
  box-shadow: var(--ds-shadow-btn);
}

.notice-btn--primary:hover {
  background: #ffd83a;
  transform: translateY(-2px);
  box-shadow: var(--ds-shadow-btn-hover);
}

.notice-btn--outline {
  background: rgba(255, 255, 255, 0.04);
  color: #d6d6dc;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.notice-btn--outline:hover {
  border-color: rgba(255, 204, 0, 0.5);
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.06);
  transform: translateY(-2px);
}

.notice-btn--ghost {
  background: transparent;
  color: #888892;
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 600;
}

.notice-btn--ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

/* ============================================================
   PREFERENCES MODAL
   ============================================================ */
.notice-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notice-modal.shown { display: flex; }

.notice-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.notice-modal__box {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #1a1a1f 0%, #131318 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px 34px 30px;
  max-width: 540px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.6);
  animation: noticeModalIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.notice-modal__box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.6), transparent);
}

@keyframes noticeModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.notice-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notice-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  transform: rotate(90deg);
}

.notice-modal__title {
  font-family: var(--ds-font-body);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  padding-right: 40px;
}

.notice-modal__desc {
  font-family: var(--ds-font-body);
  font-size: 0.86rem;
  color: #999;
  line-height: 1.65;
  margin-bottom: 24px;
}

.notice-cat {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s, background 0.25s;
}

.notice-cat:hover { border-color: rgba(255, 255, 255, 0.12); }

.notice-cat__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.notice-cat__info { flex: 1; min-width: 0; }

.notice-cat__info h3 {
  font-family: var(--ds-font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.notice-cat__info p {
  font-family: var(--ds-font-body);
  font-size: 0.78rem;
  color: #888;
  margin: 0;
  line-height: 1.55;
}

.notice-always-on {
  font-family: var(--ds-font-body);
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffcc00;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.25);
  border-radius: 6px;
}

/* Toggle */
.notice-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.notice-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.notice-toggle__slider {
  position: absolute;
  inset: 0;
  background: #2a2a30;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  transition: background 0.25s, border-color 0.25s;
}

.notice-toggle__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s;
}

.notice-toggle input:checked + .notice-toggle__slider {
  background: rgba(255, 204, 0, 0.22);
  border-color: rgba(255, 204, 0, 0.45);
}

.notice-toggle input:checked + .notice-toggle__slider::before {
  transform: translateX(22px);
  background: #ffcc00;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.notice-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.notice-modal__actions .notice-btn {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 12px 16px;
}

.notice-modal__footer {
  font-family: var(--ds-font-body);
  font-size: 0.74rem;
  color: #666;
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
  line-height: 1.5;
}

.notice-modal__footer a {
  color: #ffcc00;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   FLOATING PREFS BUTTON (after consent given)
   ============================================================ */
.notice-prefs-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9985;
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--ds-font-body);
  font-size: 0.74rem;
  font-weight: 600;
  color: #888;
  display: none;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.notice-prefs-btn.shown { display: flex; }

.notice-prefs-btn:hover {
  color: #fff;
  border-color: rgba(255, 204, 0, 0.4);
  background: rgba(20, 20, 24, 0.98);
  transform: translateY(-2px);
}

.notice-prefs-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .notice-bar__inner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon text"
      "actions actions";
    gap: 18px 18px;
    padding: 20px 22px;
  }
  .notice-bar__inner::before { grid-area: icon; }
  .notice-bar__text { grid-area: text; }
  .notice-bar__actions {
    grid-area: actions;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .notice-bar {
    bottom: 12px;
    width: calc(100% - 24px);
    border-radius: 16px;
  }

  .notice-bar__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "icon"
      "text"
      "actions";
    gap: 14px;
    padding: 20px;
    text-align: left;
  }

  .notice-bar__inner::before {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
    border-radius: 12px;
    justify-self: start;
  }

  .notice-bar__text strong { font-size: 0.96rem; }
  .notice-bar__text p { font-size: 0.82rem; }

  .notice-bar__actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
    justify-content: stretch;
  }

  .notice-bar__actions .notice-btn {
    width: 100%;
    text-align: center;
    padding: 13px 16px;
  }

  .notice-modal { align-items: flex-end; padding: 0; }

  .notice-modal__box {
    border-radius: 18px 18px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    padding: 28px 22px 24px;
    animation: noticeSheetIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes noticeSheetIn {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .notice-modal__actions {
    flex-direction: column;
    gap: 8px;
  }

  .notice-modal__actions .notice-btn {
    width: 100%;
    flex: 0 0 auto;
  }

  .notice-prefs-btn { bottom: 14px; left: 14px; }
}

@media (max-width: 380px) {
  .notice-bar__inner { padding: 18px 16px; }
  .notice-modal__box { padding: 24px 18px 22px; }
  .notice-modal__title { font-size: 1.15rem; }
}
