:root {
  --primary: #8b5cf6;
  --accent: #ec4899;
  --bg-dark: #020617;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg-dark);
  color: #f8fafc;
  min-height: 100vh;
}

.gradient-text {
  background: linear-gradient(to right, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title {
  font-size: 4rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.05em;
  margin-bottom: 1.25rem;
  line-height: 1.1;
  text-align: center;
}

.brand-main {
  display: block;
}

.brand-sub {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: normal;
  color: #94a3b8;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.input-container {
  margin-bottom: 2.5rem;
}

.main-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 1.5rem;
  position: sticky;
  top: 0.75rem;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.5);
  transition: all 0.3s ease;
}

.main-input-wrapper:focus-within {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 10px 35px rgba(139, 92, 246, 0.25);
}

.main-input-wrapper textarea,
.main-input-wrapper input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.875rem 1.5rem;
  font-size: 1.5rem;
  color: white;
  min-height: 3.25rem;
  resize: vertical;
  line-height: 1.4;
  font-family: inherit;
  box-sizing: border-box;
}

.main-input-wrapper textarea:focus,
.main-input-wrapper textarea:focus-visible,
.main-input-wrapper input:focus,
.main-input-wrapper input:focus-visible {
  outline: none;
}

.glass-card {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.font-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.toast-popup {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: white;
  color: black;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  font-weight: bold;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
}

.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

footer {
  margin-top: 5rem;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid #1e293b;
  color: #64748b;
}

/* --- Tailwind Replacement Styles (SEO & Speed Optimization) --- */

.main-container {
  max-width: 72rem; /* max-w-6xl */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.info-section {
  max-width: 56rem; /* max-w-4xl */
  margin-left: auto;
  margin-right: auto;
  margin-top: 5rem; /* mt-20 */
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  color: #94a3b8; /* text-slate-400 */
  line-height: 1.625; /* leading-relaxed */
  border-top: 1px solid #0f172a; /* border-slate-900 */
  padding-top: 3rem; /* pt-12 */
}

.info-section h2 {
  font-size: 1.875rem; /* text-3xl */
  font-weight: 700; /* font-bold */
  color: #ffffff;
  margin-bottom: 1.5rem; /* mb-6 */
}

.info-section p {
  margin-bottom: 1rem; /* mb-4 */
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem; /* gap-8 */
  margin-top: 2rem; /* mt-8 */
}

@media (min-width: 768px) {
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* md:grid-cols-2 */
  }
}

.info-grid-title {
  font-size: 1.25rem; /* text-xl */
  font-weight: 600; /* font-semibold */
  margin-bottom: 0.75rem; /* mb-3 */
}

.text-indigo {
  color: #818cf8; /* text-indigo-400 */
}

.text-pink {
  color: #f472b6; /* text-pink-400 */
}

.info-list {
  list-style-type: disc;
  margin-left: 1.25rem; /* ml-5 */
}

.info-list li {
  margin-top: 0.5rem; /* space-y-2 */
}

.faq-card {
  margin-top: 2.5rem; /* mt-10 */
  padding: 1.5rem; /* p-6 */
  background: rgba(15, 23, 42, 0.5); /* bg-slate-900/50 */
  border-radius: 1rem; /* rounded-2xl */
  border: 1px solid #1e293b; /* border-slate-800 */
}

.faq-card h3 {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.5rem; /* mb-2 */
}

.faq-card p {
  font-size: 0.875rem; /* text-sm */
}

/* --- Dynamic Card Replacement CSS --- */

.font-card {
  padding: 1.5rem; /* p-6 */
  border-radius: 1rem; /* rounded-2xl */
  cursor: pointer; /* cursor-pointer */
}

.font-card-header {
  display: flex; /* flex */
  justify-content: space-between; /* justify-between */
  align-items: center; /* items-center */
  margin-bottom: 1rem; /* mb-4 */
}

.font-card-title {
  font-size: 0.625rem; /* text-[10px] */
  font-weight: 700; /* font-bold */
  color: #64748b; /* text-slate-500 */
  text-transform: uppercase; /* uppercase */
  letter-spacing: 0.1em; /* tracking-widest */
  transition: color 0.3s ease;
}

.font-card:hover .font-card-title {
  color: #f472b6; /* group-hover:text-pink-400 */
}

.font-card-copy-btn {
  font-size: 0.625rem; /* text-[10px] */
  color: #94a3b8; /* text-slate-400 */
  opacity: 0; /* opacity-0 */
  transition: opacity 0.3s ease; /* transition-opacity */
}

.font-card:hover .font-card-copy-btn {
  opacity: 1; /* group-hover:opacity-100 */
}

.font-card-body {
  font-size: 1.5rem; /* text-2xl */
  color: #ffffff; /* text-white */
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Input Counter Badge CSS --- */

.counter-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 999px;
  font-size: 0.875rem;
  color: #a78bfa;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 0.5rem;
}

/* --- Phase 2: Interactive Controls & Decorators CSS --- */

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.font-size-control {
  flex-grow: 1;
  max-width: 400px;
}

.font-size-control label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.font-size-control span {
  color: var(--accent);
  font-family: monospace;
}

/* Custom Slider Styling */
#fontSizeSlider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  outline: none;
  cursor: pointer;
}

#fontSizeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  transition: transform 0.1s ease;
}

#fontSizeSlider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-control {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-control:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.btn-control.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

.btn-danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: #f87171;
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.1);
}

/* Quick Decorators CSS */
.decorators-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  margin-top: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.deco-label {
  font-size: 0.825rem;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.deco-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  width: 100%;
}

/* Custom Scrollbar for Chips */
.deco-chips::-webkit-scrollbar {
  height: 4px;
}
.deco-chips::-webkit-scrollbar-track {
  background: transparent;
}
.deco-chips::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

.deco-chips .chip {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 99px;
  padding: 0.35rem 0.85rem;
  font-size: 0.825rem;
  color: #c084fc;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.deco-chips .chip:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Dynamic CSS Variable for Card Resizing */
:root {
  --preview-size: 1.5rem;
}

.font-card-body {
  font-size: var(--preview-size);
}

/* Favorites Button inside cards */
.font-card-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fav-btn {
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: all 0.2s ease;
}

.fav-btn:hover {
  color: #eab308;
  transform: scale(1.2);
}

.is-favorited .fav-btn {
  color: #eab308;
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

.is-favorited {
  border-color: rgba(234, 179, 8, 0.2);
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.05);
}

.is-favorited:hover {
  border-color: #eab308;
  box-shadow: 0 10px 30px rgba(234, 179, 8, 0.15);
}

/* Empty state styling */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

/* --- Mobile Responsive Optimizations & Touch Accessibility --- */

@media (max-width: 768px) {
  .main-container {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .brand-title {
    font-size: clamp(2.25rem, 10vw, 3.5rem);
    margin-bottom: 0.75rem;
  }

  .subtitle {
    font-size: 0.95rem;
    margin-bottom: 2rem;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1rem;
  }

  .font-size-control {
    max-width: 100%;
  }

  .button-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .btn-control {
    justify-content: center;
    padding: 0.75rem 1.25rem; /* Large touch target */
    font-size: 0.95rem;
    border-radius: 0.75rem;
    height: 46px; /* >44px height for accessibility */
  }

  .decorators-bar {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .deco-label {
    font-size: 0.75rem;
  }

  .deco-chips .chip {
    padding: 0.45rem 1rem; /* Better touch target spacing */
    font-size: 0.875rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .font-card {
    padding: 1.25rem;
  }

  .font-card-copy-btn {
    opacity: 0.75;
  }

  .font-card-body {
    font-size: clamp(1.2rem, 5vw, 1.8rem); /* Fluid sizing on mobile */
  }

  .info-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
  }

  /* Expand touch target for favorites button */
  .fav-btn {
    padding: 0.5rem;
    margin: -0.5rem;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 2.25rem;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
  }

  .main-input-wrapper {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    border-radius: 1.25rem;
  }

  .main-input-wrapper textarea,
  .main-input-wrapper input {
    padding: 0.75rem;
    font-size: 1.15rem;
    text-align: left;
  }

  .counter-badge {
    margin-right: 0;
    margin-top: 0.5rem;
    text-align: center;
  }
}

/* --- SEO Internal Navigation Menu CSS --- */

.seo-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.nav-link {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  font-size: 0.875rem;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.1);
}

/* --- Phase 5: Interactive Templates CSS --- */
.templates-section {
  margin-top: 3.5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-desc {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.template-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.template-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 
              0 8px 10px -6px rgba(139, 92, 246, 0.1);
}

.template-text {
  color: #e2e8f0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 1.5rem;
}

.btn-template {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(244, 114, 182, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #e2e8f0;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.template-card:hover .btn-template {
  background: linear-gradient(135deg, #8b5cf6, #f472b6);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* --- Bio Character Counter CSS --- */
.char-counter-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  margin-top: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
  backdrop-filter: blur(12px);
}

.char-counter-container .counter-digits {
  font-weight: 700;
  color: #f8fafc;
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.status-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pill.warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- WhatsApp Native Markdown Helper Bar --- */
.whatsapp-markdown-bar {
  margin-top: 0.75rem;
  padding: 0.85rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.markdown-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.markdown-bar-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #25d366;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.markdown-bar-desc {
  font-size: 0.8rem;
  color: #94a3b8;
}

.markdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-markdown {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 0.5rem;
  color: #f1f5f9;
  font-size: 0.825rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-markdown:hover {
  background: rgba(37, 211, 102, 0.18);
  border-color: #25d366;
  transform: translateY(-1px);
}

.btn-markdown code {
  font-family: monospace;
  color: #4ade80;
  font-size: 0.825rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
}

/* --- Related Style Tools Section --- */
.related-tools-section {
  margin-top: 4rem;
  margin-bottom: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2.5rem;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.related-tool-card {
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.related-tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.18);
}

.related-tool-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.related-tool-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.45;
}

