/* PDF Metadata Editor — Indigo theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f0f14;
  --bg-card:     #1e1e28;
  --bg-surface:  #18181f;
  --border:      #2e2e3e;
  --border-focus:#6366f1;
  --accent:      #6366f1;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99,102,241,.18);
  --text:        #e8e8f0;
  --text-muted:  #9898b8;
  --text-faint:  #55556a;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
}

body { background: var(--bg); color: var(--text); font-family: system-ui,-apple-system,sans-serif; font-size: .95rem; line-height: 1.6; min-height: 100vh; }

/* ── Header ────────────────────────────────── */
.site-header { background: rgba(15,15,20,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo-icon { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.logo-text { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.main-nav { display: flex; gap: 4px; }
.nav-link { padding: 6px 13px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: .88rem; transition: all .2s; }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.06); }

/* ── Layout ────────────────────────────────── */
.main-wrap { max-width: 780px; margin: 0 auto; padding: 28px 20px 80px; }
.ad-slot { margin: 16px 0; min-height: 90px; background: var(--bg-surface); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); color: var(--text-faint); font-size: .78rem; }

/* ── Hero ───────────────────────────────────── */
.tool-hero { text-align: center; padding: 32px 0 28px; }
.tool-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 4px 14px; font-size: .75rem; color: var(--text-muted); margin-bottom: 14px; }
.tool-title { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; }
.gradient-title { background: linear-gradient(135deg, #818cf8, #6366f1, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tool-subtitle { font-size: 1rem; color: var(--text-muted); max-width: 520px; margin: 0 auto; }

/* ── Error banner ───────────────────────────── */
.error-banner { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); border-radius: 10px; padding: 12px 16px; color: #fca5a5; font-size: .88rem; margin-bottom: 18px; }

/* ── Upload zone ───────────────────────────── */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 52px 28px; text-align: center; cursor: pointer; transition: all .25s; background: var(--bg-surface); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-glow); }
.upload-icon { width: 56px; height: 56px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.upload-icon svg { width: 26px; height: 26px; stroke: #fff; }
.upload-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.upload-sub { color: var(--text-muted); font-size: .88rem; margin-bottom: 20px; }
.btn-upload { display: inline-block; padding: 10px 26px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-radius: 9px; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: opacity .2s; }
.btn-upload:hover { opacity: .88; }
.upload-note { font-size: .77rem; color: var(--text-faint); margin-top: 16px; }

/* ── PDF chip ───────────────────────────────── */
.pdf-chip { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; }
.pdf-chip-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pdf-chip-icon svg { width: 18px; height: 18px; stroke: #fff; }
.pdf-chip-info { flex: 1; min-width: 0; }
.pdf-chip-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-chip-meta { font-size: .78rem; color: var(--text-muted); }
.btn-change-file { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); font-size: .8rem; padding: 5px 12px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.btn-change-file:hover { color: var(--text); background: rgba(255,255,255,.1); }

/* ── Info bar ───────────────────────────────── */
.info-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.info-pill { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.info-pill strong { color: var(--text); }

/* ── Metadata form card ─────────────────────── */
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.form-title { font-size: 1rem; font-weight: 700; margin-bottom: 20px; color: var(--text); padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.form-title svg { stroke: var(--accent); }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field-label { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 7px; }
.field-current { font-size: .76rem; color: var(--text-faint); font-weight: 400; text-transform: none; letter-spacing: 0; font-style: italic; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.field-input { width: 100%; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .9rem; padding: 9px 12px; outline: none; transition: border-color .2s; font-family: inherit; }
.field-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.field-input::placeholder { color: var(--text-faint); }

textarea.field-input { resize: vertical; min-height: 70px; }

.field-hint { font-size: .76rem; color: var(--text-faint); margin-top: 5px; }

.field-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ── Actions ────────────────────────────────── */
.action-row { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.btn-save { flex: 1; min-width: 160px; padding: 12px 24px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border: none; border-radius: 10px; font-size: .95rem; font-weight: 700; cursor: pointer; transition: opacity .2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-save:hover:not(:disabled) { opacity: .88; }
.btn-save:disabled { opacity: .45; cursor: not-allowed; }
.btn-clear-all { padding: 12px 20px; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap; }
.btn-clear-all:hover { color: var(--text); background: rgba(255,255,255,.09); }

/* ── Spinner ────────────────────────────────── */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Success card ───────────────────────────── */
.success-card { background: var(--bg-card); border: 1px solid rgba(99,102,241,.3); border-radius: var(--radius); padding: 32px 24px; text-align: center; }
.success-icon { width: 56px; height: 56px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.success-icon svg { width: 26px; height: 26px; stroke: #fff; }
.success-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.success-sub { color: var(--text-muted); font-size: .88rem; margin-bottom: 22px; }
.btn-download { display: inline-flex; align-items: center; gap: 8px; padding: 11px 28px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border: none; border-radius: 10px; font-size: .95rem; font-weight: 700; cursor: pointer; transition: opacity .2s; }
.btn-download:hover { opacity: .88; }
.btn-again { display: block; margin: 12px auto 0; background: none; border: none; color: var(--text-muted); font-size: .85rem; cursor: pointer; text-decoration: underline; }
.btn-again:hover { color: var(--text); }

/* ── Section / Features ─────────────────────── */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 48px 0 36px; }
.page-section { margin-bottom: 36px; }
.section-head { margin-bottom: 24px; }
.section-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.section-desc { color: var(--text-muted); font-size: .92rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.feature-icon { font-size: 1.5rem; margin-bottom: 10px; }
.feature-title { font-size: .92rem; font-weight: 700; margin-bottom: 5px; }
.feature-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

.steps-grid { display: grid; gap: 14px; }
.step-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: flex-start; gap: 16px; }
.step-number { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.step-title { font-size: .92rem; font-weight: 700; margin-bottom: 3px; }
.step-desc { font-size: .82rem; color: var(--text-muted); }

.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q { width: 100%; background: none; border: none; color: var(--text); font-size: .9rem; font-weight: 600; padding: 16px 18px; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-q:hover { background: rgba(255,255,255,.03); }
.faq-icon { color: var(--accent); font-size: 1.2rem; flex-shrink: 0; transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 18px 16px; font-size: .86rem; color: var(--text-muted); line-height: 1.6; }
.faq-item.open .faq-a { display: block; }
.faq-a p { margin-bottom: 8px; }
.faq-a p:last-child { margin-bottom: 0; }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.related-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; display: flex; flex-direction: column; gap: 8px; }
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.related-icon svg { width: 18px; height: 18px; stroke: #fff; }
.related-name { font-size: .88rem; font-weight: 700; }
.related-desc { font-size: .78rem; color: var(--text-muted); flex: 1; }
.related-link { font-size: .78rem; color: var(--accent); font-weight: 600; }

/* ── Footer ─────────────────────────────────── */
.site-footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: 40px 20px 24px; margin-top: 60px; }
.footer-grid { max-width: 1180px; margin: 0 auto 28px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand-text { font-size: .82rem; color: var(--text-faint); margin-top: 10px; max-width: 220px; }
.footer-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-faint); margin-bottom: 10px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: .85rem; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { max-width: 1180px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 18px; display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-faint); flex-wrap: wrap; gap: 8px; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #232330; border: 1px solid var(--border); border-radius: 10px; padding: 10px 20px; font-size: .88rem; color: var(--text); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 999; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
