:root {
  --bg: #f5f5f7;
  --bg-alt: #ffffff;
  --border: #e0e0e0;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-dark: #1d4ed8;
  --text: #111827;
  --text-soft: #111827;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-subtle: 0 8px 24px rgba(15, 23, 42, 0.05);
}

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Layout containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(245, 245, 247, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.9rem;
}

.nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: #000000; /* Force menu text to black */
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.nav a:hover {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text);
  transform: translateY(-1px);
}

.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #ffffff;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #111827;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
  transform: translateY(-3px) rotate(-45deg);
}

/* Hero */
.hero {
  padding: 40px 0 8px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 2.7vw, 2.7rem);
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1.02rem;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 4px;
}

.hero-body {
  color: var(--text-soft);
  max-width: 540px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 18px;
}

/* Placeholder media card */
.placeholder-card {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* Sections */
.section {
  padding: 32px 0;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--text-soft);
  max-width: 620px;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #e5e7eb;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease,
    box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn.primary {
  background: #111827;
  color: white;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.45);
}

.btn.secondary {
  background: #f3f4f6;
  border-color: rgba(148, 163, 184, 0.5);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.small {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

/* Cards & grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.tool-card,
.benefit-card,
.step-card {
  background: var(--bg-alt);
  border-radius: 18px;
  padding: 18px 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: var(--shadow-subtle);
  transition: transform 0.14s ease, box-shadow 0.18s ease,
    border-color 0.18s ease, background 0.18s ease;
}

.tool-card:hover,
.benefit-card:hover,
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(37, 99, 235, 0.4);
  background: radial-gradient(circle at top left, #f9fafb, #ffffff);
}

.tool-card h3,
.benefit-card h3,
.step-card h3 {
  font-size: 0.98rem;
  margin: 10px 0 6px;
}

.tool-card p,
.benefit-card p,
.step-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.9rem;
}

/* Special grids */
.benefits-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.steps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Tool hero pages */
.tool-hero {
  padding: 32px 0 40px;
}

.tool-hero h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

/* Drop zone */
.drop-zone {
  margin-top: 20px;
  padding: 22px 16px;
  border-radius: 18px;
  border: 1.5px dashed rgba(148, 163, 184, 0.9);
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.drop-zone.dragover {
  border-style: solid;
  background: #eff6ff;
}

/* File list */
.file-list-header {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr);
  margin-top: 18px;
  padding: 0 4px 6px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.file-actions-label {
  text-align: right;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-bottom: 8px;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.file-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-all;
}

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

.file-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

/* Merge PDF status wrapper */
.download-status-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Generic controls row */
.controls-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 16px 0 8px;
}

.quality-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.quality-control input[type="range"] {
  width: 180px;
}

.tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Status text in tool buttons (e.g. "Convert complete") */
.tool-buttons .file-meta,
.tool-buttons #imageConvertStatus {
  margin-right: 8px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* Format row (image converter) */
.format-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.86rem;
}

.format-row label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.format-row select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 4px 10px;
  font-size: 0.84rem;
  background: white;
}

.format-row .arrow {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* Text case layout */
.text-case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.text-panel {
  display: flex;
  flex-direction: column;
}

.panel-label {
  font-size: 0.86rem;
  margin-bottom: 6px;
  color: var(--text-soft);
}

textarea {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 10px 12px;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 180px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.case-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tool-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* FAQ */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.faq-item {
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.faq-item h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.faq-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

/* CTA section */
.cta-inner {
  background: radial-gradient(circle at top left, #111827, #020617);
  color: white;
  border-radius: 24px;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}

/* Ad slot */
.ad-slot {
  margin: 28px 0 18px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: repeating-linear-gradient(
    -45deg,
    rgba(248, 250, 252, 0.8),
    rgba(248, 250, 252, 0.8) 8px,
    rgba(241, 245, 249, 0.8) 8px,
    rgba(241, 245, 249, 0.8) 16px
  );
  padding: 10px 12px;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.6);
  text-align: center;
}

/* Footer */
.site-footer {
  padding: 18px 0 26px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: #f9fafb;
  margin-top: 20px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links a {
  text-decoration: underline;
}
/* MOBILE FOOTER CENTERING */
@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer-links {
    justify-content: center;
    text-align: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.3fr);
  }
  .hero-media {
    order: -1;
  }
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .benefits-grid,
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }
  .nav {
    position: absolute;
    right: 16px;
    top: 60px;
    flex-direction: column;
    align-items: flex-start;
    background: #ffffff;
    border-radius: 18px;
    padding: 10px 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.35);
    min-width: 180px;
    display: none;
  }
  .nav.open {
    display: flex;
  }
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .benefits-grid,
  .steps-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-actions {
    flex-direction: row;
  }
  .hero-media {
    display: none;
  }
  .file-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .file-actions {
    justify-content: flex-start;
  }
  .file-list-header {
    grid-template-columns: minmax(0, 1fr);
  }
  .file-actions-label {
    text-align: left;
  }
  .controls-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .quality-control input[type="range"] {
    width: 140px;
  }
  .text-case-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 24px;
  }
  .hero-text h1 {
    font-size: 1.6rem;
  }
  .format-row {
    width: 100%;
    justify-content: space-between;
  }
  .quality-control input[type="range"] {
    width: 120px;
  }
}

/* QR Code Generator layout */
.qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-top: 18px;
}

.qr-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-preview-card {
  background: var(--bg-alt);
  border-radius: 18px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-subtle);
  align-self: flex-start;
}

.qr-preview-inner {
  margin-top: 8px;
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px dashed rgba(148, 163, 184, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 260px;
}

#qrCanvas {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* Logo options row */
/* Desktop / default */
.logo-options-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  flex-wrap: wrap; /* allows wrapping if needed */
}

.logo-options-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Mobile: stack into 3 rows */
@media (max-width: 600px) {
  .logo-options-row {
    flex-direction: column;      /* stack vertically */
    align-items: flex-start;
    border-radius: 18px;         /* looks better when stacked */
  }

  .logo-options-row label {
    width: 100%;                 /* each label takes full row */
    justify-content: space-between;
  }

  .logo-options-row input[type="range"] {
    width: 100%;                 /* slider stretches full width */
  }
}


/* When disabled (no logo yet) */
.logo-options-row.disabled {
  opacity: 0.4;
}

.logo-options-row.disabled input,
.logo-options-row.disabled select {
  pointer-events: none;
}

/* QR status pill */
.qr-status-message {
  display: none; /* hidden until JS sets a message */
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.8rem;
}

/* Logo status + remove button */
.logo-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

#qrLogoStatus {
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
}

/* remove button, hidden until JS shows it */
#qrLogoRemove {
  display: none; /* JS will change to flex when logo added */
  border-radius: 999px;
  width: 24px;
  height: 24px;
  border: 1px solid #000;
  background: #ffffff;
  color: #000;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  align-items: center;
  justify-content: center;
}

#qrLogoRemove i {
  line-height: 1;
}

#qrLogoRemove:hover {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

/* Responsive for QR layout */
@media (max-width: 900px) {
  .qr-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .qr-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ic-flex-row{
 display:flex;
 justify-content:space-between;
 align-items:center;
 flex-wrap:wrap;
}
.ic-right{display:flex;gap:8px;}

.image-compress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.image-compress-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.image-compress-actions .file-meta {
  margin-right: 4px;
}

/* Extra gap between Output DPI and Compress size */
.logo-options-row.image-compress-options-row label + label {
  margin-left: 24px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .image-compress-row {
    flex-direction: column;
    align-items: stretch;
  }

  .image-compress-actions {
    justify-content: flex-start;
  }

  .logo-options-row.image-compress-options-row label + label {
    margin-left: 0;
    padding-left: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
