/* ==========================================================
   FANCY TEXT GENERATOR — CSS Stylesheet
   Designed under the purple/lavender glassmorphism system
   70% Width Single-Column Dashboard Layout
   ========================================================== */

/* ── Container Layout ── */
.fancy-text-main {
  min-height: calc(100vh - 70px - 100px);
  background: var(--gradient-hero-bg);
  padding-top: 0;
  padding-bottom: 4rem;
}



.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--purple-500);
}

.back-link svg,
.back-link .icon {
  width: 14px;
  height: 14px;
}

/* ── Input Card ── */
.sticky-input-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.sticky-input-card:focus-within {
  border-color: var(--purple-400);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.08);
}

/* ── Textarea Styling ── */
.textarea-container {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.textarea-container:focus-within {
  border-color: var(--purple-500);
  background: var(--bg-secondary);
}

#text-input {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
}

#text-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

/* ── Input Controls Row ── */
.input-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.left-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-action-btn {
  padding: 8px 16px;
  height: 38px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-wrapper-row {
  flex: 1;
  max-width: 380px;
  min-width: 220px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon-inside {
  position: absolute;
  left: 0.9rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

#font-search {
  width: 100%;
  padding: 8px 36px 8px 2.3rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

#font-search:focus {
  border-color: var(--purple-500);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

.search-clear-btn {
  position: absolute;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--transition-fast);
}

.search-clear-btn:hover {
  color: var(--purple-600);
}

.search-clear-btn .icon {
  width: 14px;
  height: 14px;
  display: block;
}

/* ── Theme Categories Tabs Wrapper ── */
.categories-tab-wrapper {
  position: relative;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.theme-categories-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 6px 0;
}

.theme-category-tab {
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0; /* prevent shrinking so they stay readable */
}

.theme-category-tab:hover {
  border-color: var(--purple-400);
  color: var(--text-primary);
  background: var(--bg-primary);
}

.theme-category-tab.active {
  border-color: var(--purple-500);
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

/* More Styles Toggle Pill Styling */
.theme-category-tab.more-styles-toggle {
  background: var(--bg-tertiary);
  border-color: var(--purple-400);
  color: var(--purple-600);
  font-weight: 700;
}

[data-theme='dark'] .theme-category-tab.more-styles-toggle {
  color: var(--purple-300);
  border-color: var(--purple-500);
}

.theme-category-tab.more-styles-toggle:hover {
  background: var(--purple-600);
  color: #ffffff;
  border-color: var(--purple-600);
}

/* ── Dropdown Category Drawer ── */
.categories-dropdown-drawer {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px; /* scrollable from tab to bottom */
  overflow-y: auto; /* vertical scrollbar */
  padding: 0;
  margin-top: 0.5rem;
  transition: opacity var(--transition-normal);
}

.categories-dropdown-drawer.active {
  display: flex;
  flex-direction: column;
}

/* Drawer Sub-Tabs Nav */
.drawer-tabs-nav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1.5px solid var(--border);
  padding: 4px;
  margin: 0;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
  border-top-left-radius: calc(var(--radius-md) - 1px);
  border-top-right-radius: calc(var(--radius-md) - 1px);
}

.drawer-tab-btn {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-align: center;
}

.drawer-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.drawer-tab-btn.active {
  color: #ffffff;
  background: var(--purple-600);
  border-color: var(--purple-500);
}

/* Grids inside the drawer */
.drawer-content-pane {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
}

.drawer-content-pane.active {
  display: grid;
}

.drawer-category-item {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-category-item:hover {
  border-color: var(--purple-400);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.drawer-category-item.active {
  border-color: var(--purple-500);
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

/* ── Fonts Output List ── */
.fonts-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0;
}

.font-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  cursor: pointer;
  gap: 1.5rem;
}

.font-card:hover {
  transform: translateY(-2px);
  border-color: var(--purple-400);
  box-shadow: var(--shadow-md);
}

.font-card.copied-pulse {
  animation: cardPulse 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-color: var(--purple-500) !important;
}

.font-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.font-style-name {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  user-select: none;
}

.font-preview-text {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.4;
  min-height: 1.8rem;
}

.btn-copy-card {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.font-card:hover .btn-copy-card {
  background: var(--bg-tertiary);
  color: var(--purple-600);
  border-color: var(--purple-400);
}

.btn-copy-card.copied {
  background: var(--purple-600) !important;
  color: #ffffff !important;
  border-color: var(--purple-600) !important;
}

/* ── Load More Container ── */
.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.btn-load-more {
  padding: 0.85rem 2.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-load-more:active {
  transform: translateY(0);
}

/* ── No Fonts Placeholder ── */
.no-fonts-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 1rem;
}

.no-fonts-placeholder .icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.no-fonts-placeholder h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.no-fonts-placeholder p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 576px) {
.no-fonts-placeholder {
    padding: 2rem 1rem;
  }

  .no-fonts-placeholder .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .no-fonts-placeholder h3 {
    font-size: 1.05rem;
  }

  .no-fonts-placeholder p {
    font-size: 0.85rem;
    max-width: 280px;
  }
}

/* ── Internal Backlinks Section ── */
.seo-backlinks-section {
  padding: 1.5rem;
  margin-top: 2.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
}

.seo-backlinks-section h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.backlinks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.backlink-card {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.backlink-card:hover {
  border-color: var(--purple-400);
  color: var(--purple-600);
  background: var(--bg-secondary);
}

/* ── Tablet Responsiveness Adjustments (max-width: 992px) ── */
@media (max-width: 992px) {
  .theme-categories-tabs {
    flex-wrap: wrap; /* wrap category tabs instead of horizontal scroll */
    overflow-x: visible;
  }
  
  .font-card {
    padding: 1rem 1.25rem;
    gap: 1.25rem;
  }
  
  .font-preview-text {
    font-size: 1.25rem;
  }
}

/* ── Mobile Responsiveness Adjustments (max-width: 576px) ── */
@media (max-width: 576px) {
.fancy-text-container {
    width: 100%;
    padding: 0 0.75rem;
  }

  .sticky-input-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .textarea-container {
    padding: 0.6rem 0.85rem;
  }

  #text-input {
    font-size: 0.95rem;
    min-height: 44px;
  }

  .input-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .left-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .input-action-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 4px 8px;
    height: 32px;
  }

  .input-action-btn .icon {
    width: 13px;
    height: 13px;
  }

  .search-wrapper-row {
    max-width: 100%;
    width: 100%;
  }

  #font-search {
    font-size: 0.78rem;
    padding: 6px 30px 6px 2.1rem;
  }

  .search-icon-inside {
    left: 0.7rem;
    width: 14px;
    height: 14px;
  }

  .search-clear-btn {
    right: 0.4rem;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
  }

  .search-clear-btn .icon {
    width: 12px;
    height: 12px;
  }

  .theme-categories-tabs .theme-category-tab:not(.more-styles-toggle) {
    display: none;
  }

  .theme-category-tab.more-styles-toggle {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
  }

  .drawer-content-pane {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem 1rem 1rem 1rem;
  }

  .drawer-category-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .drawer-tabs-nav {
    padding: 4px;
    margin: 0;
  }

  .drawer-tab-btn {
    padding: 0.55rem 0.5rem;
    font-size: 0.82rem;
    min-height: 36px;
  }

  .fonts-cards-container {
    gap: 0.5rem; /* reduce vertical gap between cards on mobile */
  }

  .font-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    gap: 0.75rem;
    border-radius: var(--radius-sm);
  }

  .font-style-name {
    font-size: 0.65rem;
  }

  .font-preview-text {
    font-size: 1.05rem;
    min-height: 1.35rem;
  }

  .btn-copy-card {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
  }

  .btn-copy-card .icon {
    width: 13px;
    height: 13px;
  }
}

/* ── Animations ── */
@keyframes cardPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

@keyframes slideInUp {
  from {
    transform: translateY(2rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ── Copy Toast Notification ── */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(17, 12, 28, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: toastFadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.copy-toast .icon {
  color: #10b981; /* bright green for checked success icon */
  font-size: 0.95rem;
}

@keyframes toastFadeInUp {
  from {
    transform: translate(-50%, 1rem);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* Neutralize legacy tool toast classes to defer to global toast system */
.copy-toast, .qr-toast, .dt-toast, .toast-msg { display: none !important; }
