/**
 * Printive AI — UI Feedback System Styles
 * Version: 3.0.0
 * Design: Dark Purple / Glassmorphic Theme Alignment
 * =====================================================
 */

/* 1. STANDARDIZED LOADER BOX OVERRIDE & TEXT TRANSITION */
.printive-loader,
#apiMockupLoading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 36px 24px;
  margin: 20px auto;
  max-width: 580px;
  background: var(--pv-card, #ffffff);
  border: 1px solid var(--pv-border, rgba(51, 65, 85, 0.25));
  border-radius: var(--pv-radius-lg, 20px);
  box-shadow: var(--pv-shadow-glow, 0 0 40px rgba(51, 65, 85, 0.2));
  text-align: center;
  transition: opacity 0.3s ease;
}

.printive-loader.visible,
#apiMockupLoading.visible {
  display: flex !important;
}

.loader-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--pv-text, #334155);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

/* Smooth eye-friendly typewriter / crossfade effect container */
.loader-subtitle-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.loader-subtitle,
.pv-step-guide {
  font-size: 14px;
  color: var(--pv-text-muted, #475569);
  line-height: 1.5;
  transition: opacity 0.5s ease-in-out;
  opacity: 1;
}

.pv-step-guide.fade-out {
  opacity: 0 !important;
}

/* 2. PROGRESS BAR THEME STYLING */
.pv-progress-container {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  overflow: hidden;
  margin: 8px auto 4px;
  border: 1px solid var(--pv-border, rgba(51, 65, 85, 0.25));
}

.pv-progress-bar {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, var(--pv-primary, #334155), var(--pv-accent, #045CB4));
  border-radius: 20px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--pv-accent, #045CB4);
}

/* 3. FLOATING GLASSMORPHIC TOAST NOTIFICATION CONTAINER */
#pv-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  pointer-events: none;
}

.pv-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--pv-card, #ffffff);
  border-left: 5px solid var(--pv-primary, #334155);
  border-top: 1px solid var(--pv-border, rgba(51, 65, 85, 0.25));
  border-right: 1px solid var(--pv-border, rgba(51, 65, 85, 0.25));
  border-bottom: 1px solid var(--pv-border, rgba(51, 65, 85, 0.25));
  border-radius: var(--pv-radius, 14px);
  box-shadow: var(--pv-shadow, 0 8px 32px rgba(0, 0, 0, 0.08)), var(--pv-shadow-glow, 0 0 40px rgba(51, 65, 85, 0.2));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--pv-text, #334155);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.pv-toast.pv-toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pv-toast.pv-toast-hide {
  opacity: 0;
  transform: translateX(100%) scale(0.9);
}

/* Toast types aligned with theme palette */
.pv-toast.pv-success { border-left-color: var(--pv-success, #10B981); }
.pv-toast.pv-error   { border-left-color: var(--pv-error, #EF4444); }
.pv-toast.pv-warning { border-left-color: var(--pv-warning, #F59E0B); }
.pv-toast.pv-info    { border-left-color: var(--pv-accent, #045CB4); }

.pv-toast-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pv-toast-title {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
}

.pv-toast-msg {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

/* 4. GLASSMORPHIC MODAL DIALOG (REPLACES NATIVE ALERT) */
.pv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pv-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.pv-modal-card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 26px 24px;
  text-align: left;
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.pv-modal-backdrop.active .pv-modal-card {
  transform: translateY(0);
}

.pv-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.pv-modal-body {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 22px;
}

.pv-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.pv-btn-dismiss {
  padding: 9px 18px;
  border-radius: 8px;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pv-btn-dismiss:hover {
  background: #E2E8F0;
  color: #0F172A;
  border-color: #94A3B8;
}

.pv-btn-primary {
  padding: 10px 22px;
  border-radius: 8px;
  background: #334155;
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3);
}

.pv-btn-primary:hover {
  background: #1E293B;
  box-shadow: 0 6px 16px rgba(51, 65, 85, 0.45);
}

@media (max-width: 480px) {
  #pv-toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: none;
  }
}

/* =====================================================
   5. UNIFIED INLINE STATUS & NOTIFICATION BANNERS
   (Universal standard across Form Generator, Editor, & Mockup Studio)
   ===================================================== */
.pv-status-banner,
.printive-status,
.editor-status,
.mockup-status {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  margin-top: 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  box-sizing: border-box;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.pv-status-banner.visible,
.printive-status.visible,
.editor-status.visible,
.mockup-status.visible,
.mockup-status.error,
.editor-status.error,
.editor-status.active {
  display: flex !important;
  animation: pvStatusSlideIn 0.25s ease-out;
}

@keyframes pvStatusSlideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SUCCESS: Soft mint with crisp forest green text */
.pv-status-banner.success,
.printive-status.success,
.editor-status.success,
.mockup-status.success {
  background: #ECFDF5 !important;
  color: #065F46 !important;
  border: 1px solid #A7F3D0 !important;
  border-left: 4px solid #10B981 !important;
}

/* ERROR: Soft rose with crisp deep crimson text */
.pv-status-banner.error,
.printive-status.error,
.editor-status.error,
.mockup-status.error {
  background: #FEF2F2 !important;
  color: #991B1B !important;
  border: 1px solid #FECACA !important;
  border-left: 4px solid #EF4444 !important;
}

/* INFO / NOTICE: Soft ice blue with deep navy text */
.pv-status-banner.info,
.printive-status.info,
.editor-status.info,
.mockup-status.info {
  background: #F0F7FF !important;
  color: #1E3A8A !important;
  border: 1px solid #BFDBFE !important;
  border-left: 4px solid #045CB4 !important;
}

/* WARNING: Soft cream amber with deep amber text */
.pv-status-banner.warning,
.printive-status.warning,
.editor-status.warning,
.mockup-status.warning {
  background: #FFFBEB !important;
  color: #92400E !important;
  border: 1px solid #FDE68A !important;
  border-left: 4px solid #F59E0B !important;
}

/* LOADING / PROCESSING: Soft slate pulse */
.pv-status-banner.loading,
.printive-status.loading,
.editor-status.loading,
.mockup-status.loading {
  background: #F8FAFC !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
  border-left: 4px solid #64748B !important;
}

/* =====================================================
   6. UNIFIED SUCCESS CONFIRMATION CARDS
   (Matching the Mockup Studio Cart Confirmation Card)
   ===================================================== */
.pv-success-card,
.mockup-success-card {
  display: none;
  background: #ffffff !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 14px !important;
  padding: 24px 20px !important;
  color: #334155 !important;
  text-align: center !important;
  margin-top: 18px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  box-sizing: border-box !important;
  animation: pvStatusSlideIn 0.3s ease-out;
}

.pv-success-card.visible,
.mockup-success-card.visible {
  display: block !important;
}

.pv-success-card h3,
.mockup-success-card h3 {
  color: #1E293B !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  margin: 10px 0 8px 0 !important;
  letter-spacing: -0.2px;
}

.pv-success-card p,
.mockup-success-card p {
  font-size: 13.5px !important;
  color: #475569 !important;
  margin: 0 auto 16px auto !important;
  line-height: 1.55 !important;
  max-width: 380px;
}

.pv-success-card .pv-success-icon,
.mockup-success-card .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #10B981;
  font-size: 24px;
  margin-bottom: 8px;
}

