/* ==========================================================================
   Convert Any Music - Design System & Modern Stylesheet
   Ultra-fast, responsive, accessible, dark-mode-first aesthetic
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
  
  /* Color Palette */
  --bg-dark: #090d16;
  --bg-card: #131b2e;
  --bg-card-hover: #1a253e;
  --bg-card-subtle: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  
  --container-max: 1200px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, rgba(9, 13, 22, 1) 75%);
  background-attachment: fixed;
}

a {
  color: #818cf8;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #a5b4fc;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-logo:hover {
  opacity: 0.95;
}

.logo-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.site-logo:hover .logo-icon {
  transform: scale(1.08) rotate(-2deg);
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.65));
}

.logo-icon svg,
.logo-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  position: relative;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.2;
}

.nav-links a:hover, .nav-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-dropdown {
  position: relative;
}

.dropdown-toggle .arrow {
  font-size: 0.7rem;
  margin-left: 0.15rem;
  transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 290px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.15);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0.15rem !important;
  padding: 0.6rem 0.85rem !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-main) !important;
  background: transparent !important;
  text-decoration: none !important;
  white-space: normal !important;
  line-height: 1.3 !important;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.14) !important;
  color: #fff !important;
}

.dropdown-item .item-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #f8fafc;
}

.dropdown-item .item-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 0.45rem 1rem !important;
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  white-space: nowrap !important;
}

.nav-cta:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  line-height: 0;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

/* App Box / Converter Widget */
.app-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.app-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

/* Drop Zone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  background: var(--bg-card-subtle);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.005);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-icon svg {
  width: 28px;
  height: 28px;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.dropzone-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
}

.format-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1rem;
}

.format-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Conversion Settings Bar */
.converter-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  text-align: left;
}

.control-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.control-select, .control-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.control-select:focus, .control-input:focus {
  border-color: var(--primary);
}

.btn-convert {
  width: 100%;
  padding: 0.9rem;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: all 0.2s;
}

.btn-convert:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-convert:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* File list & Progress */
.file-queue {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.queue-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.btn-download {
  background: #10b981;
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-download:hover {
  background: #059669;
  color: #fff;
}

/* Features Grid */
.features-section {
  padding: 4.5rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tool-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.15rem;
}

.tool-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #818cf8;
}

.card-link:hover {
  color: #c7d2fe;
}

/* Comparison Table */
.comparison-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 1.5rem;
}

table.comp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.comp-table th, table.comp-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

table.comp-table th {
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

table.comp-table td {
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-blue  { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* FAQ Accordion */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 1.25rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.faq-answer {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Article / Editorial Content Page Layout */
.content-page {
  padding: 3rem 0;
  max-width: 860px;
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.content-page h1 {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.content-body {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.8;
}

.content-body h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  margin: 2.25rem 0 0.85rem;
  letter-spacing: -0.01em;
}

.content-body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 1.75rem 0 0.65rem;
}

.content-body p {
  margin-bottom: 1.35rem;
}

.content-body ul, .content-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.content-body li {
  margin-bottom: 0.5rem;
}

.callout-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.callout-title {
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 0.35rem;
}

/* Audio Player / Interactive Waveform Canvas */
.waveform-container {
  width: 100%;
  height: 110px;
  background: #090d16;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

canvas.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #05080f;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  max-width: 300px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer-col a:hover {
  color: #818cf8;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    background: #090d16;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.7);
  }

  .nav-links.is-active {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
    display: none;
  }

  .nav-dropdown.is-open .dropdown-menu {
    display: flex;
  }

  .nav-links a {
    padding: 0.65rem 0.85rem;
    width: 100%;
  }

  .nav-cta {
    text-align: center;
    justify-content: center;
    margin-top: 0.5rem;
  }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .converter-controls { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.8rem; }
  .app-box { padding: 1.25rem; }
}
