:root {
  /* Vibrant Brand Colors */
  --primary: #ee4d2d;
  --primary-hover: #f16144;
  --primary-glow: rgba(238, 77, 45, 0.4);

  --fb: #1877f2;
  --yt: #ff0000;

  /* Status Colors */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --error: #ef4444;

  /* Glassmorphism UI Theme */
  --bg-dark: #0f172a;
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-focus: rgba(238, 77, 45, 0.5);

  /* Dynamic Shadows */
  --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 0 40px rgba(238, 77, 45, 0.08);
  --btn-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);

  /* Typography */
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-light: #9ca3af;

  --font-body: 'Be Vietnam Pro', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  /* Premium CSS gradient */
  background: linear-gradient(-45deg, #ffe0d8, #fff1eb, #fadee0, #fff);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Background floating shapes */
.bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 22s infinite alternate ease-in-out;
}

.shape-1 {
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: rgba(238, 77, 45, 0.2);
  top: -10%;
  left: -10%;
}

.shape-2 {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: rgba(24, 119, 242, 0.15);
  bottom: -10%;
  right: -5%;
  animation-delay: -5s;
}

.shape-3 {
  width: 30vw;
  height: 30vw;
  max-width: 400px;
  max-height: 400px;
  background: rgba(255, 0, 0, 0.1);
  top: 40%;
  left: 50%;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  50% {
    transform: translate(80px, 40px) scale(1.1) rotate(10deg);
  }

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

/* Main Container */
.container {
  width: 100%;
  max-width: 560px;
  padding: 24px;
  z-index: 1;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: var(--card-shadow);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.12), 0 0 50px rgba(238, 77, 45, 0.1);
}

/* Header Area */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 180px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #ffa37c);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px var(--primary-glow);
}

.title-wrap h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--text-main);
}

.title-wrap .highlight {
  color: var(--primary);
}

.title-wrap .subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Platform Mode Selector */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  background: transparent;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.mode-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  z-index: 2;
}

.fb-brand {
  color: var(--fb);
}

.yt-brand {
  color: var(--yt);
}

.mode-btn span {
  z-index: 2;
}

.mode-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  border-radius: 14px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.mode-btn:hover::before {
  opacity: 0.5;
  transform: scale(1);
}

.mode-btn.is-active {
  color: var(--text-main);
}

.mode-btn.is-active::before {
  opacity: 1;
  transform: scale(1);
}

.mode-btn.is-active .fb-brand {
  background: var(--fb);
  color: white;
  box-shadow: 0 6px 14px rgba(24, 119, 242, 0.3);
}

.mode-btn.is-active .yt-brand {
  background: var(--yt);
  color: white;
  box-shadow: 0 6px 14px rgba(255, 0, 0, 0.3);
}

/* Input Area */
.input-group {
  margin-bottom: 24px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  padding-left: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 20px;
  color: var(--text-light);
  display: flex;
  transition: color 0.3s ease;
}

.main-input {
  width: 100%;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 0 64px 0 52px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-main);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01), 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.main-input:focus {
  outline: none;
  border-color: var(--glass-border-focus);
  background: white;
  box-shadow: 0 0 0 4px var(--primary-glow), 0 8px 25px rgba(0, 0, 0, 0.04);
}

.main-input:focus~.input-icon {
  color: var(--primary);
}

.main-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

/* Paste Button */
.action-btn.paste {
  position: absolute;
  right: 10px;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-dark);
  color: white;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.action-btn.paste:hover {
  background: var(--primary);
  transform: scale(1.08) translateY(-1px);
  box-shadow: 0 8px 15px var(--primary-glow);
}

.action-btn.paste:active {
  transform: scale(0.95);
}

/* Actions Grid Grid */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

@media (min-width: 480px) {
  .actions-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  border: none;
  border-radius: 18px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Convert Button */
.btn-primary.primary-action {
  background: linear-gradient(135deg, var(--primary), #ffa37c);
  color: white;
  box-shadow: 0 10px 25px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary.primary-action::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    left: -100%;
  }

  20% {
    left: 200%;
  }

  100% {
    left: 200%;
  }
}

.btn-primary.primary-action:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px var(--primary-glow);
  background: linear-gradient(135deg, var(--primary-hover), #ffa37c);
}

.btn-primary.primary-action:not(:disabled):active {
  transform: translateY(1px);
}

/* Secondary Actions (Copy/Open) */
.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 479px) {
  .secondary-actions {
    margin-top: -4px;
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-main);
  box-shadow: var(--btn-shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.btn-secondary:not(:disabled):hover {
  background: white;
  transform: translateY(-2px);
  border-color: var(--glass-border-focus);
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* JS Hooks */
.is-ready {
  background: linear-gradient(135deg, var(--success), #34d399) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 10px 25px var(--success-glow) !important;
  animation: bouncePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bouncePop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

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

.is-ready:hover {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  transform: translateY(-2px) !important;
}

/* Result Area */
.result-box {
  background: rgba(255, 255, 255, 0.85);
  border: 1px dashed rgba(200, 200, 200, 0.8);
  border-radius: 20px;
  padding: 20px;
  min-height: 90px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.01);
}

.result-box:has(.ready) {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: white;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.08);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.result-dot {
  width: 10px;
  height: 10px;
  background: var(--text-light);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-box:has(.ready) .result-dot {
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  transform: scale(1.2);
}

.result-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.result-content {
  position: relative;
}

.result-text {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
  word-break: break-all;
  display: block;
  font-weight: 500;
}

.result-text.placeholder {
  color: var(--text-light);
  font-style: italic;
  font-family: var(--font-body);
}

.result-text.ready {
  color: var(--primary);
  font-weight: 700;
  animation: slideUpFade 0.4s ease forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.result-text.masked {
  filter: blur(5px);
  user-select: none;
  transition: filter 0.3s ease;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 4px;
}

.result-text.masked:hover {
  filter: blur(0);
}

/* Status Messaging */
.status-wrap {
  margin-top: 18px;
  text-align: center;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-msg {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s;
}

.status-msg.ok {
  color: var(--success);
}

.status-msg.err {
  color: var(--error);
}

.status-msg.source-fb {
  color: var(--fb);
}

.status-msg.source-yt {
  color: var(--yt);
}

/* Mobile Optimizations */
@media (max-width: 500px) {
  .container {
    padding: 16px;
  }

  .glass-card {
    padding: 28px 20px;
    border-radius: 24px;
  }

  .title-wrap h1 {
    font-size: 22px;
  }

  .mode-btn {
    padding: 12px 8px;
    font-size: 14px;
  }
}

/* ─── Instructions Box ───────────────────────────────────────────────── */
.instructions-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 18px 20px 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

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

.instructions-box h6 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.instructions-box h6 .icon-fb {
  color: var(--fb);
}

.instructions-box h6 .icon-yt {
  color: var(--yt);
}

.instructions-box ol {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.instructions-box ol li {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.5;
}

.instructions-box ol li::before {
  content: counter(step);
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.instructions-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.instructions-link {
  max-width: 70%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--fb);
  color: var(--fb);
  background: rgba(24, 119, 242, 0.06);
  text-decoration: none;
  transition: all 0.2s ease;
}

.instructions-link:hover {
  background: var(--fb);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.25);
}

.instructions-image {
  width: auto;
  max-width: 50%;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
}

.instructions-image-fb {
  max-width: 90%;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
}