/* ═══════════════════════════════════════════════════════════════════════════
   notifications.css  —  Sapere Plus | Focus
   Sistem de notificări elegant, integrat în estetica editorială a site-ului.
   Variabile: --ink, --parchment, --sienna, --amber, --graphite + Barlow Condensed
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Container ──────────────────────────────────────────────────────────── */
#notify-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9900;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.65rem;
  width: 360px;
  max-width: calc(100vw - 2.5rem);
  pointer-events: none;
}

/* ─── Overlay (for confirm) ──────────────────────────────────────────────── */
#notify-overlay {
  position: fixed;
  inset: 0;
  z-index: 9850;
  background: rgba(31, 27, 22, 0);
  backdrop-filter: blur(0px);
  pointer-events: none;
  transition:
    background 0.3s ease,
    backdrop-filter 0.3s ease;
}

#notify-overlay.notify-overlay--visible {
  background: rgba(31, 27, 22, 0.45);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

/* ─── Base Toast ─────────────────────────────────────────────────────────── */
.notify-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem 0.9rem 0;
  background: var(--parchment, #f4f0e6);
  border: 1px solid rgba(92, 84, 73, 0.15);
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(31, 27, 22, 0.12),
    0 8px 24px rgba(31, 27, 22, 0.08);
  pointer-events: auto;
  transform: translateX(calc(100% + 2.5rem));
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.28s ease;
  will-change: transform, opacity;
}

.notify-toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.notify-toast--leaving {
  transform: translateX(calc(100% + 2.5rem));
  opacity: 0;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .notify-toast {
    background: var(--surface-dark, #1e1a15);
    border-color: rgba(244, 240, 230, 0.08);
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.35),
      0 12px 32px rgba(0, 0, 0, 0.25);
  }
}

[data-theme="dark"] .notify-toast {
  background: var(--surface-dark, #1e1a15);
  border-color: rgba(244, 240, 230, 0.08);
}

/* ─── Left accent bar ────────────────────────────────────────────────────── */
.notify-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  flex-shrink: 0;
}

.notify-toast--success .notify-accent { background: #5a8a60; }
.notify-toast--error   .notify-accent { background: var(--sienna, #8c3a1c); }
.notify-toast--warning .notify-accent { background: var(--amber, #c49a1a); }
.notify-toast--info    .notify-accent { background: var(--graphite, #5c5449); }
.notify-toast--upload  .notify-accent { background: #4a72c4; }
.notify-toast--confirm .notify-accent { background: var(--ink, #312c25); }

/* ─── Icon ───────────────────────────────────────────────────────────────── */
.notify-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.05rem;
  margin-left: 0.85rem;
}

.notify-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.notify-toast--success .notify-icon { color: #5a8a60; }
.notify-toast--error   .notify-icon { color: var(--sienna, #8c3a1c); }
.notify-toast--warning .notify-icon { color: var(--amber, #c49a1a); }
.notify-toast--info    .notify-icon { color: var(--graphite, #5c5449); }
.notify-toast--upload  .notify-icon { color: #4a72c4; }
.notify-toast--confirm .notify-icon { color: var(--ink, #312c25); }

/* ─── Body ───────────────────────────────────────────────────────────────── */
.notify-body {
  flex: 1;
  min-width: 0;
  padding-right: 0.25rem;
}

.notify-label {
  display: block;
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite, #5c5449);
  margin-bottom: 0.2rem;
  line-height: 1;
}

.notify-toast--success .notify-label { color: #4a7a50; }
.notify-toast--error   .notify-label { color: var(--sienna, #8c3a1c); }
.notify-toast--warning .notify-label { color: #a07a00; }
.notify-toast--upload  .notify-label { color: #3a62b4; }

.notify-message {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink, #312c25);
  margin: 0;
}

[data-theme="dark"] .notify-message,
@media (prefers-color-scheme: dark) {
  .notify-message { color: var(--parchment, #f4f0e6); }
}

.notify-detail {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--graphite, #5c5449);
  margin: 0.3rem 0 0;
  line-height: 1.4;
  opacity: 0.8;
}

/* ─── Close button ───────────────────────────────────────────────────────── */
.notify-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--graphite, #5c5449);
  opacity: 0.5;
  transition: opacity 0.18s ease;
  align-self: flex-start;
  margin-top: -1px;
}

.notify-close:hover {
  opacity: 1;
}

.notify-close svg {
  width: 10px;
  height: 10px;
  display: block;
}

/* ─── Progress bar (auto-dismiss) ────────────────────────────────────────── */
.notify-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(92, 84, 73, 0.1);
  overflow: hidden;
}

.notify-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  animation: notifyProgressShrink linear forwards;
}

@keyframes notifyProgressShrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.notify-toast--success .notify-progress-bar { background: #5a8a60; }
.notify-toast--error   .notify-progress-bar { background: var(--sienna, #8c3a1c); }
.notify-toast--warning .notify-progress-bar { background: var(--amber, #c49a1a); }
.notify-toast--info    .notify-progress-bar { background: var(--graphite, #5c5449); }

/* ─── Upload progress bar ────────────────────────────────────────────────── */
.notify-upload-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.55rem;
}

.notify-upload-track {
  flex: 1;
  height: 3px;
  background: rgba(74, 114, 196, 0.15);
  border-radius: 0;
  overflow: hidden;
}

.notify-upload-fill {
  height: 100%;
  background: #4a72c4;
  transition: width 0.25s ease;
  border-radius: 0;
}

.notify-upload-pct {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #4a72c4;
  min-width: 2.4em;
  text-align: right;
}

/* ─── Confirm actions ────────────────────────────────────────────────────── */
.notify-confirm-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.notify-confirm-btn {
  flex: 1;
  padding: 0.4rem 0.75rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
  border-radius: 0;
}

.notify-confirm-btn--cancel {
  background: transparent;
  border: 1px solid rgba(92, 84, 73, 0.25);
  color: var(--graphite, #5c5449);
}

.notify-confirm-btn--cancel:hover {
  border-color: var(--graphite, #5c5449);
  background: rgba(92, 84, 73, 0.06);
}

.notify-confirm-btn--ok {
  background: var(--ink, #312c25);
  border: 1px solid var(--ink, #312c25);
  color: var(--parchment, #f4f0e6);
}

.notify-confirm-btn--ok:hover {
  background: var(--graphite, #5c5449);
  border-color: var(--graphite, #5c5449);
}

.notify-confirm-btn--danger {
  background: var(--sienna, #8c3a1c);
  border-color: var(--sienna, #8c3a1c);
}

.notify-confirm-btn--danger:hover {
  background: #7a2f14;
  border-color: #7a2f14;
}

/* ─── Confirm toast special sizing ──────────────────────────────────────── */
.notify-toast--confirm {
  z-index: 9910;
}

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #notify-container {
    bottom: auto;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
  }

  .notify-toast {
    transform: translateY(-110%);
  }

  .notify-toast--visible {
    transform: translateY(0);
  }

  .notify-toast--leaving {
    transform: translateY(-110%);
  }
}

/* ─── Prevent body scroll when confirm overlay active ────────────────────── */
body.notify-overlay-active {
  /* do not lock scroll — confirm is non-blocking by design */
}
