/* Shared UI: toasts, confirms, primary action buttons */

:root {
  --ui-accent: var(--accent, #4A9EFF);
  --ui-accent-2: var(--accent-hover, #7EC8FF);
  --ui-surface: #16181d;
  --ui-muted: rgba(255, 255, 255, 0.55);
}

/* —— Buttons —— */
.btn-extended {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(105deg, #1B6FD4, #4AA6FF 55%, #7EC8FF);
  color: #031018;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(168, 220, 255, 0.35);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 28px rgba(27, 111, 212, 0.28);
}

.btn-extended:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 36px rgba(27, 111, 212, 0.38);
  color: #fff;
  text-decoration: none;
}

.btn-extended:active {
  transform: translateY(0);
}

.btn-extended:disabled,
.btn-extended.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-extended.ghost {
  background: transparent;
  color: var(--ui-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.btn-extended.ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.18);
  filter: none;
}

.btn-extended.danger {
  background: linear-gradient(90deg, #0E3F7A, #2F86E8);
  border-color: rgba(126, 200, 255, 0.35);
}

.btn-extended.is-active {
  outline: 2px solid rgba(126, 200, 255, 0.55);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.12), 0 10px 28px rgba(27, 111, 212, 0.28);
}

a.btn-extended {
  color: #fff;
}

/* —— Toasts —— */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--ui-surface);
  color: white;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.3s;
  z-index: 999999;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { border-color: #4ade80; }
.toast-error { border-color: #6BB3FF; }
.toast-warning { border-color: #facc15; }
.toast-info { border-color: #60a5fa; }

/* —— Confirm modal —— */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.confirm-box {
  background: var(--ui-surface);
  padding: 22px;
  border-radius: 14px;
  width: min(360px, 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.confirm-text {
  margin-bottom: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
}

.confirm-buttons button {
  flex: 1;
  border: none;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.confirm-buttons button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.confirm-buttons .yes {
  background: #6BB3FF;
  color: white;
}

.confirm-buttons .no {
  background: #2a2d35;
  color: white;
}

@media (max-width: 640px) {
  .btn-extended {
    width: 100%;
    max-width: 100%;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
