/* Modernized Interactive PURL Sandbox Widget Styles */
/* 100% Token-backed, zero hardcoded hexes, zero !important rules */

.ep-sandbox-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  background: linear-gradient(135deg, var(--ep-brand-primary, #2a296c) 0%, var(--ep-color-slate-900, #1e1d50) 100%);
  color: var(--ep-white, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-right: none;
  border-radius: var(--ep-radius-lg, 12px) 0 0 var(--ep-radius-lg, 12px);
  width: 44px;
  height: 200px;
  cursor: pointer;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Standalone campaign-builder entry point. Kept here so legacy pages that
   already load the sandbox component inherit the same polished treatment. */
.ep-demo-builder-link { text-decoration: none; }
.ep-demo-builder-card .ep-sandbox-header { padding-bottom: 16px; }
.ep-demo-builder-badge {
  display: inline-block;
  margin-bottom: 10px;
  color: #1788b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
.ep-demo-builder-benefits {
  margin: 18px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.ep-demo-builder-benefits li {
  position: relative;
  margin: 9px 0;
  padding-left: 25px;
  color: #3f4960;
  font-size: 13px;
  line-height: 1.45;
}
.ep-demo-builder-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #211f57;
  background: #51c6fe;
  text-align: center;
  line-height: 18px;
  font-weight: 900;
}
.ep-demo-builder-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.ep-demo-builder-note {
  margin: 11px 0 0;
  color: #6f7789;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.ep-sandbox-tab:hover {
  transform: translateY(-50%) translateX(-4px);
  box-shadow: -6px 0 30px rgba(37, 170, 225, 0.25);
  background: linear-gradient(135deg, var(--ep-color-slate-800, #35338a) 0%, var(--ep-brand-primary, #2a296c) 100%);
}

.ep-sandbox-tab.ep-sandbox--hidden {
  right: -50px;
  pointer-events: none;
  opacity: 0;
}

.ep-sandbox-tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ep-space-2, 8px);
  color: var(--ep-white, #ffffff);
}

.ep-sandbox-tab-icon {
  transform: rotate(90deg);
  color: var(--ep-white, #ffffff);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
  display: inline-block;
  width: 14px;
  height: 14px;
}

.ep-sandbox-tab-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Modal Container */
.ep-sandbox-modal {
  position: fixed;
  right: 24px;
  bottom: 24px;
  top: auto;
  left: auto;
  width: 350px;
  height: auto;
  max-width: calc(100vw - 48px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--ep-radius-2xl, 20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 9998;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.ep-sandbox-modal.ep-sandbox--hidden {
  transform: translateY(40px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Close Button */
.ep-sandbox-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  color: var(--ep-color-text-muted, #64748b);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 20;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.ep-sandbox-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ep-brand-primary, #2a296c);
  transform: rotate(90deg);
}

/* Steps Layout */
.ep-sandbox-step {
  padding: var(--ep-space-7, 28px) var(--ep-space-6, 24px);
  display: none;
  flex-direction: column;
  gap: var(--ep-space-5, 20px);
  width: 100%;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.ep-sandbox-step.ep-sandbox-step--active {
  display: flex;
}

.ep-sandbox-header {
  background: transparent;
  padding: 0;
  text-align: left;
  float: none;
  width: 100%;
  height: auto;
}

.ep-sandbox-header-inner {
  padding: 0;
  float: none;
  text-align: left;
}

.ep-sandbox-header-inner h3 {
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: var(--ep-font-size-xl, 20px);
  font-weight: 800;
  color: var(--ep-brand-primary, #2a296c);
  margin: 0 0 var(--ep-space-1, 4px) 0;
  letter-spacing: -0.02em;
  line-height: var(--ep-line-height-tight, 1.2);
  text-transform: none;
}

.ep-sandbox-header-inner p {
  font-family: var(--ep-type-body-family, sans-serif);
  font-size: var(--ep-font-size-sm, 13px);
  color: var(--ep-color-text-muted, #64748b);
  margin: 0;
  line-height: var(--ep-line-height-relaxed, 1.4);
}

.ep-sandbox-body {
  display: flex;
  flex-direction: column;
  gap: var(--ep-space-4, 16px);
  width: 100%;
}

/* Inputs */
.ep-sandbox-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--ep-space-2, 6px);
  width: 100%;
}

.ep-sandbox-input-group label {
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: var(--ep-font-size-xs, 11px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ep-brand-primary, #2a296c);
  text-align: left;
  margin: 0;
}

.ep-sandbox-input-group input {
  width: 100%;
  padding: var(--ep-space-3, 12px) var(--ep-space-4, 14px);
  border: 1.5px solid var(--ep-color-border-muted, #e2e8f0);
  border-radius: var(--ep-radius-md, 10px);
  font-family: var(--ep-type-body-family, sans-serif);
  font-size: var(--ep-font-size-base, 14px);
  color: var(--ep-color-text, #1e293b);
  background: var(--ep-color-surface-subtle, #f8fafc);
  transition: all 0.2s ease;
  box-sizing: border-box;
  height: auto;
}

.ep-sandbox-input-group input:focus {
  border-color: var(--ep-brand-accent, #25aae1);
  background: var(--ep-white, #ffffff);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 170, 225, 0.15);
}

/* Live Preview Card */
.ep-sandbox-preview-card {
  background: var(--ep-color-slate-900, #0f172a);
  border-radius: var(--ep-radius-lg, 12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  width: 100%;
}

.ep-sandbox-preview-header {
  background: var(--ep-color-slate-800, #1e293b);
  padding: var(--ep-space-2, 8px) var(--ep-space-3, 12px);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ep-sandbox-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.ep-sandbox-preview-dot:nth-child(1) { background: var(--ep-color-error, #ef4444); }
.ep-sandbox-preview-dot:nth-child(2) { background: var(--ep-color-warning, #f59e0b); }
.ep-sandbox-preview-dot:nth-child(3) { background: var(--ep-color-success, #10b981); }

.ep-sandbox-preview-title {
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: var(--ep-font-size-xs, 10px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ep-color-slate-400, #94a3b8);
  margin-left: auto;
}

.ep-sandbox-preview-content {
  padding: var(--ep-space-4, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}

.ep-sandbox-preview-url {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--ep-font-size-lg, 15px);
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-all;
  text-align: center;
}

.ep-sandbox-preview-name {
  color: var(--ep-brand-accent, #25aae1);
  text-shadow: 0 0 8px rgba(37, 170, 225, 0.3);
  transition: all 0.15s ease;
}

.ep-sandbox-preview-domain {
  color: var(--ep-color-slate-400, #94a3b8);
}

/* Buttons */
.ep-sandbox-btn-primary {
  width: 100%;
  padding: var(--ep-space-3, 14px);
  background: var(--ep-brand-primary, #2a296c);
  color: var(--ep-white, #ffffff);
  border: none;
  border-radius: var(--ep-radius-md, 10px);
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: var(--ep-font-size-base, 14px);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ep-space-2, 8px);
  height: auto;
  line-height: 1.2;
}

.ep-sandbox-btn-primary:hover:not(:disabled) {
  background: var(--ep-color-slate-900, #1e1d50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 41, 108, 0.2);
}

.ep-sandbox-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.ep-sandbox-btn-primary:disabled {
  background: var(--ep-color-slate-300, #cbd5e1);
  color: var(--ep-color-slate-400, #94a3b8);
  cursor: not-allowed;
  box-shadow: none;
}

.ep-sandbox-btn-secondary {
  width: 100%;
  padding: var(--ep-space-3, 12px);
  background: var(--ep-color-surface-soft, #f1f5f9);
  color: var(--ep-brand-primary, #2a296c);
  border: 1px solid var(--ep-color-border-muted, #e2e8f0);
  border-radius: var(--ep-radius-md, 10px);
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: var(--ep-font-size-sm, 13px);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  height: auto;
  line-height: 1.2;
}

.ep-sandbox-btn-secondary:hover {
  background: var(--ep-color-border-muted, #e2e8f0);
  color: var(--ep-color-slate-900, #1e1d50);
}

/* Form Styles */
.ep-sandbox-form {
  display: flex;
  flex-direction: column;
  gap: var(--ep-space-3, 14px);
  width: 100%;
  margin: 0;
}

.ep-sandbox-form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--ep-space-3, 12px);
  width: 100%;
}

.ep-sandbox-error-message {
  font-family: var(--ep-type-body-family, sans-serif);
  font-size: var(--ep-font-size-xs, 12px);
  color: var(--ep-color-error, #ef4444);
  background: var(--ep-color-error-bg, #fef2f2);
  border: 1px solid var(--ep-color-error-bg-subtle, #fee2e2);
  padding: var(--ep-space-2, 10px);
  border-radius: var(--ep-radius-sm, 8px);
  line-height: 1.4;
  text-align: left;
}

/* Success State */
.ep-sandbox-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ep-color-success-bg, #ecfdf5);
  color: var(--ep-color-success, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--ep-space-2, 8px) auto;
}

.ep-sandbox-success-icon svg {
  width: 28px;
  height: 28px;
}

.ep-sandbox-success-text {
  font-family: var(--ep-type-body-family, sans-serif);
  font-size: var(--ep-font-size-base, 14px);
  color: var(--ep-color-text, #334155);
  line-height: 1.5;
  margin: 0;
}

.ep-sandbox-success-purl-box {
  background: var(--ep-color-success-bg-subtle, #f0fdf4);
  border: 1.5px dashed var(--ep-color-success-border, #a7f3d0);
  border-radius: var(--ep-radius-lg, 12px);
  padding: var(--ep-space-3, 14px);
  margin: var(--ep-space-2, 8px) 0;
  width: 100%;
  box-sizing: border-box;
}

.ep-sandbox-success-link {
  font-family: var(--ep-type-heading-family, sans-serif);
  font-size: var(--ep-font-size-lg, 16px);
  font-weight: 800;
  color: var(--ep-color-success-text, #059669);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ep-sandbox-success-link:hover {
  color: var(--ep-color-success-text-hover, #047857);
  transform: scale(1.02);
}

.ep-sandbox-link-icon svg {
  width: 14px;
  height: 14px;
}

.ep-sandbox-success-subtext {
  font-family: var(--ep-type-body-family, sans-serif);
  font-size: var(--ep-font-size-xs, 12px);
  color: var(--ep-color-text-muted, #64748b);
  line-height: 1.5;
  margin: 0 0 var(--ep-space-2, 8px) 0;
}

.ep-sandbox-text-center {
  text-align: center;
}

/* Responsive Adjustments */
@media screen and (max-width: 640px) {
  .ep-sandbox-tab {
    display: none; /* Hide floating tab on mobile to avoid clutter */
  }
  
  .ep-sandbox-modal {
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
    border-radius: var(--ep-radius-xl, 16px);
  }
  
  .ep-sandbox-step {
    padding: var(--ep-space-5, 20px) var(--ep-space-4, 16px);
  }
}

/* Inline placement for conversion-focused landing pages. */
.ep-sandbox-modal.ep-sandbox-modal--embedded {
  position: relative;
  inset: auto;
  z-index: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.ep-sandbox-modal--embedded .ep-sandbox-step {
  padding: 8px 0 0;
}
