/* ==========================================================================
   WayToType — Glitch and Zalgo Text Generator Styles
   ========================================================================== */

/* Keep header single-row and tighten hero-to-tool spacing */
.nav-link {
  white-space: nowrap;
}

.hero-section {
  padding: 1.1rem 0 0.95rem;
}

.hero-breadcrumbs {
  margin-bottom: 0.65rem;
}

.hero-subtitle {
  margin: 0 auto;
}

.page-content {
  padding-top: 0.65rem;
  padding-bottom: 3rem;
}

.glitch-tool-shell {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

/* Input and Controls Card */
.glitch-studio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.glitch-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.glitch-mode-tabs {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  gap: 0.25rem;
}

.glitch-mode-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.42rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.glitch-mode-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.glitch-stats-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.glitch-stat-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--chip-bg);
  color: var(--text-secondary);
  border: 1px solid var(--chip-border);
  font-family: var(--font-mono);
}

.glitch-stat-badge.safe {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.glitch-stat-badge.warn {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

/* Split Left Input / Right Output Studio Grid */
.glitch-io-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.glitch-io-pane {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.glitch-io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 36px;
  flex-wrap: nowrap;
}

.glitch-io-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.glitch-output-select {
  max-width: 240px;
  height: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  cursor: pointer;
}

.glitch-textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.05rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glitch-textarea-output {
  font-size: 1.15rem;
  line-height: 2.05;
  background: var(--bg-secondary);
}

.glitch-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.glitch-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

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

.glitch-sample-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.glitch-sample-btn {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}

.glitch-sample-btn:hover {
  background: var(--chip-bg-hover);
  color: var(--chip-text-hover);
  border-color: var(--primary);
}

.glitch-action-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.glitch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-medium);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.glitch-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.glitch-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.glitch-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Controls Grid (3 balanced columns) */
.glitch-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-subtle);
}

.glitch-control-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
}

.glitch-control-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.glitch-intensity-value {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 700;
}

.glitch-range {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.glitch-level-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.glitch-level-pill {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.glitch-level-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.glitch-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.glitch-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.68rem;
  border-radius: var(--radius-md);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-secondary);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}

.glitch-check-pill input {
  accent-color: var(--primary);
  cursor: pointer;
}

.glitch-check-pill:has(input:checked) {
  color: var(--text-primary);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

/* De-glitch cleaner panel */
.deglitch-panel {
  display: none;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
}

.deglitch-panel.active {
  display: block;
}

.deglitch-output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.deglitch-clean-text {
  flex: 1;
  min-width: 200px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

/* Filter Tabs for Output Styles */
.glitch-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.glitch-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.glitch-filter-tab {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}

.glitch-filter-tab.active,
.glitch-filter-tab:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Output Cards Grid: Symmetric 2-column desktop grid (16 styles = 8 full rows) */
.glitch-styles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.glitch-style-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glitch-style-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.glitch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.glitch-style-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.glitch-compat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}

[data-theme="light"] .glitch-compat-tag {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.glitch-preview-box {
  width: 100%;
  text-align: left;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  min-height: 78px;
  max-height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 1.22rem;
  line-height: 2.0;
  word-break: break-word;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.glitch-preview-box:hover {
  border-color: var(--primary);
}

.glitch-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.glitch-card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.glitch-copy-btn {
  border: 1px solid var(--primary);
  background: rgba(59, 130, 246, 0.14);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.glitch-copy-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.glitch-copy-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

/* Ready-to-copy presets strip (8 items = 4x2 symmetric grid) */
.glitch-presets-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
}

.glitch-presets-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.glitch-presets-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 0.85rem;
}

.glitch-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.glitch-preset-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
  overflow: hidden;
}

.glitch-preset-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glitch-preset-chip:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.glitch-preset-copy-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* Recent Glitches Strip */
.glitch-recents-bar {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.15rem;
}

.glitch-recents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.glitch-recents-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.glitch-recent-chip {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.glitch-recent-chip:hover {
  border-color: var(--primary);
}

/* ==========================================================================
   SEO Guide Cards, Typography, Pillars and Tables (Compact and Scannable)
   ========================================================================== */

.seo-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.seo-section .seo-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.55rem 1.85rem;
  box-shadow: var(--shadow-sm);
}

.seo-section .seo-header {
  margin-bottom: 0.95rem;
}

.seo-section .seo-tag {
  margin-bottom: 0.55rem;
}

.seo-section .seo-title {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.seo-section .seo-subtitle {
  font-size: 0.96rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.seo-section p {
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.seo-section p:last-child {
  margin-bottom: 0;
}

.seo-section strong {
  color: var(--text-primary);
}

.seo-section h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.15rem 0 0.5rem;
}

.seo-section ul,
.seo-section ol {
  padding-left: 1.4rem;
  margin: 0.55rem 0 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.62;
}

.seo-section ul:last-child,
.seo-section ol:last-child {
  margin-bottom: 0;
}

.seo-section code {
  color: var(--primary);
  background: var(--bg-tertiary);
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  border: 1px solid var(--border-subtle);
}

.seo-section a:not(.glitch-related-card) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Symmetric 2x2 Pillar Cards */
.seo-section .pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.seo-section .pillar-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.45rem;
}

.seo-section .pillar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.seo-section .pillar-desc {
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.seo-section .pillar-desc:last-child {
  margin-bottom: 0;
}

/* Comparison Table in SEO Section */
.glitch-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.95rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.glitch-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.glitch-info-table th,
.glitch-info-table td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
}

.glitch-info-table tbody tr:last-child td {
  border-bottom: none;
}

.glitch-info-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
}

.glitch-info-table td {
  color: var(--text-secondary);
}

/* Symmetric 3x2 Related Tools Grid */
.glitch-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.glitch-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
}

.glitch-related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.glitch-related-card strong {
  color: var(--text-primary);
  font-size: 0.96rem;
}

.glitch-related-card span {
  color: var(--text-secondary);
  font-size: 0.83rem;
  line-height: 1.45;
}

.seo-section .faq-list {
  margin-top: 0.75rem;
  gap: 0.65rem;
}

.seo-section .faq-question {
  padding: 0.95rem 1.25rem;
  font-size: 0.98rem;
}

.seo-section .faq-answer {
  padding: 0.75rem 1.25rem 1rem;
}

.seo-section .faq-answer p {
  font-size: 0.93rem;
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .glitch-controls-grid {
    grid-template-columns: 1fr;
  }
  .glitch-presets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .glitch-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .glitch-io-grid,
  .glitch-styles-grid,
  .seo-section .pillar-grid,
  .glitch-related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .glitch-studio-card,
  .seo-section .seo-block,
  .glitch-table-wrap,
  .glitch-io-pane,
  .deglitch-clean-text {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .glitch-studio-card,
  .seo-section .seo-block {
    padding: 1rem;
  }
  .glitch-io-head,
  .glitch-control-top,
  .glitch-recents-head {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .glitch-output-select,
  .glitch-recent-chip {
    width: 100%;
    max-width: 100%;
  }
  .glitch-presets-grid {
    grid-template-columns: 1fr;
  }
}
