/* ===== Theme variables (rang yahin se badlein) ===== */
:root {
  --primary: #6C4DF6;
  --primary-dark: #5636d9;
  --accent: #00C2A8;
  --dark: #1E1B3A;
  --bg: #F6F7FB;
  --card: #FFFFFF;
  --text: #1F2330;
  --muted: #5B6275;
  --border: #E3E5EF;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30, 27, 58, .08);
  --font: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

/* ===== Reset / base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* JS inject hone tak placeholder (layout jump kam karne ke liye) */
#site-header { min-height: 64px; background: var(--dark); }
#site-footer { min-height: 200px; }

/* ===== Layout helpers ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.prose p { margin: 0 0 1em; color: var(--muted); }
.prose h2 { margin-top: 1.4em; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font: 600 15px var(--font);
  padding: 10px 20px;
  border-radius: 8px;
  transition: background .2s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #06332d; }
.btn-accent:hover { background: #00a590; }

/* ===== Header ===== */
.site-header { background: var(--dark); position: sticky; top: 0; z-index: 100; }
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 20px; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { color: #cfcde6; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-all { border: 1px solid rgba(255,255,255,.3); margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

/* ===== Footer ===== */
.site-footer { background: var(--dark); color: #cfcde6; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 32px 16px 20px; }
.footer-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.footer-col h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 6px 0; }
.footer-col a { color: #cfcde6; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 24px; padding-top: 16px; font-size: 13px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 8px; }
.footer-links a { color: #fff; }

/* ===== Hero (home + tool pages) ===== */
.home-hero, .tool-hero { text-align: center; padding: 20px 0 8px; }
.home-hero h1, .tool-hero h1 { font-size: 34px; }
.lead { max-width: 720px; margin: 0 auto 14px; color: var(--muted); font-size: 17px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px; padding: 0; }
.badges li {
  font-size: 13px; font-weight: 600; color: var(--dark);
  background: #e9e5ff; border-radius: 999px; padding: 4px 12px;
}
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.breadcrumb span { margin: 0 4px; }

/* ===== Tools grid + cards ===== */
.section-title { font-size: 22px; margin: 32px 0 14px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool-card {
  display: block; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: border-color .15s, box-shadow .15s;
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.tool-card h3 { font-size: 17px; margin: 8px 0 4px; color: var(--primary); }
.tool-card p { margin: 0; font-size: 14px; color: var(--muted); }
.tool-icon { font-size: 28px; line-height: 1; }

/* ===== Tool page ===== */
.tool-box { min-height: 260px; margin: 8px 0 8px; }
.coming-soon {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; color: var(--muted); font-size: 18px; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius);
}
.content-block { margin-top: 32px; }
.content-block h2 { font-size: 22px; }
.steps { padding-left: 22px; margin: 0; color: var(--muted); }
.steps li { margin: 8px 0; }
.faq-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin: 8px 0;
}
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 10px 0 2px; color: var(--muted); }

/* ===== Upload box (tools mein use hoga) ===== */
.dropzone {
  border: 2px dashed var(--primary); border-radius: var(--radius);
  padding: 40px 16px; text-align: center; background: #faf9ff; cursor: pointer;
}
.dropzone.dragover { background: #ece8ff; }
.dropzone p { margin: 8px 0 0; color: var(--muted); }

/* ===== Mobile ===== */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: var(--dark);
    padding: 8px 16px 16px; border-top: 1px solid rgba(255,255,255,.1);
  }
  .main-nav.open { display: flex; }
  .nav-all { margin: 6px 0 0; text-align: center; }
  .home-hero h1, .tool-hero h1 { font-size: 26px; }
}

/* ===== Phase 1: Audio Cutter ===== */
[hidden] { display: none !important; }
.dropzone.dragover { background: #ece8ff; }
.tool-msg { margin: 12px 0 0; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.tool-msg.error { color: #c62828; }
.tool-msg.ok { color: #0b7a69; }

.file-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 14px; font-size: 14px; }
.file-info .fname { font-weight: 600; word-break: break-all; }
.file-info .fmeta { color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; margin-left: auto; }

.wave-wrap {
  position: relative; height: 140px; margin: 10px 0 6px;
  background: #f1effd; border-radius: 10px;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.wave-wrap canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; border-radius: 10px; }
.dim { position: absolute; top: 0; bottom: 0; background: rgba(30, 27, 58, .45); pointer-events: none; }
.dim-l { left: 0; border-radius: 10px 0 0 10px; }
.dim-r { right: 0; border-radius: 0 10px 10px 0; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; display: none; z-index: 2; }

.handle { position: absolute; top: -6px; bottom: -6px; width: 14px; margin-left: -7px; cursor: ew-resize; z-index: 3; }
.handle::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 4px; background: var(--primary); border-radius: 2px; }
.handle::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 30px; margin-top: -15px;
  background: var(--primary); border-radius: 6px; box-shadow: var(--shadow);
}
.handle:focus { outline: none; }
.handle:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 2px; }

.time-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin: 18px 0 4px; }
.time-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.time-row input { width: 110px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: 600 15px var(--font); color: var(--text); }
.sel-len { font-size: 14px; color: var(--muted); padding-bottom: 9px; }
.sel-len b { color: var(--text); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ===== Phase 1b: format / quality select ===== */
.time-row select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: 600 15px var(--font); color: var(--text); background: #fff; }
