
/* =====================
   iLovePDF Style - style.css
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #E8212B;
  --red-dark: #c0151d;
  --red-light: #fff0f0;
  --gray-bg: #f7f7f8;
  --gray-border: #e0e0e0;
  --gray-text: #6b7280;
  --dark: #1a1a2e;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.14);
  --radius: 14px;
  --radius-sm: 8px;
}

body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--gray-bg); color: var(--dark); min-height: 100vh; display: flex; flex-direction: column; }

/* NAVBAR */
.navbar { background: var(--white); border-bottom: 1px solid var(--gray-border); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 32px; height: 60px; }
.logo { font-size: 1.6rem; font-weight: 900; text-decoration: none; display: flex; align-items: center; gap: 1px; letter-spacing: -1px; }
.logo-i { color: var(--dark); }
.logo-heart { color: var(--red); font-size: 1.3rem; }
.logo-pdf { color: var(--dark); }
.nav-links { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--dark); font-size: 0.9rem; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; transition: all 0.2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--red); border-bottom-color: var(--red); }
.nav-dropdown { position: relative; }
.nav-drop-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover); min-width: 180px; padding: 8px 0; z-index: 200; }
.nav-dropdown:hover .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; padding: 10px 16px; border-bottom: none; font-size: 0.875rem; }
.nav-drop-menu a:hover { background: var(--gray-bg); color: var(--red); }
.nav-drop-trigger { cursor: pointer; }
.hamburger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--dark); margin-left: auto; }

/* HERO */
.hero { background: var(--white); padding: 60px 24px 48px; text-align: center; border-bottom: 1px solid var(--gray-border); }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; color: var(--dark); margin-bottom: 16px; line-height: 1.2; }
.hero p { font-size: 1.05rem; color: var(--gray-text); max-width: 680px; margin: 0 auto; }

/* CATEGORY FILTER */
.cat-filter { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 24px 24px 0; max-width: 1200px; margin: 0 auto; }
.cat-btn { padding: 8px 18px; border-radius: 24px; border: 1.5px solid var(--gray-border); background: var(--white); color: var(--gray-text); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.cat-btn:hover { border-color: var(--red); color: var(--red); }
.cat-btn.active { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* TOOLS GRID */
.tools-section { max-width: 1200px; margin: 0 auto; padding: 24px; flex: 1; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tool-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-border); padding: 28px 24px; text-decoration: none; color: var(--dark); transition: all 0.25s; cursor: pointer; display: block; position: relative; overflow: hidden; }
.tool-card::before { content: ''; position: absolute; inset: 0; background: var(--red); opacity: 0; transition: opacity 0.25s; border-radius: var(--radius); }
.tool-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--red); }
.tool-card:hover::before { opacity: 0.03; }
.tool-card .card-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; position: relative; }
.tool-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.tool-card p { font-size: 0.82rem; color: var(--gray-text); line-height: 1.5; }
.badge-new { position: absolute; top: 12px; right: 12px; background: var(--red); color: white; font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* TOOL PAGE */
.tool-page { flex: 1; display: flex; flex-direction: column; }
.tool-hero { background: var(--white); padding: 56px 24px 48px; text-align: center; border-bottom: 1px solid var(--gray-border); }
.tool-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 12px; }
.tool-hero p { color: var(--gray-text); font-size: 1rem; max-width: 600px; margin: 0 auto 32px; }
.upload-area { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.select-btn { background: var(--red); color: var(--white); border: none; padding: 18px 48px; font-size: 1.15rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: background 0.2s; box-shadow: 0 4px 16px rgba(232,33,43,0.3); }
.select-btn:hover { background: var(--red-dark); }
.drop-hint { color: var(--gray-text); font-size: 0.875rem; margin-top: 12px; }
.tool-body { max-width: 960px; margin: 0 auto; padding: 32px 24px; width: 100%; flex: 1; }

/* FILE LIST */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.file-item { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius-sm); padding: 14px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.file-item .file-icon { font-size: 1.8rem; }
.file-item .file-info { flex: 1; }
.file-item .file-name { font-weight: 600; font-size: 0.9rem; }
.file-item .file-size { font-size: 0.8rem; color: var(--gray-text); }
.file-item .file-remove { background: none; border: none; color: var(--gray-text); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.file-item .file-remove:hover { background: var(--red-light); color: var(--red); }

/* ACTION BAR */
.action-bar { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--gray-border); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: 0 -4px 16px rgba(0,0,0,0.06); }
.action-bar-left { color: var(--gray-text); font-size: 0.875rem; }
.action-btn { background: var(--red); color: var(--white); border: none; padding: 14px 40px; font-size: 1rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: background 0.2s; box-shadow: 0 4px 16px rgba(232,33,43,0.25); }
.action-btn:hover { background: var(--red-dark); }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.add-more-btn { background: none; border: 1.5px solid var(--gray-border); color: var(--dark); padding: 12px 24px; font-size: 0.9rem; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.add-more-btn:hover { border-color: var(--red); color: var(--red); }

/* OPTIONS PANEL */
.options-panel { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 24px; margin-top: 24px; }
.options-panel h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; color: var(--gray-text); text-transform: uppercase; letter-spacing: 0.04em; }
.option-group { display: flex; gap: 12px; flex-wrap: wrap; }
.option-chip { padding: 8px 18px; border: 1.5px solid var(--gray-border); border-radius: 24px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; background: var(--white); }
.option-chip.active { border-color: var(--red); color: var(--red); background: var(--red-light); }
.option-chip:hover { border-color: var(--red); color: var(--red); }
.option-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; margin-bottom: 12px; }
.option-label input { width: 18px; height: 18px; accent-color: var(--red); cursor: pointer; }
.range-wrap { display: flex; align-items: center; gap: 12px; }
.range-wrap input[type=range] { flex: 1; accent-color: var(--red); }
.range-val { font-weight: 700; color: var(--red); min-width: 32px; }

/* PROGRESS */
.progress-wrap { margin-top: 16px; }
.progress-bar { background: #eee; border-radius: 8px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { background: var(--red); height: 100%; width: 0%; transition: width 0.4s; border-radius: 8px; }
.progress-text { font-size: 0.85rem; color: var(--gray-text); text-align: center; }

/* SUCCESS */
.success-box { background: var(--white); border: 1px solid #d4edda; border-radius: var(--radius); padding: 40px; text-align: center; margin-top: 24px; }
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.success-box h2 { font-size: 1.5rem; margin-bottom: 8px; }
.success-box p { color: var(--gray-text); margin-bottom: 24px; }
.dl-btn { background: var(--red); color: var(--white); border: none; padding: 14px 40px; font-size: 1rem; font-weight: 700; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.2s; box-shadow: 0 4px 16px rgba(232,33,43,0.25); }
.dl-btn:hover { background: var(--red-dark); }
.again-btn { background: none; border: 1.5px solid var(--gray-border); color: var(--dark); padding: 12px 24px; font-size: 0.9rem; font-weight: 600; border-radius: 8px; cursor: pointer; margin-left: 12px; transition: all 0.2s; }
.again-btn:hover { border-color: var(--red); color: var(--red); }

/* ERROR */
.error-box { background: #fff5f5; border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 14px 18px; color: #dc2626; font-size: 0.875rem; margin-top: 12px; display: none; }

/* AD PLACEHOLDER */
.ad-block { background: var(--white); border: 1px dashed var(--gray-border); border-radius: var(--radius-sm); padding: 12px; text-align: center; color: var(--gray-text); font-size: 0.75rem; min-height: 90px; display: flex; align-items: center; justify-content: center; margin: 16px 0; }

/* FOOTER */
.site-footer { background: var(--dark); color: #aaa; padding: 40px 24px; margin-top: auto; }
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-inner .logo { display: inline-flex; margin-bottom: 20px; }
.footer-inner .logo-i, .footer-inner .logo-pdf { color: #ccc; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.footer-links a { color: #aaa; text-decoration: none; font-size: 0.875rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--red); }
.footer-copy { font-size: 0.8rem; color: #666; }

/* HIDDEN / UTILS */
.hidden { display: none !important; }
.drag-over { border: 2px dashed var(--red) !important; background: var(--red-light) !important; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--gray-border); padding: 16px 24px; gap: 12px; z-index: 99; }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .tool-card { padding: 20px 16px; }
  .select-btn { padding: 16px 32px; font-size: 1rem; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .hero h1 { font-size: 1.6rem; }
}
