/* ─────────────────────────────────────────────────────────────
   Markdown ↔ HTML Converter Tool — Page Styles
   Static file: static/css/tool-markdown-converter.css
────────────────────────────────────────────────────────────── */

/* ── Tool Page Layout ──────────────────────────────────────── */
.tool-page {
  padding: 48px 0 80px;
  min-height: 80vh;
}
.tool-hero {
  text-align: center;
  margin-bottom: 48px;
}
.tool-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  line-height: 1.2;
}
.tool-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.35);
  color: #a78bfa;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ── Mini CTA Bar ──────────────────────────────────────────── */
.mini-cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.22);
  border-radius: 999px;
  padding: 8px 20px;
  margin: -28px auto 28px;
  max-width: 560px;
  flex-wrap: wrap;
}
.mini-cta-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.mini-cta-text strong { color: var(--text-primary); font-weight: 700; }
.mini-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-primary);
  padding: 5px 14px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s, transform .2s;
  line-height: 1;
}
.mini-cta-link:hover { opacity: .88; transform: scale(1.03); }

/* ── Mode Toggle ───────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.mode-toggle-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  max-width: 520px;
  width: 100%;
}
.mode-group-label {
  grid-column: 1 / -1;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 6px 0;
}
.mode-group-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.mode-btn {
  padding: 10px 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,.35);
}

/* ── Editor Layout ─────────────────────────────────────────── */
.editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .editor-wrap { grid-template-columns: 1fr; }
}
.editor-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s;
}
.editor-panel:focus-within {
  border-color: rgba(124,58,237,.6);
  box-shadow: 0 0 0 3px rgba(124,58,237,.08);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.panel-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-label .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gradient-primary);
}
.panel-actions { display: flex; gap: 8px; }
.panel-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.panel-btn:hover {
  background: rgba(124,58,237,.15);
  border-color: rgba(124,58,237,.4);
  color: #a78bfa;
}
.panel-btn.copied {
  background: rgba(16,185,129,.15);
  border-color: rgba(16,185,129,.4);
  color: #34d399;
}
.editor-textarea {
  width: 100%;
  flex: 1;
  min-height: 360px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 20px;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-primary);
  box-sizing: border-box;
}

/* ── Preview Area ──────────────────────────────────────────── */
.editor-preview {
  flex: 1;
  min-height: 360px;
  padding: 20px;
  overflow-y: auto;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.8;
}
.editor-preview h1, .editor-preview h2, .editor-preview h3,
.editor-preview h4, .editor-preview h5, .editor-preview h6 {
  color: var(--text-primary);
  font-weight: 700;
  margin: 1.2em 0 .5em;
  line-height: 1.3;
}
.editor-preview h1 { font-size: 1.6rem; border-bottom: 1px solid var(--border); padding-bottom: .4em; }
.editor-preview h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.editor-preview h3 { font-size: 1.1rem; }
.editor-preview p { margin: .8em 0; }
.editor-preview code {
  background: rgba(124,58,237,.12);
  color: #a78bfa;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .88em;
  font-family: monospace;
}
.editor-preview pre {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 1em 0;
}
.editor-preview pre code { background: none; padding: 0; color: #e2e8f0; font-size: .85rem; }
.editor-preview blockquote {
  border-left: 3px solid #7c3aed;
  padding-left: 16px;
  margin-left: 0;
  color: var(--text-muted);
  font-style: italic;
}
.editor-preview ul, .editor-preview ol { padding-left: 24px; margin: .8em 0; }
.editor-preview li { margin: .3em 0; }
.editor-preview table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .87rem; }
.editor-preview th, .editor-preview td { border: 1px solid var(--border); padding: 8px 14px; text-align: left; }
.editor-preview th { background: rgba(255,255,255,.04); font-weight: 700; }
.editor-preview a { color: #a78bfa; text-decoration: underline; }
.editor-preview hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
.editor-preview strong { font-weight: 700; color: var(--text-primary); }
.editor-preview em { font-style: italic; }

/* ── Action Buttons ────────────────────────────────────────── */
.convert-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.btn-convert {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(124,58,237,.4);
}
.btn-convert:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124,58,237,.55);
}
.btn-swap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  font-family: inherit;
}
.btn-swap:hover {
  background: rgba(124,58,237,.12);
  border-color: rgba(124,58,237,.4);
  color: #a78bfa;
}

/* ── Feature Cards ─────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 48px 0;
}
.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: rgba(124,58,237,.4); transform: translateY(-3px); }
.feature-card i { color: #a78bfa; margin-bottom: 10px; display: block; }
.feature-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* ── SEO Article Typography ────────────────────────────────── */
.seo-content-block {
  max-width: 780px;
  margin: 0 auto;
  padding-top: 28px;
}
.seo-content-block h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 52px 0 24px;
  padding-left: 18px;
  position: relative;
  letter-spacing: -.02em;
}
.seo-content-block h2::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(to bottom, #7c3aed, #a78bfa);
}
.seo-content-block h2:first-of-type { margin-top: 12px; }
.seo-content-block h3 {
  font-size: .97rem;
  font-weight: 700;
  color: #c4b5fd;
  margin: 28px 0 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: .01em;
}
.seo-content-block h3::before {
  content: '';
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow: 0 0 8px rgba(124,58,237,.5);
  flex-shrink: 0;
}
.seo-content-block p {
  color: rgba(255,255,255,.62);
  line-height: 1.85;
  margin-bottom: 14px;
  font-size: .94rem;
}
.seo-content-block ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.seo-content-block ul li {
  position: relative;
  padding-left: 22px;
  color: rgba(255,255,255,.62);
  line-height: 1.8;
  font-size: .94rem;
}
.seo-content-block ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow: 0 0 6px rgba(124,58,237,.4);
}
.seo-content-block ul li strong { color: var(--text-primary); font-weight: 700; }
.seo-content-block p strong { color: var(--text-primary); font-weight: 700; }
.seo-content-block p a { color: #a78bfa; text-underline-offset: 3px; }
.seo-content-block p a:hover { color: #c4b5fd; }
.seo-content-block p code,
.seo-content-block li code {
  background: rgba(124,58,237,.13);
  border: 1px solid rgba(124,58,237,.22);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: .82rem;
  color: #c4b5fd;
  font-family: 'Courier New', monospace;
}

/* ── FAQ Accordion ─────────────────────────────────────────── */
.faq-list { 
  margin-top: 24px; 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(10px);
}
.faq-item:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(17, 24, 39, 0.6);
}
.faq-item.open {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(17, 24, 39, 0.8);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 28px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
  transition: all 0.2s;
}
.faq-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.03);
  line-height: 1;
}
.faq-item.open .faq-icon {
  border-color: var(--accent-purple);
  color: #fff;
  background: var(--accent-purple);
  transform: rotate(45deg);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 28px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.faq-item.open .faq-answer { 
  max-height: 800px; 
  padding: 0 28px 28px; 
}
.faq-answer code {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .83rem;
  font-family: 'Courier New', monospace;
}
.faq-answer kbd {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: .8rem;
  font-family: inherit;
}

/* ── CTA Block ─────────────────────────────────────────────── */
.tool-cta {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  margin-top: 48px;
}
.tool-cta h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.tool-cta p { color: var(--text-muted); margin-bottom: 24px; }
