/*
 * Forum Theme - Unified Dialog/Toast UI
 * Provides: themeAlert/themeConfirm/themePrompt/themeToast
 */

:root{
  --td-overlay: rgba(15,23,42,.45);
  --td-bg: var(--bg-primary, #fff);
  --td-text: var(--text-primary, #0f172a);
  --td-muted: var(--text-secondary, #475569);
  --td-border: var(--border-color, #e5e7eb);
  --td-shadow: 0 24px 60px rgba(15,23,42,.22);
  --td-radius: 20px;
  --td-primary: var(--primary-color, #3b82f6);
  --td-primary-dark: var(--primary-dark, #2563eb);
  --td-danger: var(--error, #ef4444);
  --td-success: var(--success, #10b981);
  --td-warning: var(--warning, #f59e0b);
}

.theme-dialog-overlay{
  position:fixed;inset:0;
  background:var(--td-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display:flex;align-items:center;justify-content:center;
  z-index:100000;
  padding:16px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.theme-dialog-overlay.show{opacity:1;pointer-events:auto}

.theme-dialog{
  width:100%;
  max-width:480px;
  background:var(--td-bg);
  border-radius:var(--td-radius);
  box-shadow:var(--td-shadow);
  overflow:hidden;
  transform:translateY(12px) scale(.985);
  transition:transform .18s ease;
  border:1px solid color-mix(in srgb, var(--td-border) 85%, transparent);
}
.theme-dialog-overlay.show .theme-dialog{transform:translateY(0) scale(1)}

.theme-dialog-header{padding:18px 22px 10px;display:flex;align-items:center;gap:12px}
.theme-dialog-icon{
  width:42px;height:42px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#dbeafe,#bfdbfe);
  color:var(--td-primary);
  font-size:22px;
  flex-shrink:0;
}
.theme-dialog-icon.is-danger{background:linear-gradient(135deg,#fee2e2,#fecaca);color:var(--td-danger)}
.theme-dialog-icon.is-success{background:linear-gradient(135deg,#dcfce7,#bbf7d0);color:var(--td-success)}
.theme-dialog-icon.is-warning{background:linear-gradient(135deg,#fef3c7,#fde68a);color:var(--td-warning)}

.theme-dialog-title{margin:0;font-size:18px;font-weight:750;color:var(--td-text)}
.theme-dialog-body{padding:0 22px 18px;color:var(--td-muted);font-size:15px;line-height:1.8;word-break:break-word}
.theme-dialog-body p{margin:0}

.theme-dialog-input{
  width:100%;
  margin-top:12px;
  padding:12px 14px;
  border:1px solid var(--td-border);
  border-radius:12px;
  background: color-mix(in srgb, var(--td-bg) 92%, #f8fafc);
  color:var(--td-text);
  font-size:14px;
}
.theme-dialog-input:focus{outline:none;border-color:var(--td-primary);box-shadow:0 0 0 3px color-mix(in srgb, var(--td-primary) 16%, transparent)}

.theme-dialog-footer{
  padding:16px 22px 22px;
  display:flex;
  justify-content:flex-end;
  gap:12px;
  background:linear-gradient(180deg,rgba(248,250,252,0),#f8fafc);
}

.theme-dialog-btn{
  min-width:96px;height:42px;
  border:none;border-radius:12px;
  font-size:14px;font-weight:650;
  cursor:pointer;
  transition:transform .12s ease, filter .12s ease, background .12s ease;
}
.theme-dialog-btn:active{transform:translateY(1px)}

.theme-dialog-btn.cancel{background:#e2e8f0;color:#334155}
.theme-dialog-btn.cancel:hover{filter:brightness(.96)}

.theme-dialog-btn.confirm{background:linear-gradient(135deg,var(--td-primary),var(--td-primary-dark));color:#fff;box-shadow:0 10px 22px rgba(37,99,235,.22)}
.theme-dialog-btn.confirm:hover{filter:brightness(1.02)}

.theme-dialog-btn.danger{background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;box-shadow:0 10px 22px rgba(239,68,68,.18)}
.theme-dialog-btn.danger:hover{filter:brightness(1.02)}

/* Responsive */
@media (max-width:640px){
  .theme-dialog{max-width:100%;border-radius:18px}
  .theme-dialog-header{padding:16px 18px 8px}
  .theme-dialog-body{padding:0 18px 16px}
  .theme-dialog-footer{padding:14px 18px 18px}
  .theme-dialog-btn{flex:1}
}

/* Toast */
.theme-toast-wrap{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:100001;display:flex;flex-direction:column;gap:10px;pointer-events:none;padding:0 12px;width:min(520px, calc(100% - 24px));}
.theme-toast{
  pointer-events:auto;
  display:flex;align-items:flex-start;gap:10px;
  padding:12px 14px;
  border-radius:14px;
  background:var(--td-bg);
  border:1px solid var(--td-border);
  box-shadow:0 18px 40px rgba(15,23,42,.14);
  opacity:0;
  transform:translateY(-10px);
  transition:opacity .18s ease, transform .18s ease;
}
.theme-toast.show{opacity:1;transform:translateY(0)}
.theme-toast-icon{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:18px;background:#eff6ff;color:var(--td-primary)}
.theme-toast-icon.is-success{background:#ecfdf5;color:var(--td-success)}
.theme-toast-icon.is-warning{background:#fffbeb;color:var(--td-warning)}
.theme-toast-icon.is-error{background:#fef2f2;color:var(--td-danger)}
.theme-toast-body{flex:1;min-width:0}
.theme-toast-title{font-size:13px;font-weight:700;color:var(--td-text);margin:0 0 2px 0}
.theme-toast-text{font-size:13px;line-height:1.55;color:var(--td-muted);margin:0;word-break:break-word}
.theme-toast-close{width:28px;height:28px;border-radius:10px;border:none;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.theme-toast-close:hover{background:color-mix(in srgb, var(--td-border) 40%, transparent);color:#475569}
