/* VynaaAPi - Custom Toast & Dialog System */
:root {
  --toast-success: #22c55e;
  --toast-error: #ef4444;
  --toast-warning: #f59e0b;
  --toast-info: #3b82f6;
  --toast-bg: #1a1a1a;
  --toast-border: rgba(255,255,255,0.08);
  --dialog-bg: #141414;
  --dialog-overlay: rgba(0,0,0,0.75);
}

/* ===== TOAST NOTIFICATIONS ===== */
#vynaa-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 40px);
}

.vynaa-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  pointer-events: all;
  cursor: pointer;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: hidden;
  position: relative;
}

.vynaa-toast.closing {
  animation: toastOut 0.25s ease forwards;
}

.vynaa-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-top: 1px;
}

.vynaa-toast.success .vynaa-toast-icon { background: rgba(34,197,94,0.2); color: var(--toast-success); }
.vynaa-toast.error .vynaa-toast-icon { background: rgba(239,68,68,0.2); color: var(--toast-error); }
.vynaa-toast.warning .vynaa-toast-icon { background: rgba(245,158,11,0.2); color: var(--toast-warning); }
.vynaa-toast.info .vynaa-toast-icon { background: rgba(59,130,246,0.2); color: var(--toast-info); }

.vynaa-toast-left-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 12px 0 0 12px;
}
.vynaa-toast.success .vynaa-toast-left-bar { background: var(--toast-success); }
.vynaa-toast.error .vynaa-toast-left-bar { background: var(--toast-error); }
.vynaa-toast.warning .vynaa-toast-left-bar { background: var(--toast-warning); }
.vynaa-toast.info .vynaa-toast-left-bar { background: var(--toast-info); }

.vynaa-toast-body { flex: 1; min-width: 0; }
.vynaa-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  line-height: 1.3;
  margin-bottom: 2px;
}
.vynaa-toast-msg {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
  word-break: break-word;
}

.vynaa-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-top: -1px;
  transition: color 0.2s;
}
.vynaa-toast-close:hover { color: #ccc; }

.vynaa-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 0 12px;
  animation: toastProgress linear forwards;
}
.vynaa-toast.success .vynaa-toast-progress { background: var(--toast-success); }
.vynaa-toast.error .vynaa-toast-progress { background: var(--toast-error); }
.vynaa-toast.warning .vynaa-toast-progress { background: var(--toast-warning); }
.vynaa-toast.info .vynaa-toast-progress { background: var(--toast-info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); max-height: 100px; }
  to { opacity: 0; transform: translateX(110%) scale(0.95); max-height: 0; padding: 0; margin: 0; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ===== DIALOG / CONFIRM ===== */
#vynaa-dialog-overlay {
  position: fixed;
  inset: 0;
  background: var(--dialog-overlay);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: dialogFadeIn 0.2s ease;
}

#vynaa-dialog-overlay.hidden { display: none; }

@keyframes dialogFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vynaa-dialog {
  background: var(--dialog-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  animation: dialogSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialogSlideIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.vynaa-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.vynaa-dialog-icon.danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.vynaa-dialog-icon.warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.vynaa-dialog-icon.info { background: rgba(59,130,246,0.15); color: #3b82f6; }
.vynaa-dialog-icon.success { background: rgba(34,197,94,0.15); color: #22c55e; }

.vynaa-dialog-title {
  font-size: 17px;
  font-weight: 700;
  color: #f0f0f0;
  margin: 0 0 8px 0;
}

.vynaa-dialog-msg {
  font-size: 14px;
  color: #777;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.vynaa-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.vynaa-dialog-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.vynaa-dialog-btn.cancel {
  background: rgba(255,255,255,0.06);
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.08);
}
.vynaa-dialog-btn.cancel:hover { background: rgba(255,255,255,0.1); color: #ddd; }

.vynaa-dialog-btn.confirm {
  background: #ff6b35;
  color: #fff;
}
.vynaa-dialog-btn.confirm:hover { background: #ff7f4d; transform: translateY(-1px); }
.vynaa-dialog-btn.confirm.danger { background: #ef4444; }
.vynaa-dialog-btn.confirm.danger:hover { background: #f87171; }

/* ===== PROMPT DIALOG ===== */
.vynaa-dialog-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f0f0f0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 20px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.vynaa-dialog-input:focus { border-color: rgba(255,107,53,0.5); }

@media (max-width: 480px) {
  #vynaa-toast-container { top: 10px; right: 10px; left: 10px; max-width: none; width: auto; }
  .vynaa-dialog-actions { flex-direction: column-reverse; }
  .vynaa-dialog-btn { width: 100%; text-align: center; }
}
