/* ===================================================
   SpinShop-IDNC — GLOBAL POPUP COMPONENT
   File: /assets/css/popup.css
   Pengganti alert() / confirm() / warning native browser.
   Hitam + emas, elegant.
   =================================================== */

:root{
  --sp-gold: #d4af37;
  --sp-gold-light: #f5d77e;
  --sp-gold-dark: #a08220;
  --sp-bg: #0a0a0a;
  --sp-panel: #141414;
  --sp-panel-2: #1d1d1d;
  --sp-border: #2a2a2a;
  --sp-text: #f4f4f4;
  --sp-text-dim: #aaa;
  --sp-danger: #e23838;
  --sp-success: #2bb673;
  --sp-warning: #f59e0b;
  --sp-info: #3b82f6;
}

/* ============ POPUP BACKDROP ============ */
.sp-popup-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .22s ease;
}
.sp-popup-backdrop.show{
  display: flex;
  opacity: 1;
}

/* ============ POPUP BOX ============ */
.sp-popup{
  background: linear-gradient(180deg, var(--sp-panel) 0%, var(--sp-panel-2) 100%);
  border: 1px solid var(--sp-border);
  border-radius: 16px;
  padding: 0;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(212,175,55,0.12);
  color: var(--sp-text);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  transform: scale(0.92) translateY(8px);
  transition: transform .25s cubic-bezier(.2,.9,.3,1);
  overflow: hidden;
  position: relative;
}
.sp-popup-backdrop.show .sp-popup{
  transform: scale(1) translateY(0);
}

.sp-popup-head{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 12px;
}
.sp-popup-icon{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.sp-popup-icon.success{ background: rgba(43,182,115,0.16); color: var(--sp-success); }
.sp-popup-icon.error  { background: rgba(226,56,56,0.16);  color: var(--sp-danger);  }
.sp-popup-icon.warning{ background: rgba(245,158,11,0.16); color: var(--sp-warning); }
.sp-popup-icon.info   { background: rgba(59,130,246,0.16); color: var(--sp-info);    }
.sp-popup-icon.confirm{ background: rgba(212,175,55,0.16); color: var(--sp-gold);    }

.sp-popup-title{
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--sp-text);
}
.sp-popup-body{
  padding: 4px 24px 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--sp-text-dim);
}
.sp-popup-body b, .sp-popup-body strong { color: var(--sp-text); }
.sp-popup-body p { margin: 0 0 10px; }
.sp-popup-body p:last-child { margin-bottom: 0; }

.sp-popup-actions{
  display: flex;
  gap: 10px;
  padding: 14px 24px 22px;
  flex-wrap: wrap;
}
.sp-popup-btn{
  flex: 1;
  min-width: 110px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 0;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
  font-family: inherit;
  letter-spacing: 0.2px;
}
.sp-popup-btn:active{ transform: scale(.97); }

.sp-popup-btn-primary{
  background: linear-gradient(180deg, var(--sp-gold-light), var(--sp-gold) 60%, var(--sp-gold-dark));
  color: #1a1a0a;
  box-shadow: 0 6px 18px rgba(212,175,55,0.28);
}
.sp-popup-btn-primary:hover{ filter: brightness(1.08); box-shadow: 0 8px 22px rgba(212,175,55,0.42); }

.sp-popup-btn-secondary{
  background: #2a2a2a;
  color: var(--sp-text);
  border: 1px solid var(--sp-border);
}
.sp-popup-btn-secondary:hover{ background: #333; }

.sp-popup-btn-danger{
  background: linear-gradient(180deg, #ff5757, var(--sp-danger));
  color: #fff;
}
.sp-popup-btn-danger:hover{ filter: brightness(1.08); }

.sp-popup-close{
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 0;
  color: var(--sp-text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}
.sp-popup-close:hover{ background: rgba(255,255,255,0.12); color: var(--sp-text); }

/* ============ TOAST (right-bottom non-blocking) ============ */
.sp-toast-wrap{
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
}
.sp-toast{
  background: var(--sp-panel);
  border: 1px solid var(--sp-border);
  border-left: 3px solid var(--sp-gold);
  border-radius: 10px;
  padding: 12px 16px 12px 14px;
  color: var(--sp-text);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .22s ease, transform .22s cubic-bezier(.2,.9,.3,1);
  min-width: 240px;
}
.sp-toast.show{ opacity: 1; transform: translateX(0); }
.sp-toast.success{ border-left-color: var(--sp-success); }
.sp-toast.error  { border-left-color: var(--sp-danger); }
.sp-toast.warning{ border-left-color: var(--sp-warning); }
.sp-toast.info   { border-left-color: var(--sp-info); }

.sp-toast-icon{
  width: 22px;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.1;
}
.sp-toast-body{ flex: 1; }
.sp-toast-title{ font-weight: 700; margin-bottom: 2px; }
.sp-toast-msg{ color: var(--sp-text-dim); font-size: 12.5px; }
.sp-toast-close{
  background: none;
  border: 0;
  color: var(--sp-text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  font-family: inherit;
}

@media (max-width: 600px){
  .sp-popup{ max-width: 100%; }
  .sp-toast-wrap{ left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .sp-popup-head{ padding: 18px 18px 8px; gap: 12px; }
  .sp-popup-body{ padding: 4px 18px 16px; }
  .sp-popup-actions{ padding: 12px 18px 18px; }
}
