/* Background presets */
.preview-bg-overlay.brick {
  background: #1c1512;
  background-image:
    linear-gradient(90deg, transparent 50%, rgba(255, 255, 255, .05) 50%),
    linear-gradient(rgba(255, 255, 255, .05) 50%, transparent 50%);
  background-size: 50px 25px;
  opacity: 0.85;
}

.preview-bg-overlay.sand {
  background: radial-gradient(circle at center, #c9b48c 0%, #a08c62 100%);
  opacity: 0.9;
}

.preview-bg-overlay.tree {
  background: repeating-linear-gradient(90deg, #382820, #382820 8px, #241813 8px, #241813 16px);
  opacity: 0.85;
}

.preview-bg-overlay.cosmic {
  background: radial-gradient(circle at center, #160a2a 0%, #03010b 100%);
}

.preview-bg-overlay.cosmic::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffffff 1px, transparent 1px),
    radial-gradient(circle, #ffffff 1.5px, transparent 1.5px);
  background-size: 32px 32px, 64px 64px;
  background-position: 0 0, 16px 24px;
  opacity: 0.25;
  pointer-events: none;
}

.preview-bg-overlay.none {
  background: #171512;
}

/* Text styling states */
.preview-text-container {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1rem;
  user-select: none;
  transition: all 0.3s ease;
  cursor: grab;
}

.preview-text-container span {
  display: inline-block;
  width: max-content;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

/* Font Families */
.preview-text-container.neon {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: 0.15em;
}

.preview-text-container.bubble {
  font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  letter-spacing: -0.01em;
}

.preview-text-container.graffiti {
  font-family: 'Impact', Charcoal, sans-serif;
  font-weight: 900;
  font-size: 2.6rem;
  letter-spacing: -0.04em;
}

.preview-text-container.gothic {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 2.3rem;
  letter-spacing: 0.04em;
}

.preview-text-container.block3d {
  font-family: 'Arial Black', Gadget, sans-serif;
  font-weight: 900;
  font-size: 2.4rem;
  letter-spacing: 0.05em;
}

.preview-text-container.retro {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
}

.preview-text-container.chalk {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.15rem;
  letter-spacing: 0.04em;
}

.preview-text-container.sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
}

.preview-text-container.vintage {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 2.25rem;
  letter-spacing: 0.05em;
}


.preview-text-container.stencil {
  font-family: 'Arial Black', 'Impact', sans-serif;
  font-weight: 900;
  font-size: 2.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.preview-text-container.woodblock {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
}
.preview-text-container.stamp {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 2.0rem;
  letter-spacing: 0.12em;
  /* opacity removed from container; faded ink effect is applied on span only */
}
.preview-text-container.laser {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.15rem;
  letter-spacing: 0.14em;
}
.preview-text-container.fire {
  font-family: 'Impact', Charcoal, sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  letter-spacing: 0.02em;
}
.preview-text-container.ice {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
  font-size: 2.2rem;
  letter-spacing: 0.12em;
}
.preview-text-container.glitch {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
}
.preview-text-container.hologram {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 2.1rem;
  letter-spacing: 0.16em;
}
.preview-text-container.calligraphy {
  font-family: Georgia, 'Palatino Linotype', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2.5rem;
  letter-spacing: 0.02em;
}
.preview-text-container.typewriter {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 400;
  font-size: 1.9rem;
  letter-spacing: 0.1em;
}
.preview-text-container.handwritten {
  font-family: 'Comic Sans MS', cursive;
  font-weight: 400;
  font-style: italic;
  font-size: 2.3rem;
  letter-spacing: 0.03em;
}
.preview-text-container.copperplate {
  font-family: Georgia, serif;
  font-weight: 600;
  font-size: 2.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.preview-text-container.arcade {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.0rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.preview-text-container.art-deco {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: 2.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.preview-text-container.psychedelic {
  font-family: 'Impact', Charcoal, sans-serif;
  font-weight: 900;
  font-size: 2.4rem;
  letter-spacing: -0.02em;
}
.preview-text-container.cutout {
  font-family: 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 2.3rem;
  letter-spacing: 0.04em;
}
.preview-text-container.outline {
  font-family: 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
}
.preview-text-container.condensed {
  font-family: 'Arial Narrow', 'Arial', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  letter-spacing: 0.02em;
}
/* Effect previews for new font styles */
.preview-text-container.laser span {
  color: transparent;
  background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 6px #00ff88) drop-shadow(0 0 12px #00ccff);
}
.preview-text-container.fire span {
  color: #ff6a00;
  text-shadow: 0 0 6px #ffcc00, 0 0 14px #ff6600, 0 0 24px #ff2200, 0 -4px 16px #ffee00;
  animation: lavaPulse 1.5s infinite alternate ease-in-out;
}
.preview-text-container.ice span {
  color: transparent;
  background: linear-gradient(180deg, #e8f8ff 0%, #a8dcf0 40%, #5ab0d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(120, 200, 255, 0.8)) drop-shadow(1px 2px 2px rgba(0,0,0,0.4));
}
.preview-text-container.glitch span {
  color: #fff;
  text-shadow: 2px 0 #ff0040, -2px 0 #00ffe1;
  animation: glitchShift 0.8s infinite steps(1);
}
@keyframes glitchShift {
  0%   { text-shadow:  2px 0 #ff0040, -2px 0 #00ffe1; }
  25%  { text-shadow: -2px 0 #ff0040,  2px 0 #00ffe1; }
  50%  { text-shadow:  1px 0 #ff0040, -3px 0 #00ffe1; }
  75%  { text-shadow: -3px 0 #ff0040,  1px 0 #00ffe1; }
  100% { text-shadow:  2px 0 #ff0040, -2px 0 #00ffe1; }
}
.preview-text-container.hologram span {
  color: transparent;
  background: linear-gradient(90deg, #ff80ab, #ea80fc, #80d8ff, #a7ffeb, #ccff90, #ff80ab);
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(160, 200, 255, 0.6));
  animation: hologramShift 3s linear infinite;
}
@keyframes hologramShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.preview-text-container.stamp span {
  color: rgba(180, 60, 40, 0.82);
  text-shadow: none;
  filter: blur(0.4px) contrast(1.2);
}
.preview-text-container.woodblock span {
  color: #d4a96a;
  text-shadow: 2px 2px 0px #3d200a, 1px 1px 0px #6b3a12;
  filter: contrast(1.1) saturate(0.9);
}
.preview-text-container.stencil span {
  color: #c8c2b0;
  text-shadow: none;
  filter: contrast(1.3) brightness(0.95);
}
.preview-text-container.outline span {
  color: transparent;
  -webkit-text-stroke: 2px var(--da-accent, #c8912a);
}
.preview-text-container.art-deco span {
  color: transparent;
  background: linear-gradient(180deg, #f5e6c3 0%, #c8912a 50%, #f5e6c3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 1px 0px rgba(0,0,0,0.8));
}
.preview-text-container.psychedelic span {
  color: transparent;
  background: linear-gradient(45deg, #ff0080, #ff8800, #ffff00, #00ff80, #0080ff, #8000ff);
  background-size: 300%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: hologramShift 2s linear infinite;
}
.preview-text-container.copperplate span {
  color: transparent;
  background: linear-gradient(135deg, #c8a97a 0%, #8c6524 50%, #e0c88a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(1px 1px 0px rgba(0,0,0,0.7));
}
.preview-text-container.calligraphy span {
  color: #ecdcc0;
  text-shadow: 1px 2px 4px rgba(0,0,0,0.6);
}
.preview-text-container.typewriter span {
  color: #c8bfa4;
  text-shadow: 0.5px 0.5px 0 rgba(0,0,0,0.5);
  filter: contrast(1.1);
}
.preview-text-container.handwritten span {
  color: #d4bfa0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}
.preview-text-container.arcade span {
  color: #ffff00;
  text-shadow: 0 0 6px #ffff00, 0 0 12px #ff8800, 2px 2px 0 #aa5500;
}
.preview-text-container.cutout span {
  color: #f0e8d8;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #333;
  filter: contrast(1.2);
}
.preview-text-container.condensed span {
  color: var(--text-primary, #e8dcc8);
  text-shadow: 1px 2px 4px rgba(0,0,0,0.6);
}

/* Color Finishes */
.preview-text-container.chrome-finish span {
  color: transparent;
  background: linear-gradient(to bottom, #ffffff 0%, #aaaaaa 40%, #111111 50%, #dcdcdc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.8));
}

.preview-text-container.gold-finish span {
  color: transparent;
  background: linear-gradient(135deg, #ffe57f 0%, #c8912a 45%, #7e560f 55%, #ffe082 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.7));
}

.preview-text-container.gradient-finish span {
  color: transparent;
  background: linear-gradient(90deg, #ff007f 0%, #00f0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0px 2px 8px rgba(0, 240, 255, 0.25));
}

.preview-text-container.pastel-finish span {
  color: transparent;
  background: linear-gradient(to right, #ffb3ba, #ffdfba, #ffffba, #baffc9, #bae1ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.preview-text-container.lava-finish span {
  color: #ff3300;
  text-shadow: 0 0 8px #ff6600, 0 0 16px #ff3300, 0 0 24px #7f0000;
  animation: lavaPulse 1.8s infinite alternate ease-in-out;
}

.preview-text-container.monochrome-finish span {
  color: #ffffff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: 2px 2px 0px #000000;
}

@keyframes lavaPulse {
  0% {
    text-shadow: 0 0 6px #ff6600, 0 0 12px #ff3300, 0 0 20px #7f0000;
    filter: brightness(0.9);
  }

  100% {
    text-shadow: 0 0 14px #ffaa00, 0 0 24px #ff3300, 0 0 35px #b30000;
    filter: brightness(1.25);
  }
}

/* Font styles (like neon glowing effect) */
/* For gradient finishes the span color is `transparent` (background-clip text),
   so currentColor would resolve to transparent and kill the glow.
   We explicitly set a visible glow colour for each gradient finish case. */
.preview-text-container.neon.chrome-finish span {
  color: #cccccc; /* restore visible color so currentColor works */
  filter: drop-shadow(0 0 8px #cccccc);
}
.preview-text-container.neon.gold-finish span {
  color: #c8912a;
  filter: drop-shadow(0 0 8px #c8912a);
}
.preview-text-container.neon.gradient-finish span {
  color: #00f0ff;
  filter: drop-shadow(0 0 8px #00f0ff);
}
.preview-text-container.neon.pastel-finish span {
  color: #ffb3ba;
  filter: drop-shadow(0 0 8px #ffb3ba);
}

.preview-text-container.neon.lava-finish span {
  color: #ff3300;
  filter: drop-shadow(0 0 8px #ff6600);
  animation: lavaPulse 1.8s infinite alternate ease-in-out;
}

.preview-text-container.neon.monochrome-finish span {
  color: #ffffff;
  text-shadow: 0 0 5px #ffffff, 0 0 12px rgba(255, 255, 255, 0.7);
}

/* Materials / Textures */
.preview-text-container.glass-material span,
.preview-text-container.glass-material text {
  opacity: 0.9;
  filter: url(#glassFilter) drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.5));
}

.preview-text-container.candy-material span,
.preview-text-container.candy-material text {
  filter: url(#candyFilter) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
}

.preview-text-container.fluffy-material span,
.preview-text-container.fluffy-material text {
  filter: url(#fluffyFilter) drop-shadow(0 0 3px rgba(200, 145, 42, 0.4));
}

.preview-text-container.wood-material span,
.preview-text-container.wood-material text {
  filter: url(#woodFilter) drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.7));
}

.preview-text-container.stone-material span,
.preview-text-container.stone-material text {
  filter: url(#stoneFilter) drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.8));
}

.preview-text-container.botanical-material span,
.preview-text-container.botanical-material text {
  filter: url(#botanicalFilter);
}

.preview-text-container.clouds-material span,
.preview-text-container.clouds-material text {
  filter: url(#cloudsFilter) opacity(0.9);
}

/* Geometry Arrangements */
.preview-text-container.diagonal span {
  transform: rotate(-12deg);
}

.preview-text-container.stacked span {
  line-height: 1.1;
  font-size: 1.85rem;
}

/* Layout overrides for SVG */
.preview-text-container.curved svg,
.preview-text-container.wavy svg,
.preview-text-container.circular svg {
  overflow: visible;
}

.preview-text-container svg text {
  font-family: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

/* --- New Font Style & Design Options --- */

/* Playful Cartoon / Comic */
.preview-text-container.cartoon {
  font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
  font-weight: 900;
  font-size: 2.65rem;
  letter-spacing: 0.02em;
}
.preview-text-container.cartoon span {
  color: #ffeb3b;
  -webkit-text-stroke: 2px #000000;
  text-shadow: 4px 4px 0px #e91e63, 6px 6px 0px #000000;
}

/* Industrial Steampunk Brass */
.preview-text-container.steampunk {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 800;
  font-size: 2.3rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.preview-text-container.steampunk span {
  color: transparent;
  background: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(2px 2px 0px #2a1b0c) drop-shadow(4px 4px 4px rgba(0,0,0,0.85));
  -webkit-text-stroke: 0.5px #5c4314;
}

/* Cyberpunk Tech Outline */
.preview-text-container.cyberpunk {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: skewX(-8deg);
}
.preview-text-container.cyberpunk span {
  color: #f7f700;
  text-shadow: 2px 2px 0px #00ff66, -2px -2px 0px #ff007f, 0px 0px 8px rgba(247,247,0,0.6);
  background: rgba(14, 13, 11, 0.7);
  padding: 0.2rem 0.6rem;
  border: 2px solid #ff007f;
  clip-path: polygon(0 0, 95% 0, 100% 30%, 100% 100%, 5% 100%, 0 70%);
}

/* Liquid Mercury / Chrome Melt */
.preview-text-container.liquid-metal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: 0.05em;
}
.preview-text-container.liquid-metal span {
  color: transparent;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #8a9ba8 55%, #1b2126 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.75)) contrast(1.4) brightness(1.25);
}

/* Ghostly Ethereal Spirit */
.preview-text-container.spectral {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 300;
  font-size: 2.25rem;
  letter-spacing: 0.15em;
  font-style: italic;
}
.preview-text-container.spectral span {
  color: rgba(200, 255, 240, 0.35);
  text-shadow: 0 0 10px rgba(0, 255, 200, 0.8), 0 0 20px rgba(0, 255, 200, 0.4), 0 0 35px rgba(0, 150, 255, 0.7);
  animation: spectralFloat 3s infinite alternate ease-in-out;
}
@keyframes spectralFloat {
  0% { filter: blur(0.5px); transform: translateY(0px) scale(1); }
  100% { filter: blur(1.5px); transform: translateY(-6px) scale(1.04); }
}

/* Victorian Editorial Engraving */
.preview-text-container.victorian {
  font-family: Georgia, serif;
  font-weight: 600;
  font-size: 2.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.preview-text-container.victorian span {
  color: #2b2318;
  text-shadow: 1px 1px 0px #dfd0be, -1px -1px 0px #000000;
  border-bottom: 2px double #2b2318;
  padding-bottom: 3px;
}

/* Old English Medieval Blackletter */
.preview-text-container.medieval {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 900;
  font-size: 2.35rem;
  letter-spacing: 0.04em;
}
.preview-text-container.medieval span {
  color: #a31d1d;
  text-shadow: 2px 2px 0px #000, 0px 0px 8px rgba(163,29,29,0.5);
  border-left: 4px solid #a31d1d;
  padding-left: 8px;
}

/* Vaporwave Glitch / Sunset */
.preview-text-container.vaporwave {
  font-family: 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 2.5rem;
  letter-spacing: 0.12em;
}
.preview-text-container.vaporwave span {
  color: transparent;
  background: linear-gradient(to bottom, #ff71ce 0%, #01cdfe 50%, #05ffa1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(3px 3px 0px #b967ff);
}

/* Synthwave Grid / Chrome */
.preview-text-container.synthwave {
  font-family: 'Impact', Charcoal, sans-serif;
  font-weight: 900;
  font-size: 2.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-style: italic;
}
.preview-text-container.synthwave span {
  color: transparent;
  background: linear-gradient(to bottom, #2b0f54 0%, #ff007f 55%, #ffff00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px #ff0055;
  filter: drop-shadow(0 0 10px #ff007f) drop-shadow(2px 2px 0px #000);
}

/* Brutalist Concrete Block */
.preview-text-container.brutalist {
  font-family: 'Arial Black', 'Impact', sans-serif;
  font-weight: 900;
  font-size: 2.6rem;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.preview-text-container.brutalist span {
  color: #dfdfdf;
  background: #000000;
  padding: 0.2rem 0.8rem;
  border: 4px solid #000000;
  box-shadow: 8px 8px 0px #555555;
}

/* Futuristic Sci-Fi Monospace */
.preview-text-container.futuristic {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 2.1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.preview-text-container.futuristic span {
  color: #39b54a;
  text-shadow: 0 0 5px #39b54a, 0 0 12px rgba(57,181,74,0.4);
  border-right: 2px solid #39b54a;
  padding-right: 4px;
  animation: blinkCursor 1s step-end infinite;
}
@keyframes blinkCursor {
  from, to { border-color: transparent }
  50% { border-color: #39b54a; }
}

/* --- New Text Layout Arrangement Options --- */

/* Perspective Depth Projection */
.preview-text-container.perspective {
  perspective: 400px;
}
.preview-text-container.perspective span {
  transform: rotateY(-22deg) rotateX(12deg);
}

/* Star Wars Scrolling Scroll */
.preview-text-container.perspective-up {
  perspective: 200px;
}
.preview-text-container.perspective-up span {
  transform: rotateX(25deg);
}

/* Stepped Staircase Skew */
.preview-text-container.staircase span {
  transform: skewY(-5deg);
}

/* Jittered / Scattered Letters */
.preview-text-container.scattered span {
  letter-spacing: 0.35em;
  word-spacing: 0.5em;
}

/* Reflected Mirror Symmetry */
.preview-text-container.reflected {
  position: relative;
}
.preview-text-container.reflected span {
  -webkit-box-reflect: below -4px linear-gradient(transparent 35%, rgba(255,255,255,0.22) 100%);
}

/* --- New Material & Core Texture Options --- */

/* Viscous Dripping Slime */
.preview-text-container.liquid-material span,
.preview-text-container.liquid-material text {
  filter: url(#liquidFilter) drop-shadow(0 4px 4px rgba(0,255,0,0.3));
}

/* Brushed Industrial Steel */
.preview-text-container.metal-material span,
.preview-text-container.metal-material text {
  filter: url(#metalFilter) brightness(0.9) contrast(1.25);
}

/* Faceted Sparkling Diamond */
.preview-text-container.diamond-material span,
.preview-text-container.diamond-material text {
  filter: url(#diamondFilter);
}

/* Folded Origami Papercraft */
.preview-text-container.paper-material span,
.preview-text-container.paper-material text {
  filter: url(#paperFilter);
}

/* Tufted Stitched Leather */
.preview-text-container.leather-material span,
.preview-text-container.leather-material text {
  filter: url(#leatherFilter);
}

/* Polished Carrara Marble */
.preview-text-container.marble-material span,
.preview-text-container.marble-material text {
  filter: url(#marbleFilter);
}

/* Iridescent Foil Sheet */
.preview-text-container.holographic-material span,
.preview-text-container.holographic-material text {
  filter: url(#holographicFilter);
}

/* Glossy Inflatable Vinyl */
.preview-text-container.plastic-material span,
.preview-text-container.plastic-material text {
  filter: url(#plasticFilter) saturate(1.45) contrast(1.3);
}

/* Typography Custom Font Style Dialog Styles */
#customStyleModal .modal-dialog,
#manageStylesModal .modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
}

#customStyleModal .modal-header,
#manageStylesModal .modal-header {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-subtle);
}

#customStyleModal .modal-footer,
#manageStylesModal .modal-footer {
  background: rgba(14, 13, 11, 0.25);
  border-top: 1px solid var(--border-subtle);
}

#customStyleModal .modal-title,
#manageStylesModal .modal-title {
  color: var(--da-accent);
  font-family: var(--font-serif);
}

#customStyleModal .modal-close-btn,
#manageStylesModal .modal-close-btn {
  color: var(--text-muted);
  transition: color 0.2s;
}

#customStyleModal .modal-close-btn:hover,
#manageStylesModal .modal-close-btn:hover {
  color: var(--text-primary);
}

/* Scrollbar styling for modal content */
.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track {
  background: rgba(14, 13, 11, 0.3);
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--da-accent-dim);
}

/* Group container styling inside modal */
.modal-content .form-field {
  margin-bottom: 0.75rem;
}

/* Custom style slider track and thumb */
.modal-content input[type="range"] {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  appearance: none;
  outline: none;
}

.modal-content input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--da-accent);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.modal-content input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--text-primary);
  transform: scale(1.15);
}

.modal-content input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--da-accent);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.modal-content input[type="range"]::-moz-range-thumb:hover {
  background: var(--text-primary);
  transform: scale(1.15);
}

/* Checkbox alignment */
.modal-content input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--da-accent);
  cursor: pointer;
}

/* Advanced SVG definition styling */
#customStyleDefs {
  background: rgba(10, 9, 8, 0.95);
  border: 1px solid var(--border-mid);
  color: #c8bfa4;
  padding: 0.5rem;
  border-radius: 4px;
}

/* Hide Custom builder buttons on smartphone layouts */
@media (max-width: 768px) {
  #createCustomStyleBtn,
  #manageCustomStylesBtn {
    display: none !important;
  }
}

.custom-style-manager-label {
  transition: color 0.2s ease;
}
.custom-style-manager-label:hover {
  color: var(--da-accent, #c8912a) !important;
  text-decoration: underline;
}

/* Layout transforms for standard CSS previews */
.preview-text-container.diagonal span {
  transform: rotate(-12deg);
}
.preview-text-container.perspective span {
  transform: skewX(-15deg) scale(0.9, 1);
}
.preview-text-container.perspective-up span {
  transform: skewX(-5deg) scale(1, 0.85);
}
.preview-text-container.staircase span {
  transform: skewY(-6deg);
}
.preview-text-container.reflected {
  -webkit-box-reflect: below -15px linear-gradient(transparent 30%, rgba(255,255,255,0.18));
}