/* ==========================================================================
   CoreUtils Web Suite - Ultra-Premium Animated Glassmorphism Design System
   Dual-Theme Engine (Light & Dark) | Zero Purple/Violet | WCAG AAA
   Sticky Frosted Glass Navbar, Perfect RTL/LTR Symmetry, Jakarta Brand Identity
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Core Brand Tokens (100% Purple-Free) */
  --emerald-primary: #10b981;
  --emerald-hover: #059669;
  --emerald-active: #047857;
  --emerald-subtle: rgba(16, 185, 129, 0.12);
  --emerald-glow: rgba(16, 185, 129, 0.32);

  --teal-accent: #14b8a6;
  --teal-subtle: rgba(20, 184, 166, 0.16);

  /* Light Theme (Vibrant Frosted Mint & Pearlescent Glass) */
  --bg-main: #f4faf6;
  --bg-mesh: radial-gradient(at 15% 15%, rgba(16, 185, 129, 0.16) 0px, transparent 55%),
    radial-gradient(at 85% 20%, rgba(20, 184, 166, 0.18) 0px, transparent 50%),
    radial-gradient(at 50% 85%, rgba(14, 165, 233, 0.14) 0px, transparent 60%);

  --orb-1: rgba(16, 185, 129, 0.25);
  --orb-2: rgba(20, 184, 166, 0.22);
  --orb-3: rgba(14, 165, 233, 0.18);

  --navbar-bg: rgba(244, 250, 246, 0.82);
  --surface-card: rgba(255, 255, 255, 0.85);
  --surface-card-border: rgba(226, 232, 240, 0.95);
  --surface-secondary: rgba(248, 250, 252, 0.9);
  --surface-hover: rgba(235, 243, 238, 0.95);

  --border-card: #e2e8f0;
  --border-focus: #10b981;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-text: #059669;
  /* High-contrast readable green on light surfaces */
  --accent-badge-bg: rgba(16, 185, 129, 0.12);
  --accent-badge-border: rgba(16, 185, 129, 0.30);

  --card-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8);
  --card-glow: 0 0 45px rgba(16, 185, 129, 0.08);

  --tab-bar-bg: rgba(241, 245, 249, 0.9);
  --tab-slider-bg: #0f172a;
  --tab-active-text: #ffffff;

  --chip-danger-bg: #fee2e2;
  --chip-danger-text: #b91c1c;
}

/* Dark Theme (Deep Obsidian & Cyber Emerald Luminous Glass) */
[data-theme="dark"] {
  --bg-main: #06090e;
  --bg-mesh: radial-gradient(at 15% 15%, rgba(16, 185, 129, 0.18) 0px, transparent 50%),
    radial-gradient(at 85% 25%, rgba(15, 118, 110, 0.24) 0px, transparent 55%),
    radial-gradient(at 50% 85%, rgba(6, 182, 212, 0.18) 0px, transparent 60%);

  --orb-1: rgba(16, 185, 129, 0.25);
  --orb-2: rgba(15, 118, 110, 0.32);
  --orb-3: rgba(6, 182, 212, 0.20);

  --navbar-bg: rgba(6, 9, 14, 0.80);
  --surface-card: rgba(15, 23, 42, 0.72);
  --surface-card-border: rgba(51, 65, 85, 0.65);
  --surface-secondary: rgba(30, 41, 59, 0.7);
  --surface-hover: rgba(51, 65, 85, 0.75);

  --border-card: rgba(51, 65, 85, 0.6);
  --border-focus: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-text: #34d399;
  /* Vibrant readable green on dark surfaces */
  --accent-badge-bg: rgba(16, 185, 129, 0.10);
  --accent-badge-border: rgba(16, 185, 129, 0.20);

  --card-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --card-glow: 0 0 60px rgba(16, 185, 129, 0.14);

  --tab-bar-bg: rgba(30, 41, 59, 0.8);
  --tab-slider-bg: var(--emerald-primary);
  --tab-active-text: #ffffff;

  --chip-danger-bg: rgba(239, 68, 68, 0.2);
  --chip-danger-text: #f87171;
}

/* Dynamic Accent Text Utility */
.text-brand-accent {
  color: var(--accent-text);
}

.bg-brand-badge {
  background-color: var(--accent-badge-bg);
  border-color: var(--accent-badge-border);
  color: var(--accent-text);
}

/* Brand Name Jakarta Font Constraint (Strictly English & Arabic) */
.brand-name-jakarta,
html[dir="rtl"] .brand-name-jakarta,
html[dir="ltr"] .brand-name-jakarta,
body .brand-name-jakarta,
header .brand-name-jakarta,
footer .brand-name-jakarta,
h1.brand-name-jakarta,
span.brand-name-jakarta {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: 0.015em !important;
}

/* Smooth Theme Switching Transitions */
html.theme-transitioning,
html.theme-transitioning * {
  transition: background-color 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Transparent Tap Highlight on Mobile Browsers */
*,
*::before,
*::after,
html,
body,
button,
a,
input,
textarea,
select,
[role="button"],
[role="tab"] {
  -webkit-tap-highlight-color: transparent !important;
}

/* Typography Base (English & Global) */
html {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Premium Apple & Google Arabic Typography (SF Arabic / Noto Sans Arabic / IBM Plex Sans Arabic) */
html[dir="rtl"] {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Arabic", "SF Arabic", "Noto Sans Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  letter-spacing: 0 !important;
}

/* Strictly prevent letter-spacing / uppercase from breaking Arabic cursive script */
html[dir="rtl"] *,
html[dir="rtl"] [class*="tracking-"],
html[dir="rtl"] .uppercase {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[dir="rtl"] p,
html[dir="rtl"] label,
html[dir="rtl"] span,
html[dir="rtl"] button:not(.theme-toggle-solid):not(#themeToggleBtn):not(.lang-switch-btn):not(.sample-link-btn) {
  line-height: 1.6;
}

h1,
h2,
h3,
.font-display {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

html[dir="rtl"] h1:not(.brand-name-jakarta),
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .font-display {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Arabic", "SF Arabic", "Noto Sans Arabic", "IBM Plex Sans Arabic", sans-serif;
  font-weight: 700;
  letter-spacing: 0 !important;
  line-height: 1.45;
}

/* ==========================================================================
   Animated Gradient Glassmorphism Background (Light & Dark)
   ========================================================================== */
body {
  background-color: var(--bg-main);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ultra-Premium Sticky Frosted Glass Navbar - Strictly Stationary While Only Body Scrolls */
.navbar-glass {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Specular bottom hairline glow for navbar */
.navbar-glass::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.45) 50%, transparent 100%);
  pointer-events: none;
}

/* Ambient Floating Luminous Mesh Orbs */
.ambient-glow-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  will-change: transform;
  pointer-events: none;
}

.ambient-orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
  top: -140px;
  left: 8%;
  animation: floatOrb1 16s ease-in-out infinite alternate;
}

.ambient-orb-2 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
  bottom: -180px;
  right: 5%;
  animation: floatOrb2 20s ease-in-out infinite alternate;
}

.ambient-orb-3 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%);
  top: 35%;
  left: 55%;
  animation: floatOrb3 14s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(70px, 50px) scale(1.12);
  }

  100% {
    transform: translate(-50px, 90px) scale(0.92);
  }
}

@keyframes floatOrb2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-80px, -60px) scale(1.18);
  }

  100% {
    transform: translate(40px, -100px) scale(0.9);
  }
}

@keyframes floatOrb3 {
  0% {
    transform: translate(0, 0) scale(0.9);
  }

  50% {
    transform: translate(-60px, 70px) scale(1.15);
  }

  100% {
    transform: translate(50px, -50px) scale(1);
  }
}

/* ==========================================================================
   Frosted Glassmorphism Panels
   ========================================================================== */
.glass-panel {
  position: relative;
  background: var(--surface-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--surface-card-border);
  box-shadow: var(--card-shadow), var(--card-glow);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}

/* Top Specular Edge Highlight */
.glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.45) 50%, transparent 100%);
  pointer-events: none;
}

/* ==========================================================================
   Redesigned Luxury Minimalist Language Switcher
   ========================================================================== */
.lang-switcher-modern {
  position: relative;
  background: var(--surface-secondary);
  border: 1px solid var(--border-card);
  border-radius: 9999px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lang-switch-btn {
  position: relative;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1;
}

.lang-switch-btn:hover {
  color: var(--text-primary);
}

.lang-switch-btn.active {
  color: #ffffff;
  background: #0f172a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .lang-switch-btn.active {
  background: var(--emerald-primary);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Solid Premium Tactile Theme Switcher (Desktop & Mobile)
   ========================================================================== */
.theme-toggle-solid,
html[dir="rtl"] .theme-toggle-solid,
#themeToggleBtn,
html[dir="rtl"] #themeToggleBtn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 0.85rem;
  background: var(--surface-secondary);
  border: 1.5px solid var(--border-card);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  outline: none;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  direction: ltr !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.theme-toggle-solid:hover {
  background: var(--surface-hover);
  border-color: rgba(16, 185, 129, 0.45);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.theme-toggle-solid:active {
  transform: translateY(0) scale(0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .theme-toggle-solid {
  background: #111a2c;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .theme-toggle-solid:hover {
  background: #172338;
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .theme-toggle-solid {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .theme-toggle-solid:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.3);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.theme-toggle-solid #themeIcon,
html[dir="rtl"] .theme-toggle-solid #themeIcon,
#themeIcon,
html[dir="rtl"] #themeIcon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 1.25rem !important;
  height: 1.25rem !important;
  font-size: 1.15rem !important;
  vertical-align: middle !important;
  text-align: center !important;
  transform-origin: center center !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}

/* ==========================================================================
   Sliding Tab Capsule Navigation (Flawless LTR & RTL Support)
   ========================================================================== */
.tab-container {
  position: relative;
  background: var(--tab-bar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 1.15rem;
  padding: 5px;
  display: flex;
}

/* Sliding active background indicator using inset-inline-start */
.tab-slider-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: calc(50% - 5px);
  inset-inline-start: 5px;
  background: var(--tab-slider-bg);
  border-radius: 0.85rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.32);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 1;
}

/* Tab 2 active state */
.tab-container.tab-second-active .tab-slider-indicator {
  transform: translateX(100%);
}

html[dir="rtl"] .tab-container.tab-second-active .tab-slider-indicator {
  transform: translateX(-100%);
}

.tab-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 11px 18px;
  border-radius: 0.85rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: transparent;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tab-btn {
    padding: 10px 10px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .tab-btn i {
    font-size: 1rem;
  }
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--tab-active-text);
}

/* ==========================================================================
   Smooth Option Transition (Cross-slide Panels)
   ========================================================================== */
.panel-transition {
  animation: panelSlideFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes panelSlideFade {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Premium URL Result Reveal Animation
   ========================================================================== */
.result-reveal-anim {
  animation: resultRevealPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes resultRevealPop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
    filter: blur(6px);
  }

  60% {
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Luminous Glow Flare on Result Output */
.output-glow-box {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
}

.output-glow-box::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 1.1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.5), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.result-reveal-anim .output-glow-box::after {
  animation: glowPulseOnce 1.2s ease-out forwards;
}

@keyframes glowPulseOnce {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.85;
    transform: scale(1.005);
  }

  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* Speed Stat Flash Pulse */
.speed-flash-anim {
  animation: neonFlash 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes neonFlash {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.8);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.7);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Language Morph Transition */
.lang-morph-anim {
  animation: langMorph 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes langMorph {
  0% {
    opacity: 0.4;
    filter: blur(4px);
    transform: scale(0.99);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

/* Theme Toggle Animation */
.theme-spin-icon {
  animation: themeIconSpin 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes themeIconSpin {
  0% {
    transform: rotate(-180deg) scale(0.4);
    opacity: 0;
  }

  100% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Inputs & Form Controls (Strict LTR Direction for URLs & Phone Codes)
   ========================================================================== */
.custom-input {
  background: var(--surface-secondary);
  border: 1.5px solid var(--border-card);
  color: var(--text-primary);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 1rem;
}

.custom-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px var(--emerald-glow);
  background: var(--surface-card);
}

/* Clean URL input must always remain LTR with copy button pinned on the right */
.input-clean-url,
html[dir="rtl"] .input-clean-url {
  direction: ltr !important;
  text-align: left !important;
  padding-right: 8.5rem !important;
  padding-left: 1rem !important;
}

/* Raw URL textarea LTR text-align */
#inputUrl {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;
}

html[dir="rtl"] #inputUrl::placeholder {
  direction: rtl !important;
  text-align: right !important;
}

/* Phone input */
#inputPhone {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;
}

html[dir="rtl"] #inputPhone::placeholder {
  direction: rtl !important;
  text-align: right !important;
}

/* Action Buttons */
.btn-primary {
  background: var(--emerald-primary);
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.95rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--emerald-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.42);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  background: var(--emerald-active);
}

.btn-secondary {
  background: var(--surface-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: 0.95rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--accent-text);
  transform: translateY(-1.5px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* Top bar paste button (outside textarea) */
.btn-top-paste {
  background: var(--surface-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-top-paste:hover {
  background: var(--emerald-subtle);
  border-color: var(--emerald-primary);
  color: var(--accent-text);
  transform: translateY(-1px);
}

/* Dedicated Clean URL Header Actions (Open Link & Copy Link) */
.btn-clean-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  font-size: 0.775rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border-radius: 0.65rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  user-select: none;
  vertical-align: middle;
}

.btn-clean-open {
  background: var(--surface-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}

.btn-clean-open:hover {
  background: var(--surface-hover);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-clean-open:active {
  transform: translateY(0) scale(0.97);
}

.btn-clean-copy {
  background: var(--emerald-primary);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.28);
}

.btn-clean-copy:hover {
  background: var(--emerald-hover);
  border-color: rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.42);
}

.btn-clean-copy:active {
  transform: translateY(0) scale(0.97);
  background: var(--emerald-active);
}

/* Recent Number Chips */
.recent-chip {
  background: var(--surface-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 7px 15px;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.recent-chip span,
html[dir="rtl"] .recent-chip span {
  direction: ltr !important;
  unicode-bidi: isolate;
  display: inline-block;
}

.recent-chip:hover {
  background: var(--emerald-subtle);
  border-color: var(--emerald-primary);
  color: var(--accent-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
}

/* Parameter Stripped Badges */
.param-chip {
  background: var(--chip-danger-bg);
  color: var(--chip-danger-text);
  padding: 5px 12px;
  border-radius: 9999px;
  font-family: ui-monospace, monospace;
  font-size: 0.775rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  animation: popChip 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popChip {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Status Pulse Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald-primary);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 290px;
  max-width: 440px;
  background: #0b1120;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 18px;
  border-radius: 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.925rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: toastSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-success {
  border-inline-start: 4px solid var(--emerald-primary);
}

.toast.toast-error {
  border-inline-start: 4px solid #ef4444;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Custom Ultra-Thin Scrollbars (3px Minimalist Precision - Universal Desktop & Mobile) */
html,
body,
* {
  scrollbar-width: thin !important;
  scrollbar-color: var(--border-card) transparent !important;
}

::-webkit-scrollbar {
  width: 3px !important;
  height: 3px !important;
  -webkit-appearance: none !important;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: var(--border-card) !important;
  border-radius: 9999px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted) !important;
}

/* ==========================================================================
   Inline Form Field Interactive Validation & Micro-interactions
   ========================================================================== */
.inline-field-feedback {
  margin-top: 0.4rem;
  font-size: 0.775rem;
  font-weight: 500;
  line-height: 1.4;
  display: none;
  align-items: center;
  gap: 0.45rem;
  border-radius: 0.5rem;
  transition: all 0.22s ease;
}

.inline-field-feedback.show {
  display: flex;
}

.inline-field-feedback.feedback-valid {
  color: #10b981;
}

.inline-field-feedback.feedback-invalid {
  color: #f43f5e;
}

.custom-input.input-valid {
  border-color: rgba(16, 185, 129, 0.8) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16) !important;
}

.custom-input.input-invalid {
  border-color: rgba(244, 63, 94, 0.8) !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18) !important;
}

/* Shake Animation when invalid submit occurs */
.shake-field {
  animation: shakeFieldAnim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeFieldAnim {

  0%,
  100% {
    transform: translateX(0);
  }

  15%,
  45%,
  75% {
    transform: translateX(-5px);
  }

  30%,
  60%,
  90% {
    transform: translateX(5px);
  }
}

/* ==========================================================================
   Sample Links Grid (Desktop row, Mobile 2 cols x 2 rows)
   ========================================================================== */
.sample-links-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sample-links-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.sample-links-grid {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sample-link-btn {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  background: var(--surface-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.sample-link-btn:hover {
  background: var(--emerald-subtle);
  border-color: var(--emerald-primary);
  color: var(--accent-text);
  transform: translateY(-1px);
}

.sample-link-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Mobile-First Responsive System & Minimized Spacing
   ========================================================================== */
footer {
  margin-top: auto;
  padding-bottom: max(1.2rem, calc(0.65rem + env(safe-area-inset-bottom, 10px))) !important;
}

/* Luxury Frosted Glass Footer Capsule Badge (Desktop & Mobile) */
.footer-glass-pill {
  background: var(--surface-card);
  border: 1px solid var(--surface-card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
  max-width: 95vw;
}

.footer-glass-pill:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.footer-dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--emerald-primary);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  flex-shrink: 0;
}

.footer-shield-text {
  font-size: 0.775rem;
  letter-spacing: -0.01em;
}

/* Mobile & Tablet Styles (<= 640px) */
@media (max-width: 640px) {

  /* Minimized padding for main body and footer on mobile */
  #mainAppContent {
    padding-top: 0.85rem !important;
    padding-bottom: 0.5rem !important;
  }

  footer {
    padding-top: 0.25rem !important;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 8px)) !important;
  }

  .footer-glass-pill {
    padding: 6px 12px !important;
    gap: 8px !important;
  }

  .footer-shield-text {
    font-size: 0.7rem !important;
    line-height: 1.35;
  }

  /* Sample Links 2 cols x 2 rows on Mobile */
  .sample-links-block {
    width: 100%;
    margin-top: 0.6rem;
    display: block;
  }

  .sample-links-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.75rem;
  }

  .sample-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
    width: 100%;
  }

  .sample-link-btn {
    width: 100%;
    padding: 0.45rem 0.5rem;
    font-size: 0.72rem;
    text-align: center;
    border-radius: 0.6rem;
  }

  /* Navbar */
  .navbar-glass {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .navbar-glass .brand-name-jakarta {
    font-size: 1.15rem !important;
  }

  /* Language Switcher & Theme Control */
  .lang-switcher-modern {
    padding: 2px;
  }

  .lang-switch-btn {
    padding: 5px 9px;
    font-size: 0.72rem;
    gap: 3px;
  }

  #themeToggleBtn,
  .theme-toggle-solid,
  html[dir="rtl"] #themeToggleBtn,
  html[dir="rtl"] .theme-toggle-solid {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 0.85rem !important;
  }

  /* Glass Panels */
  .glass-panel {
    padding: 1.25rem !important;
    border-radius: 1.25rem;
  }

  /* Tab Capsule */
  .tab-container {
    margin-bottom: 1.25rem;
    padding: 3.5px;
    border-radius: 1rem;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 0.775rem;
    gap: 5px;
  }

  .tab-btn i {
    font-size: 0.95rem;
  }

  /* Action Buttons */
  .btn-primary:not(.btn-clean-action),
  .btn-secondary:not(.btn-clean-action) {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.85rem;
  }

  /* Clean URL input on mobile - full width with comfortable padding */
  .input-clean-url,
  html[dir="rtl"] .input-clean-url {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.775rem !important;
  }
}

/* Ultra-compact screens (<= 380px) */
@media (max-width: 380px) {
  .navbar-glass .brand-name-jakarta {
    font-size: 1.05rem !important;
  }

  .lang-switch-btn {
    padding: 4px 7px;
    font-size: 0.675rem;
  }


  .tab-btn {
    padding: 7px 6px;
    font-size: 0.725rem;
  }
}