
@import url('https://fonts.googleapis.com/css2?family=Jura:wght@600;700&family=Poppins:wght@400;600&display=swap');

:root {
  --bn-z-toast: 14000;
  --bn-z-confirm: 15000;
  --bn-surface: #27272a;
  --bn-bg: #18181b;
  --bn-border: rgba(255, 255, 255, 0.1);
  --bn-accent: #cc1c39;
  --bn-accent-hover: #a51935;
  --bn-text: #fff;
  --bn-muted: #ccc;
  --bn-radius: 12px;
  --bn-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .bibrik-toast,
  .bibrik-confirm {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

.bibrik-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  bottom: auto;
  z-index: var(--bn-z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.bibrik-toast-host > * {
  pointer-events: auto;
}

.bibrik-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bn-surface);
  border: 1px solid var(--bn-border);
  border-radius: var(--bn-radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: var(--bn-text);
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateX(110%);
  transition: opacity 0.3s var(--bn-ease), transform 0.35s var(--bn-ease);
}

.bibrik-toast--show {
  opacity: 1;
  transform: translateX(0);
}

.bibrik-toast--hide {
  opacity: 0;
  transform: translateX(110%);
}

.bibrik-toast__icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.bibrik-toast--success {
  border-left: 4px solid #22c55e;
}
.bibrik-toast--success .bibrik-toast__icon {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.bibrik-toast--success .bibrik-toast__icon::before {
  content: '✓';
}

.bibrik-toast--error {
  border-left: 4px solid var(--bn-accent);
}
.bibrik-toast--error .bibrik-toast__icon {
  background: rgba(204, 28, 57, 0.25);
  color: #fca5a5;
}
.bibrik-toast--error .bibrik-toast__icon::before {
  content: '!';
}

.bibrik-toast--warning {
  border-left: 4px solid #eab308;
}
.bibrik-toast--warning .bibrik-toast__icon {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}
.bibrik-toast--warning .bibrik-toast__icon::before {
  content: '⚠';
}

.bibrik-toast--info {
  border-left: 4px solid #3b82f6;
}
.bibrik-toast--info .bibrik-toast__icon {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.bibrik-toast--info .bibrik-toast__icon::before {
  content: 'i';
  font-style: italic;
  font-family: Georgia, serif;
}

.bibrik-toast__text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.bibrik-toast__close {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--bn-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.bibrik-toast__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

@media (max-width: 480px) {
  .bibrik-toast-host {
    left: 1rem;
    right: 1rem;
    align-items: stretch;
  }

  .bibrik-toast {
    transform: translateY(-120%);
  }

  .bibrik-toast--show {
    transform: translateY(0);
  }

  .bibrik-toast--hide {
    transform: translateY(-120%);
  }
}

.bibrik-confirm {
  position: fixed;
  inset: 0;
  z-index: var(--bn-z-confirm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--bn-ease), visibility 0.25s;
}

.bibrik-confirm--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bibrik-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.bibrik-confirm__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--bn-surface);
  border: 2px solid var(--bn-border);
  border-radius: 15px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  padding: 1.35rem 1.5rem 1.25rem;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.28s var(--bn-ease);
}

.bibrik-confirm--open .bibrik-confirm__panel {
  transform: scale(1) translateY(0);
}

.bibrik-confirm__title {
  margin: 0 0 0.65rem;
  font-family: 'Jura', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bn-text);
  letter-spacing: 0.02em;
}

.bibrik-confirm__title span {
  color: var(--bn-accent);
}

.bibrik-confirm__message {
  margin: 0 0 1.35rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--bn-muted);
}

.bibrik-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.bibrik-confirm__btn {
  padding: 0.65rem 1.2rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease, border-color 0.25s ease;
}

.bibrik-confirm__btn:active {
  transform: scale(0.98);
}

.bibrik-confirm__btn--cancel {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.bibrik-confirm__btn--cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}

.bibrik-confirm__btn--ok {
  background: var(--bn-accent);
  color: #fff;
}

.bibrik-confirm__btn--ok:hover {
  background: var(--bn-accent-hover);
  box-shadow: 0 6px 20px rgba(204, 28, 57, 0.35);
}

.bibrik-confirm__btn--danger {
  background: #7f1d1d;
}

.bibrik-confirm__btn--danger:hover {
  background: #991b1b;
  box-shadow: 0 6px 20px rgba(127, 29, 29, 0.4);
}
