/* =====================================================
   GAUS Notifications (Toast + Dialog + Inline Alert)
   - Used by: viewer.html, login.html, admin pages
   ===================================================== */

:root{
  --n-radius: 14px;
  --n-shadow: 0 18px 48px rgba(0,0,0,.22);
  --n-border: rgba(15, 23, 42, 0.10);
  --n-bg: rgba(255,255,255,.92);
  --n-fg: #0f172a;
  --n-muted: #64748b;
  --n-backdrop: rgba(2,6,23,.58);
}

body.dark{
  --n-border: rgba(148, 163, 184, 0.20);
  --n-bg: rgba(2,6,23,.72);
  --n-fg: #e5e7eb;
  --n-muted: #94a3b8;
  --n-backdrop: rgba(2,6,23,.72);
}

/* ---------- Toast (GAUS + legacy Points toast compatibility) ---------- */

#gaus-toast-wrap,
#points-toast-wrap{
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  /* Daha uzun mesajlar için daha geniş */
  width: min(520px, calc(100vw - 40px));
}

.gaus-toast,
.points-toast{
  pointer-events: auto;
  display: flex;
  overflow: hidden;
  border-radius: var(--n-radius);
  border: 1px solid var(--n-border);
  background: var(--n-bg);
  color: var(--n-fg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--n-shadow);
  animation: gausToastIn .22s ease both;
}

.gaus-toast-bar,
.points-toast-bar{
  width: 4px;
  flex-shrink: 0;
}

.gaus-toast-bar.info,
.points-toast-bar.info{ background:#2546A9; }
.gaus-toast-bar.success,
.points-toast-bar.success{ background:#10B981; }
.gaus-toast-bar.warning,
.points-toast-bar.warning{ background:#F59E0B; }
.gaus-toast-bar.error,
.points-toast-bar.error{ background:#EF4444; }

.gaus-toast-main{
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gaus-toast-row{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  min-width: 0;
}

.gaus-toast-x,
.points-toast-x{
  all: unset;
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
  color: var(--n-muted);
  padding: 2px 4px;
  border-radius: 8px;
}
.gaus-toast-x:hover,
.points-toast-x:hover{
  color: var(--n-fg);
  background: color-mix(in srgb, var(--n-border) 40%, transparent);
}

.gaus-toast-body,
.points-toast-body{
  font-size: 13px;
  line-height: 1.35;
  color: var(--n-fg);
  white-space: nowrap;       /* tek satır */
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

@keyframes gausToastIn{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes gausToastOut{
  from{ opacity:1; transform: translateY(0); }
  to{ opacity:0; transform: translateY(10px); }
}

/* ---------- Dialog (confirm / prompt) ---------- */

.gaus-dialog-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--n-backdrop);
}

.gaus-dialog{
  width: min(520px, calc(100vw - 36px));
  border-radius: 16px;
  border: 1px solid var(--n-border);
  background: var(--n-bg);
  color: var(--n-fg);
  box-shadow: var(--n-shadow);
  overflow: hidden;
}

.gaus-dialog-hd{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--n-border) 60%, transparent);
}

.gaus-dialog-title{
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .2px;
}

.gaus-dialog-x{
  all: unset;
  cursor: pointer;
  color: var(--n-muted);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 10px;
}
.gaus-dialog-x:hover{
  color: var(--n-fg);
  background: color-mix(in srgb, var(--n-border) 40%, transparent);
}

.gaus-dialog-bd{
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--n-fg);
  white-space: pre-wrap;
}

.gaus-dialog-input{
  width: 100%;
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--n-border) 70%, transparent);
  background: color-mix(in srgb, var(--n-bg) 80%, transparent);
  color: var(--n-fg);
  outline: none;
}
.gaus-dialog-input:focus{
  border-color: color-mix(in srgb, #2546A9 55%, var(--n-border));
  box-shadow: 0 0 0 3px rgba(37,70,169,.12);
}

.gaus-dialog-ft{
  padding: 12px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid color-mix(in srgb, var(--n-border) 60%, transparent);
}

.gaus-btn{
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid transparent;
  user-select: none;
}
.gaus-btn.secondary{
  border-color: color-mix(in srgb, var(--n-border) 75%, transparent);
  background: color-mix(in srgb, var(--n-bg) 70%, transparent);
  color: var(--n-fg);
}
.gaus-btn.secondary:hover{
  background: color-mix(in srgb, var(--n-bg) 55%, transparent);
}
.gaus-btn.primary{
  background: #2546A9;
  color: #fff;
}
.gaus-btn.primary:hover{ background:#1E3A8A; }
.gaus-btn.danger{
  background: #dc2626;
  color: #fff;
}
.gaus-btn.danger:hover{ background:#b91c1c; }

/* ---------- Inline alert component (matches user's .error markup) ---------- */

.error{
  /* UIverse-like compact toast/alert */
  --a-accent: #EF4444;
  --a-bg: var(--a-accent);
  --a-fg: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 0;
  background: var(--a-bg);
  color: var(--a-fg);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  pointer-events: auto;
}
.error--info{ --a-accent:#2546A9; }
.error--success{ --a-accent:#10B981; }
.error--warning{ --a-accent:#F59E0B; }
.error--error{ --a-accent:#EF4444; }

.error__icon{
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
}
.error__icon svg{ width: 14px; height: 14px; }
.error__icon svg path{ fill: currentColor !important; }

.error__title{
  flex: 1;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;        /* tek satır */
  overflow: hidden;
  text-overflow: ellipsis;
}

.error__close{
  flex: 0 0 auto;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: rgba(255,255,255,.92);
}
.error__close:hover{
  background: rgba(255,255,255,.16);
  color: #fff;
}
.error__close svg{ width: 14px; height: 14px; }
.error__close svg path{ fill: currentColor !important; }

/* Küçük ekranlarda biraz daha dar + okunaklı kalsın */
@media (max-width: 420px){
  #gaus-toast-wrap,
  #points-toast-wrap{
    width: calc(100vw - 24px);
    left: 12px;
    bottom: 12px;
  }
  .error{
    padding: 9px 10px;
  }
  .error__title{
    font-size: 12px;
  }
}

