/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --dark: #0f172a;
  --mid: #475569;
  --light: #f8fafc;
  --border: #e2e8f0;
  --white: #ffffff;
  --danger: #ef4444;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.07);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== NAVIGATION ===== */
.head {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}
.logo img { width: 22px; }
nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}
nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mid);
  transition: color 0.2s;
}
nav a:hover { color: var(--primary); }
.hamburger { display: none; cursor: pointer; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--dark); margin: 5px 0; border-radius: 2px; transition: 0.3s; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.text-center { text-align: center; }

/* ===== HERO HEADER ===== */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}
.hero p {
  color: var(--mid);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}
.badge-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.badge {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}
.quick-answer {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  font-size: 0.88rem;
  color: var(--mid);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  text-align: left;
}

/* ===== MAIN CARD ===== */
.card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.converter-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .converter-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-height: 220px;
}
.upload-area:hover, .upload-area.drop-zone--over {
  background: #eff6ff;
  border-color: var(--primary);
}
.upload-area svg { color: var(--mid); margin-bottom: 0.75rem; }
.upload-area p { color: var(--mid); font-size: 0.95rem; margin-bottom: 1rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: var(--white);
  padding: 0.65rem 1.4rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }
.clear-all-btn {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
}
.clear-all-btn.hidden { display: none; }

/* ===== PREVIEW AREA ===== */
.preview-area-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--light);
  font-size: 0.9rem;
  font-weight: 600;
}
.preview-area {
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
}
.preview-placeholder { padding: 2.5rem; text-align: center; color: var(--mid); font-size: 0.9rem; }
.preview-placeholder.hidden { display: none; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.75rem; }
.preview-grid.hidden { display: none; }
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239,68,68,0.85);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 13px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.preview-item:hover .remove-btn { opacity: 1; }
.page-number {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: var(--white);
  font-size: 0.7rem;
  padding: 2px 4px;
  text-align: center;
}

/* ===== SETTINGS ===== */
.settings-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.settings-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--mid); }
.form-group select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
}
.form-group select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
#download-btn {
  font-size: 1rem;
  padding: 0.85rem 2.25rem;
  margin-top: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ===== FEATURES SECTION ===== */
.why-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.section-heading { text-align: center; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; margin-bottom: 2rem; letter-spacing: -0.02em; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.feature-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.feature-card .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--mid); }

/* ===== HOW IT WORKS ===== */
.how-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  counter-reset: steps;
}
.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.step-card p { font-size: 0.88rem; color: var(--mid); }

/* ===== FAQ ===== */
.faq-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 0.5rem; overflow: hidden; }
.faq-question {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  color: var(--dark);
}
.faq-question .faq-icon { font-size: 1.3rem; color: var(--primary); transition: transform 0.25s; flex-shrink: 0; }
.faq-question.active .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-answer div { padding: 0 1.25rem 1rem; color: var(--mid); font-size: 0.93rem; line-height: 1.6; }

/* ===== ARTICLES ===== */
.articles-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.article-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.article-card p { font-size: 0.9rem; color: var(--mid); line-height: 1.65; }

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: #94a3b8;
  padding: 3rem 1.25rem 1.5rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #1e293b;
}
footer h3 { font-size: 0.95rem; font-weight: 700; color: #e2e8f0; margin-bottom: 1rem; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 0.5rem; }
footer ul a { color: #94a3b8; font-size: 0.88rem; transition: color 0.2s; }
footer ul a:hover { color: #e2e8f0; }
footer p { font-size: 0.88rem; line-height: 1.7; }
.footer-copy { text-align: center; padding-top: 1.5rem; font-size: 0.82rem; color: #64748b; }

/* ===== MOBILE NAVIGATION ===== */
@media (max-width: 768px) {
  .hamburger { display: block; }
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 57px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    gap: 0;
  }
  nav ul.nav-menu-open { display: flex; }
  nav li { border-bottom: 1px solid var(--border); }
  nav li:last-child { border-bottom: none; }
  nav a { display: block; padding: 0.75rem 0; font-size: 0.95rem; }
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== LONG-FORM CONTENT PAGES (About, Privacy, DMCA, Contact, Blog) ===== */
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--mid);
  margin-bottom: 1.25rem;
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { text-decoration: underline; }

.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.page-header .meta {
  font-size: 0.85rem;
  color: var(--mid);
}

.prose { max-width: 780px; }
.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}
.prose p { margin-bottom: 1rem; color: var(--mid); font-size: 0.97rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.25rem; color: var(--mid); font-size: 0.97rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-color: #bfdbfe; }
.prose a:hover { text-decoration-color: var(--primary); }
.prose strong { color: var(--dark); }
.prose blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 1rem;
  color: var(--mid);
  font-style: italic;
  margin: 1.25rem 0;
}
.callout {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  color: var(--dark);
}
.callout strong { color: var(--primary-dark); }

/* ===== CONTACT PAGE ===== */
.contact-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  max-width: 780px;
}
@media (min-width: 640px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.contact-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.contact-card p { font-size: 0.9rem; color: var(--mid); margin-bottom: 0.75rem; }

/* ===== BLOG INDEX / CARD ===== */
.blog-list { max-width: 780px; }
.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.blog-card h2 { margin-top: 0; font-size: 1.2rem; }
.blog-card .meta { font-size: 0.8rem; color: var(--mid); margin-bottom: 0.5rem; }

/* ===== TABLE OF CONTENTS ===== */
.toc {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  max-width: 780px;
}
.toc h2 { margin-top: 0 !important; font-size: 1rem !important; }
.toc ol { margin: 0.5rem 0 0 1.25rem; }
.toc a { color: var(--primary); font-size: 0.9rem; }
