/* ============================================================
   PDF → CSV & Excel — premium glassmorphism UI
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-light: #DBEAFE;
  --green: #10B981;
  --green-dark: #059669;
  --text: #0F172A;
  --muted: #64748B;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --radius: 20px;
}

html { scroll-behavior: smooth; background: #F8FAFC; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(1100px 700px at 12% -10%, #DBEAFE 0%, transparent 55%),
    radial-gradient(900px 700px at 108% 15%, #E0E7FF 0%, transparent 50%),
    radial-gradient(900px 900px at 50% 115%, #ECFDF5 0%, transparent 55%),
    #F8FAFC;
  background-attachment: fixed;
}

/* floating ambient orbs */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  animation: drift 20s ease-in-out infinite alternate;
  pointer-events: none;
}
body::before { width: 460px; height: 460px; background: #93C5FD; top: -140px; left: -120px; }
body::after  { width: 520px; height: 520px; background: #6EE7B7; bottom: -180px; right: -140px; animation-delay: -10s; }

@keyframes drift {
  to { transform: translate(70px, 50px) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  html { scroll-behavior: auto; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); text-align: center; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.grad {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 55%, #3B82F6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hidden { display: none !important; }

/* ---------- glass base ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: var(--glass-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(16, 185, 129, 0.55); color: var(--green-dark); }
.btn:active { transform: translateY(0); }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #10B981, #059669); color: #fff; box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45); }

/* shine sweep */
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.btn-primary:hover::before { left: 130%; }
.btn-primary:disabled { opacity: .6; cursor: wait; }

.btn-small { padding: 7px 16px; font-size: .88rem; }
.btn-large { padding: 14px 32px; font-size: 1.05rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 1.12rem; color: var(--text); }
.logo-mark { font-size: 1.25rem; }
.logo-arrow { color: var(--brand); margin: 0 2px; }
.main-nav { margin-left: auto; display: flex; gap: 22px; }
.main-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 500; }
.main-nav a:hover { color: var(--brand); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 44px; text-align: center; }

.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.sub { max-width: 620px; margin: 0 auto 30px; color: var(--muted); font-size: 1.1rem; }

/* ---------- converter card ---------- */
.converter {
  position: relative;
  max-width: 660px;
  margin: 0 auto;
  min-height: 250px;
  padding: 36px 28px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .3s, box-shadow .3s, transform .3s cubic-bezier(.2,.8,.3,1);
  outline: none;
  will-change: transform;
}
/* hover: blue → green */
.converter:hover, .converter:focus-visible {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow:
    0 24px 64px rgba(16, 185, 129, 0.22),
    0 0 0 6px rgba(16, 185, 129, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transform: translateY(-6px) scale(1.015);
}
.converter:focus-visible { outline: 3px solid rgba(16, 185, 129, 0.45); outline-offset: 4px; }

.converter.dragover {
  border-color: var(--green);
  background: rgba(209, 250, 229, 0.7);
  box-shadow:
    0 28px 72px rgba(16, 185, 129, 0.3),
    0 0 0 8px rgba(16, 185, 129, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-6px) scale(1.025);
}
.converter.has-results { cursor: default; }
.converter.has-results:hover { transform: none; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.75); }

.state { width: 100%; text-align: center; }

.drop-icon {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  color: var(--brand);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
  transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s, background .35s;
}
.converter:hover .drop-icon, .converter:focus-visible .drop-icon {
  transform: translateY(-6px) scale(1.14) rotate(-4deg);
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  color: var(--green-dark);
  box-shadow: 0 14px 34px rgba(16, 185, 129, 0.32);
}
.converter.dragover .drop-icon {
  animation: bounce .7s ease infinite alternate;
  transform: scale(1.18);
}
@keyframes bounce {
  from { transform: translateY(-8px) scale(1.15); }
  to   { transform: translateY(2px)  scale(1.05); }
}

/* hover: title lifts + turns green */
.drop-title { transition: color .25s, transform .3s; }
.converter:hover .drop-title { color: var(--green-dark); transform: translateY(-2px); }
.drop-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 4px; }
.drop-sub { color: var(--muted); margin: 0; font-size: .95rem; }
.link-like { color: var(--brand); text-decoration: underline; font-weight: 600; }
.done-title { margin-bottom: 14px; }

/* spinner */
.spinner {
  width: 42px; height: 42px;
  margin: 0 auto 14px;
  border: 4px solid var(--brand-light);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* progress bar */
.bar {
  height: 8px;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60A5FA, #2563EB);
  border-radius: 999px;
  transition: width .25s ease;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

/* ---------- preview table ---------- */
.preview-wrap {
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.7);
  margin: 6px 0 14px;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}
.preview {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  white-space: nowrap;
}
.preview th {
  position: sticky; top: 0;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  color: var(--brand-dark);
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(37, 99, 235, 0.25);
}
.preview td {
  padding: 6px 12px;
  border-bottom: 1px solid #EEF2F7;
  color: #334155;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview tr:nth-child(even) td { background: rgba(248, 250, 252, 0.7); }

/* ---------- file list ---------- */
.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  text-align: left;
  max-height: 160px;
  overflow: auto;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
  font-size: .9rem;
}
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-meta { color: var(--muted); font-size: .8rem; flex-shrink: 0; }
.file-dl {
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: #EFF6FF;
  color: var(--brand-dark);
  border-radius: 8px;
  padding: 7px 18px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.file-dl:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- BIG main buttons: CSV & XLSX ---- */
.actions-big { gap: 14px; margin-top: 4px; }
.btn-big {
  flex: 1;
  min-width: 150px;
  padding: 18px 20px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  letter-spacing: .01em;
}
.btn-big:disabled { opacity: .65; cursor: wait; transform: none; }

/* CSV = green, XLSX = blue */
.btn-csv {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}
.btn.btn-csv:hover {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45);
}
.btn-xlsx {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}
.btn.btn-xlsx:hover {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

/* ---------- options ---------- */
.options {
  max-width: 660px;
  margin: 18px auto 0;
  border-radius: 16px;
  padding: 0;
  text-align: left;
}
.options summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--muted);
  list-style: none;
  user-select: none;
}
.options summary::-webkit-details-marker { display: none; }
.options summary:hover { color: var(--brand); }
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 4px 20px 20px;
}
.opt { display: flex; flex-direction: column; gap: 6px; }
.opt-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.opt select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(255, 255, 255, 0.85);
  font-size: .9rem;
  color: var(--text);
  cursor: pointer;
}
.opt select:focus { outline: 2px solid rgba(37, 99, 235, 0.4); }
.opt-check { flex-direction: row; align-items: center; gap: 8px; grid-column: 1 / -1; }
.opt-check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-alt {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 36px; }
.card { border-radius: var(--radius); padding: 26px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 44px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255,255,255,.75); }
.card-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--brand); }
.card-link { margin-top: 12px !important; }
.card-link a { color: var(--brand); text-decoration: none; font-size: .9rem; font-weight: 600; }
.card-link a:hover { color: #059669; text-decoration: underline; }
.cards-more { text-align: center; margin-top: 26px; font-size: .95rem; }
.cards-more a { color: var(--brand); text-decoration: none; font-weight: 600; }
.cards-more a:hover { color: #059669; text-decoration: underline; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 36px; }
.step {
  text-align: center;
  padding: 26px 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.step-num {
  width: 40px; height: 40px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 0 20px;
  margin-bottom: 12px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "＋"; color: var(--brand); font-size: 1.2rem; flex-shrink: 0; }
.faq-item[open] summary::after { content: "－"; }
.faq-item p { color: var(--muted); padding-bottom: 16px; margin: 0; font-size: .95rem; }

/* ---------- CTA ---------- */
.cta-band {
  margin-top: 20px;
  padding: 64px 0;
  text-align: center;
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 60%, #3B82F6 100%);
  color: #fff;
}
.cta-band h2 { color: #fff; margin-bottom: 24px; }
.cta-band .btn-primary {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.cta-band .btn-primary:hover { background: #EFF6FF; }

.preview-label { font-size: .8rem; color: var(--muted); margin: 0 0 8px; text-align: left; }

/* ---------- footer ---------- */
.site-footer {
  padding: 30px 0;
  font-size: .9rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 18px; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--brand); }
.footer-note { text-align: center; margin: 12px 20px 0; font-size: .8rem; opacity: .8; }

/* ---------- content pages (privacy / terms / about) ---------- */
.content-page { max-width: 760px; margin: 0 auto; padding: 48px 20px 72px; }
.content-page h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: .4em; }
.content-page .lead { color: var(--muted); font-size: 1.02rem; margin-bottom: 2em; }
.content-page h2 { text-align: left; font-size: 1.25rem; margin-top: 2em; }
.content-page p, .content-page li { color: #334155; font-size: .97rem; }
.content-page a { color: var(--brand); }
.content-page ul { padding-left: 1.2em; }
.content-page .updated { font-size: .85rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .main-nav { display: none; }
  .hero { padding: 36px 0 32px; }
  .converter { min-height: 210px; padding: 28px 16px; }
  .actions .btn { width: 100%; }
  .footer-inner { flex-direction: column; text-align: center; }
}
