/*
Theme Name: AudioForge
Theme URI: https://audioforge.example
Description: Minimal dark theme for the AudioForge free audio conversion website. Provides the homepage hero + tool grid, page templates for tools, about, privacy policy and terms, and a blog index.
Version: 0.3.0
Requires at least: 6.2
Requires PHP: 7.4
Author: AudioForge
License: GPL-2.0-or-later
Text Domain: audioforge-theme
*/

/* Design tokens */
:root {
  --af-bg: #08080d;
  --af-panel: #0e0e16;
  --af-card: #12121c;
  --af-edge: rgba(255, 255, 255, 0.07);
  --af-text: #e7e7f2;
  --af-muted: #a1a1b5;
  --af-faint: #6b6b80;
  --af-violet: #8b5cf6;
  --af-cyan: #22d3ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--af-bg);
  color: var(--af-text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  color: var(--af-cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* App root: neutralize global anchor styling so the app's own button/link colors win */
#audioforge-root a:any-link {
  color: inherit;
  text-decoration: none;
}
#audioforge-root a[download],
#audioforge-root a[download]:hover {
  color: #fff;
  text-decoration: none;
}
#audioforge-root a.text-zinc-400 {
  color: var(--af-muted);
}

.af-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--af-edge);
}

.af-header-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}

.af-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.af-logo:hover {
  text-decoration: none;
}
.af-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--af-violet), var(--af-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.af-logo .grad {
  background: linear-gradient(100deg, #c4b5fd, #818cf8, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.af-nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.af-nav a {
  color: var(--af-muted);
  font-size: 14px;
  font-weight: 500;
}
.af-nav a:hover {
  color: #fff;
  text-decoration: none;
}

.af-free-badge {
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

.af-main {
  max-width: 1152px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.af-hero {
  text-align: center;
  padding: 64px 24px 72px;
  border: 1px solid var(--af-edge);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.06), transparent);
  position: relative;
  overflow: hidden;
}
.af-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 60%;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.28), transparent);
  filter: blur(60px);
  pointer-events: none;
}

.af-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: #fff;
  position: relative;
  z-index: 1;
}
.af-hero h1 .grad {
  background: linear-gradient(100deg, #c4b5fd, #818cf8, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.af-hero p {
  color: var(--af-muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 32px;
  position: relative;
  z-index: 1;
}

.af-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.af-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 15px;
}
.af-btn-primary {
  background: linear-gradient(90deg, var(--af-violet), var(--af-cyan));
  color: #fff;
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.35);
}
.af-btn-primary:hover {
  text-decoration: none;
  filter: brightness(1.08);
}
.af-btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--af-text);
}
.af-btn-secondary:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

.af-formats {
  margin-top: 36px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.af-formats span {
  border: 1px solid var(--af-edge);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--af-faint);
}

.af-tools h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.af-tools .sub {
  color: var(--af-faint);
  margin: 0 0 28px;
}

.af-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1000px) {
  .af-tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .af-tool-grid {
    grid-template-columns: 1fr;
  }
}

.af-tool-card {
  display: block;
  border: 1px solid var(--af-edge);
  background: rgba(18, 18, 28, 0.8);
  border-radius: 18px;
  padding: 22px;
  color: var(--af-text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.af-tool-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.15);
}
.af-tool-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(34, 211, 238, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.af-tool-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #fff;
}
.af-tool-card p {
  margin: 0;
  color: var(--af-faint);
  font-size: 13px;
  line-height: 1.5;
}

.af-tool-grid .icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #c4b5fd;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.af-privacy-note {
  margin-top: 40px;
  border: 1px solid var(--af-edge);
  border-radius: 16px;
  padding: 18px 22px;
  font-size: 14px;
  color: var(--af-muted);
  background: rgba(255, 255, 255, 0.02);
}
.af-privacy-note strong {
  color: var(--af-text);
}

.af-article {
  max-width: 760px;
}
.af-article h1 {
  font-size: 34px;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.af-article h2 {
  font-size: 22px;
  margin: 24px 0 8px;
}
.af-article p {
  color: var(--af-muted);
}
.af-article ul {
  color: var(--af-muted);
}

.af-footer {
  border-top: 1px solid var(--af-edge);
  padding: 28px 24px;
}
.af-footer-inner {
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--af-faint);
  font-size: 13px;
}
.af-footer a {
  color: var(--af-faint);
}
.af-footer a:hover {
  color: #fff;
  text-decoration: none;
}
.af-footer nav {
  display: flex;
  gap: 18px;
}

.af-tool-page {
  max-width: 860px;
  margin: 0 auto;
}
.af-tool-page .tool-intro {
  margin-bottom: 12px;
}
.af-tool-page .tool-intro h1 {
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.af-tool-page .tool-intro p {
  color: var(--af-muted);
  margin: 0;
}
.af-tool-page .entry-content > p.af-app:first-child {
  margin-top: 0;
}

/* Mobile center alignment for tool pages */
@media (max-width: 768px) {
  .af-tool-page .tool-intro {
    text-align: center;
  }
  .af-tool-page .tool-intro p {
    padding: 0 8px;
  }
}

.wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.af-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .af-blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .af-blog-grid {
    grid-template-columns: 1fr;
  }
}
.af-blog-card {
  display: block;
  border: 1px solid var(--af-edge);
  background: rgba(18, 18, 28, 0.8);
  border-radius: 16px;
  padding: 20px;
  color: var(--af-text);
}
.af-blog-card:hover {
  text-decoration: none;
  border-color: rgba(34, 211, 238, 0.4);
}
.af-blog-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.af-blog-card time {
  color: var(--af-faint);
  font-size: 12px;
}

.af-file-limit-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 12px;
  font-size: 14px;
  color: var(--af-muted);
}
.af-file-limit-notice svg {
  flex-shrink: 0;
  color: #fbbf24;
}
.af-file-limit-notice strong {
  color: var(--af-text);
}

/* ==================== v0.3.0 Design Improvements ==================== */

/* Animated hero background */
.af-hero {
  position: relative;
}
.af-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.af-hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='rgba(139,92,246,0.08)'/%3E%3C/svg%3E") repeat-x;
  animation: wave 12s linear infinite;
}
.af-hero-wave:nth-child(2) {
  bottom: -10px;
  opacity: 0.5;
  animation: wave 16s linear reverse infinite;
}
.af-hero-wave:nth-child(3) {
  bottom: -20px;
  opacity: 0.3;
  animation: wave 20s linear infinite;
}
@keyframes wave {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Search section */
.af-search-section {
  max-width: 560px;
  margin: -24px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.af-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.af-search-icon {
  position: absolute;
  left: 18px;
  color: var(--af-faint);
  pointer-events: none;
}
.af-search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  background: var(--af-card);
  border: 1px solid var(--af-edge);
  border-radius: 16px;
  color: var(--af-text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.af-search-input::placeholder {
  color: var(--af-faint);
}
.af-search-input:focus {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
@media (max-width: 768px) {
  .af-search-section {
    margin-top: -16px;
    padding: 0 12px;
  }
  .af-search-input {
    padding: 14px 16px 14px 44px;
    font-size: 14px;
    border-radius: 14px;
  }
  .af-search-icon {
    left: 14px;
  }
}

/* Social proof counter */
.af-social-proof {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.af-stat {
  text-align: center;
}
.af-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.af-stat-label {
  font-size: 13px;
  color: var(--af-faint);
  margin-top: 2px;
}

/* How It Works section */
.af-how-it-works {
  margin-top: 64px;
}
.af-how-it-works h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  text-align: center;
}
.af-how-it-works > p {
  color: var(--af-faint);
  text-align: center;
  margin: 0 0 32px;
}
.af-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 768px) {
  .af-steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
.af-step {
  text-align: center;
  padding: 28px 20px;
  border: 1px solid var(--af-edge);
  border-radius: 18px;
  background: rgba(18, 18, 28, 0.6);
  position: relative;
}
.af-step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--af-violet), var(--af-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 16px;
}
.af-step h3 {
  font-size: 17px;
  margin: 0 0 8px;
  color: #fff;
}
.af-step p {
  font-size: 14px;
  color: var(--af-muted);
  margin: 0;
  line-height: 1.5;
}
.af-step-connector {
  display: none;
}

/* FAQ Accordion */
.af-faq {
  margin-top: 64px;
}
.af-faq h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  text-align: center;
}
.af-faq > p {
  color: var(--af-faint);
  text-align: center;
  margin: 0 0 32px;
}
.af-faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.af-faq-item {
  border: 1px solid var(--af-edge);
  border-radius: 14px;
  background: rgba(18, 18, 28, 0.6);
  overflow: hidden;
}
.af-faq-question {
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: none;
  color: var(--af-text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
}
.af-faq-question:hover {
  color: #fff;
}
.af-faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--af-faint);
  transition: transform 0.2s ease;
}
.af-faq-item.active .af-faq-chevron {
  transform: rotate(180deg);
}
.af-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.af-faq-item.active .af-faq-answer {
  max-height: 300px;
}
.af-faq-answer-inner {
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--af-muted);
  line-height: 1.6;
}

/* Enhanced card hover */
.af-tool-card {
  position: relative;
  overflow: hidden;
}
.af-tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139, 92, 246, 0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.af-tool-card:hover::before {
  opacity: 1;
}

/* Popular badge */
.af-popular-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--af-violet), var(--af-cyan));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobile CTA */
.af-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: rgba(8, 8, 13, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--af-edge);
  z-index: 40;
}
@media (max-width: 768px) {
  .af-mobile-cta {
    display: block;
  }
  .af-main {
    padding-bottom: 100px;
  }
}
.af-mobile-cta .af-btn {
  width: 100%;
  justify-content: center;
}

/* ==================== Mobile Responsive Optimization ==================== */

/* Tablet and below */
@media (max-width: 1024px) {
  .af-header-inner {
    padding: 0 16px;
  }
  .af-main {
    padding: 16px 16px 40px;
  }
  .af-hero {
    padding: 48px 20px 56px;
    border-radius: 20px;
  }
  .af-hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
  }
  .af-hero p {
    font-size: 15px;
  }
  .af-tools h2,
  .af-how-it-works h2,
  .af-faq h2 {
    font-size: 22px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .af-header-inner {
    height: 56px;
    padding: 0 12px;
  }
  .af-logo {
    font-size: 16px;
    gap: 8px;
  }
  .af-logo-badge {
    width: 30px;
    height: 30px;
    font-size: 14px;
    border-radius: 10px;
  }
  .af-nav {
    gap: 14px;
  }
  .af-nav a {
    font-size: 13px;
  }
  .af-free-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
  .af-main {
    padding: 12px 12px 100px;
  }
  .af-hero {
    padding: 36px 16px 44px;
    border-radius: 16px;
  }
  .af-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    margin-bottom: 14px;
  }
  .af-hero p {
    font-size: 14px;
    margin-bottom: 24px;
    padding: 0 8px;
  }
  .af-btn {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 14px;
  }
  .af-formats {
    gap: 6px;
    margin-top: 28px;
  }
  .af-formats span {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 8px;
  }
  .af-social-proof {
    gap: 20px;
    margin-top: 28px;
  }
  .af-stat-value {
    font-size: 22px;
  }
  .af-stat-label {
    font-size: 11px;
  }
  .af-tools,
  .af-how-it-works,
  .af-faq {
    margin-top: 40px;
  }
  .af-tools h2,
  .af-how-it-works h2,
  .af-faq h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }
  .af-tools .sub,
  .af-how-it-works > p,
  .af-faq > p {
    font-size: 13px;
    margin-bottom: 24px;
  }
  .af-tool-grid {
    gap: 12px;
  }
  .af-tool-card {
    padding: 16px;
    border-radius: 14px;
  }
  .af-tool-card .icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .af-tool-grid .icon svg {
    width: 18px;
    height: 18px;
  }
  .af-tool-card h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }
  .af-tool-card p {
    font-size: 12px;
  }
  .af-popular-badge {
    font-size: 9px;
    padding: 3px 8px;
    top: 10px;
    right: 10px;
  }
  .af-steps {
    gap: 12px;
  }
  .af-step {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .af-step-number {
    width: 40px;
    height: 40px;
    font-size: 16px;
    margin-bottom: 12px;
  }
  .af-step h3 {
    font-size: 15px;
    margin-bottom: 6px;
  }
  .af-step p {
    font-size: 13px;
  }
  .af-faq-list {
    gap: 10px;
  }
  .af-faq-item {
    border-radius: 12px;
  }
  .af-faq-question {
    padding: 14px 16px;
    font-size: 14px;
  }
  .af-faq-answer-inner {
    padding: 0 16px 14px;
    font-size: 13px;
  }
  .af-privacy-note {
    padding: 14px 16px;
    font-size: 13px;
    border-radius: 12px;
    margin-top: 32px;
  }
  .af-footer {
    padding: 20px 16px;
  }
  .af-footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .af-footer nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .af-footer span {
    font-size: 12px;
  }
  .af-tool-page {
    padding: 0 4px;
  }
  .af-tool-page .tool-intro h1 {
    font-size: 22px;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .af-header-inner {
    height: 52px;
  }
  .af-logo {
    font-size: 15px;
    gap: 6px;
  }
  .af-logo-badge {
    width: 28px;
    height: 28px;
    font-size: 13px;
    border-radius: 8px;
  }
  .af-nav {
    gap: 10px;
  }
  .af-nav a {
    font-size: 12px;
  }
  .af-free-badge {
    display: none;
  }
  .af-hero {
    padding: 28px 14px 36px;
    border-radius: 14px;
  }
  .af-hero h1 {
    font-size: clamp(1.4rem, 8vw, 2rem);
  }
  .af-hero p {
    font-size: 13px;
  }
  .af-btn {
    padding: 11px 20px;
    font-size: 13px;
  }
  .af-formats span {
    font-size: 9px;
    padding: 2px 6px;
  }
  .af-stat-value {
    font-size: 20px;
  }
  .af-tool-card {
    padding: 14px;
  }
  .af-tool-card .icon {
    width: 34px;
    height: 34px;
  }
  .af-tool-grid .icon svg {
    width: 16px;
    height: 16px;
  }
  .af-tool-card h3 {
    font-size: 13px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .af-tool-card:hover {
    transform: none;
    box-shadow: none;
  }
  .af-tool-card:active {
    transform: scale(0.98);
  }
  .af-btn:hover {
    filter: none;
  }
  .af-btn:active {
    transform: scale(0.97);
  }
}

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .af-mobile-cta {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .af-footer {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .af-hero-wave,
  .af-faq-question,
  .af-faq-chevron,
  .af-tool-card,
  .af-btn {
    animation: none !important;
    transition: none !important;
  }
}