/* =====================================================
   Notifications System Styles
   ===================================================== */

:root {
  --ntf-z-base: 1000;
  --ntf-anim-duration: 300ms;
  --ntf-anim-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   Snackbar Containers
   ===================================================== */

.ntf-snackbar-container {
  position: fixed;
  z-index: var(--ntf-z-base);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.ntf-snackbar-bottom-right  { bottom: 20px; right: 20px; }
.ntf-snackbar-bottom-left   { bottom: 20px; left: 20px; }
.ntf-snackbar-top-right     { top: 20px;    right: 20px; }
.ntf-snackbar-top-left      { top: 20px;    left: 20px; }
.ntf-snackbar-bottom-center { bottom: 20px; left: 50%; transform: translateX(-50%); }
.ntf-snackbar-top-center    { top: 20px;    left: 50%; transform: translateX(-50%); }

/* =====================================================
   Snackbar
   ===================================================== */

.ntf-snackbar {
  min-width: 288px;
  max-width: 568px;
  background-color: var(--elevated, #333);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--ntf-anim-duration) var(--ntf-anim-easing),
              transform var(--ntf-anim-duration) var(--ntf-anim-easing);
  font-family: var(--font-body, 'Inter', sans-serif);
}

.ntf-snackbar-show {
  opacity: 1;
  transform: translateY(0);
}

.ntf-snackbar-hide {
  opacity: 0;
  transform: translateY(20px);
}

.ntf-snackbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 16px;
}

.ntf-snackbar-message {
  color: var(--text-primary, #fff);
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
}

.ntf-snackbar-action {
  background: none;
  border: none;
  color: var(--blue, #3ea5ff);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
  flex-shrink: 0;
  font-family: inherit;
}

.ntf-snackbar-action:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Snackbar Types */
.ntf-snackbar-success { background-color: var(--green, #3fbb46); }
.ntf-snackbar-error   { background-color: var(--red, #ff3b4a); }
.ntf-snackbar-warning { background-color: var(--warning, #ffcd45); }
.ntf-snackbar-info    { background-color: var(--blue, #3ea5ff); }

.ntf-snackbar-warning .ntf-snackbar-message,
.ntf-snackbar-warning .ntf-snackbar-action { color: #1a1a00; }

.ntf-snackbar-success .ntf-snackbar-action,
.ntf-snackbar-error .ntf-snackbar-action,
.ntf-snackbar-info .ntf-snackbar-action { color: #fff; }


/* =====================================================
   Dialog Wrapper / Overlay
   ===================================================== */

.ntf-dialog-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity var(--ntf-anim-duration) var(--ntf-anim-easing);
}

/* Overlay mode (dark backdrop, flex center) */
.ntf-dialog-has-overlay {
  background-color: var(--overlay, rgba(0, 0, 0, 0.7));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
}

.ntf-dialog-has-overlay.ntf-dialog-show {
  opacity: 1;
}

/* No-overlay mode (transparent, clicks pass through) */
.ntf-dialog-no-overlay {
  background: none;
  pointer-events: none;
  opacity: 1;
}

.ntf-dialog-no-overlay .ntf-dialog {
  pointer-events: auto;
}

/* =====================================================
   Dialog
   ===================================================== */

.ntf-dialog {
  background-color: var(--surface-variant, #1a1a1a);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: var(--font-body, 'Inter', sans-serif);
  border: 1px solid var(--border-highlight, #3b3a3a);
}

/* Centered dialog animation (scale in) */
.ntf-dialog-has-overlay .ntf-dialog {
  opacity: 0;
  transform: scale(0.92);
  transition: transform var(--ntf-anim-duration) var(--ntf-anim-easing),
              opacity var(--ntf-anim-duration) var(--ntf-anim-easing);
}

.ntf-dialog-has-overlay.ntf-dialog-show .ntf-dialog {
  opacity: 1;
  transform: scale(1);
}

/* Positioned dialog (fixed, fade in) */
.ntf-dialog-positioned {
  position: fixed;
  width: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--ntf-anim-duration) var(--ntf-anim-easing),
              transform var(--ntf-anim-duration) var(--ntf-anim-easing);
}

.ntf-dialog-show .ntf-dialog-positioned {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   Dialog Header
   ===================================================== */

.ntf-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0 24px;
  gap: 12px;
}

.ntf-dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #f1f1f1);
  line-height: 1.3;
}

.ntf-dialog-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-tertiary, #71767b);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.ntf-dialog-close:hover {
  background-color: var(--elevated-highlight, #242626);
  color: var(--text-primary, #f1f1f1);
}

/* =====================================================
   Dialog Body
   ===================================================== */

.ntf-dialog-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.ntf-dialog-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #aaaaaa);
}

.ntf-dialog-body a,
.ntf-dialog-message a {
  color: var(--blue, #3ea5ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ntf-dialog-body a:hover,
.ntf-dialog-message a:hover {
  opacity: 0.85;
}

/* =====================================================
   Dialog Footer & Buttons
   ===================================================== */

.ntf-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px 24px;
}

.ntf-dialog-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  background-color: var(--elevated-highlight, #242626);
  color: var(--text-primary, #f1f1f1);
  font-family: inherit;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ntf-dialog-btn:hover {
  background-color: var(--elevated-surface, #2a2a2a);
}

.ntf-dialog-btn:active {
  transform: scale(0.97);
}

/* Primary button */
.ntf-dialog-btn-primary {
  background-color: var(--blue, #3ea5ff);
  color: #fff;
}

.ntf-dialog-btn-primary:hover {
  background-color: #5eb4ff;
}

/* Link-style button (pushed to left via margin-right: auto) */
.ntf-dialog-btn-link {
  background: none;
  color: var(--text-secondary, #aaaaaa);
  padding: 10px 4px;
  margin-right: auto;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.ntf-dialog-btn-link:hover {
  background: none;
  color: var(--text-primary, #f1f1f1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ntf-dialog-btn-link::after {
  content: " ›";
  font-size: 16px;
}

/* =====================================================
   Dialog Input
   ===================================================== */

.ntf-dialog-input-wrapper {
  margin-top: 16px;
}

.ntf-dialog-input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #aaaaaa);
  margin-bottom: 8px;
}

.ntf-dialog-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  background-color: var(--field-fill, #121212);
  color: var(--text-primary, #f1f1f1);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ntf-dialog-input:focus {
  border-color: var(--blue, #3ea5ff);
}

.ntf-dialog-input::placeholder {
  color: var(--text-tertiary, #71767b);
}

textarea.ntf-dialog-input {
  min-height: 80px;
  resize: vertical;
}

/* =====================================================
   Dialog Loading Overlay
   ===================================================== */

.ntf-dialog-loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlayVariant, rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  z-index: 5;
}

.ntf-dialog-loading-show {
  display: flex !important;
}

.ntf-dialog-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--blue, #3ea5ff);
  border-radius: 50%;
  animation: ntf-spin 0.8s linear infinite;
}

@keyframes ntf-spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   Banner
   ===================================================== */

.ntf-banner {
  position: fixed;
  left: 0;
  width: 100%;
  z-index: calc(var(--ntf-z-base) + 500);
  background-color: var(--elevated, #333);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-family: var(--font-body, 'Inter', sans-serif);
  transition: transform var(--ntf-anim-duration) var(--ntf-anim-easing);
}

.ntf-banner-top {
  top: 0;
  transform: translateY(-100%);
  border-bottom: 1px solid var(--border-color, #444);
}

.ntf-banner-bottom {
  bottom: 0;
  top: auto;
  transform: translateY(100%);
  border-top: 1px solid var(--border-color, #444);
}

.ntf-banner-show.ntf-banner-top,
.ntf-banner-show.ntf-banner-bottom {
  transform: translateY(0);
}

.ntf-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
}

.ntf-banner-message {
  color: var(--text-primary, #f1f1f1);
  font-size: 14px;
  flex: 1;
}

.ntf-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ntf-banner-action {
  background: none;
  border: none;
  color: var(--blue, #3ea5ff);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-family: inherit;
}

.ntf-banner-action:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.ntf-banner-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  line-height: 1;
}

.ntf-banner-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #f1f1f1);
}

/* Banner Types */
.ntf-banner-success { background-color: var(--green, #3fbb46); border-color: #2a8a32; }
.ntf-banner-error   { background-color: var(--red, #ff3b4a);   border-color: #cc2f3a; }
.ntf-banner-warning { background-color: var(--warning, #ffcd45); border-color: #d4a838; }
.ntf-banner-info    { background-color: var(--blue, #3ea5ff);   border-color: #2a7acc; }

.ntf-banner-success .ntf-banner-message,
.ntf-banner-success .ntf-banner-action,
.ntf-banner-error .ntf-banner-message,
.ntf-banner-error .ntf-banner-action,
.ntf-banner-info .ntf-banner-message,
.ntf-banner-info .ntf-banner-action { color: #fff; }

.ntf-banner-warning .ntf-banner-message,
.ntf-banner-warning .ntf-banner-action,
.ntf-banner-warning .ntf-banner-close { color: #1a1a00; }


/* =====================================================
   Cookie Preferences — Category List
   ===================================================== */

.ntf-cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.ntf-cookie-category {
  padding: 14px 16px;
  border-radius: 10px;
  background-color: var(--elevated, #181a1a);
  border: 1px solid var(--border-highlight, #3b3a3a);
}

.ntf-cookie-category-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ntf-cookie-category-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.ntf-cookie-category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #f1f1f1);
}

.ntf-cookie-required {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary, #71767b);
  margin-left: 4px;
}

.ntf-cookie-category-desc {
  font-size: 13px;
  color: var(--text-secondary, #aaaaaa);
  line-height: 1.4;
}


/* =====================================================
   Toggle Switch
   ===================================================== */

.ntf-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.ntf-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color, #444);
  border-radius: 24px;
  transition: background-color 0.25s;
}

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

.ntf-toggle input:checked + .ntf-toggle-slider {
  background-color: var(--blue, #3ea5ff);
}

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

.ntf-toggle input:disabled + .ntf-toggle-slider {
  opacity: 0.4;
  cursor: not-allowed;
}


/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 640px) {
  .ntf-snackbar {
    min-width: auto;
    max-width: calc(100vw - 32px);
  }

  .ntf-snackbar-container {
    left: 16px !important;
    right: 16px !important;
    transform: none !important;
  }

  .ntf-dialog {
    border-radius: 12px;
  }

  .ntf-dialog-header { padding: 16px 16px 0 16px; }
  .ntf-dialog-body   { padding: 12px 16px; }
  .ntf-dialog-footer { padding: 12px 16px 16px 16px; flex-wrap: wrap; }

  .ntf-dialog-btn-link {
    width: 100%;
    margin-right: 0;
    order: 3;
    text-align: center;
  }

  .ntf-dialog-footer {
    justify-content: stretch;
  }

  .ntf-dialog-footer .ntf-dialog-btn:not(.ntf-dialog-btn-link) {
    flex: 1;
  }
}
