@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --red: #e5322d;
  --red-hover: #c9211c;
  --red-light: #fff2f1;
  --red-glow: rgba(229, 50, 45, 0.28);
  --ink: #18191f;
  --ink-soft: #5b6270;
  --ink-light: #8e95a5;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  --green: #10b981;
  --green-light: #ecfdf5;
  --blue: #3b82f6;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.07), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
  --shadow-red: 0 12px 28px -6px rgba(229, 50, 45, 0.35);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .brand, .btn {
  font-family: "Outfit", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.container {
  max-width: 1720px;
  width: 96%;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  transition: all 0.3s ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--ink);
  position: relative;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.brand .dot {
  color: var(--red);
  font-size: 1.6rem;
  line-height: 0;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.main-nav a:hover {
  color: var(--red);
  background: var(--red-light);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  text-align: center;
  padding: 64px 20px 48px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% -20%, rgba(229, 50, 45, 0.08) 0%, rgba(248, 250, 252, 0.8) 60%, var(--bg) 100%);
}

.hero::before, .hero::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
  animation: floatBlob 8s infinite alternate ease-in-out;
}

.hero::before {
  background: #ff7675;
  top: -80px;
  left: 10%;
}

.hero::after {
  background: #74b9ff;
  top: -40px;
  right: 10%;
  animation-delay: -4s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 30px) scale(1.1); }
}

.hero .container {
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.15;
  background: linear-gradient(135deg, #111827 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--ink-soft);
  font-size: 1.18rem;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   Search Bar & Category Filter Tabs
   ========================================================================== */
.tool-controls-wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tool-search-box {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.tool-search-box input {
  width: 100%;
  padding: 12px 20px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
  color: var(--ink);
}

.tool-search-box input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.12), 0 6px 20px rgba(0, 0, 0, 0.06);
}

.tool-search-box .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
  max-width: 100%;
  width: max-content;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 10px;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.category-tab:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.category-tab.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(229, 50, 45, 0.35);
  transform: translateY(-1px);
}

.category-tab .tab-count {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.category-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.category-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  margin: 35px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.category-section-title span.badge-tag {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-soft);
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ==========================================================================
   Tool Grid Cards (Homepage)
   ========================================================================== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 10px 0 60px;
}

.tool-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  cursor: pointer;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(229, 50, 45, 0.3);
}

.tool-card:hover::after {
  opacity: 1;
}

.tool-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.tool-card:hover .icon {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.tool-card h3 {
  margin: 2px 0 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s ease;
  line-height: 1.25;
}

.tool-card:hover h3 {
  color: var(--red);
}

.tool-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.tool-card.disabled {
  opacity: 0.6;
  pointer-events: none;
  background: var(--bg-soft);
}

.tool-card .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
  background: var(--red-light);
  border: 1px solid rgba(229, 50, 45, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Tool Pages & iLovePDF-style Dropzone
   ========================================================================== */
.tool-page {
  padding: 44px 0 90px;
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(229, 50, 45, 0.04) 0%, transparent 60%);
}

.tool-page .container {
  max-width: 1100px;
}

.tool-header {
  text-align: center;
  margin-bottom: 34px;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-header h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--ink);
}

.tool-header p {
  color: var(--ink-soft);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Interactive Dropzone */
.dropzone {
  position: relative;
  border: 2.5px dashed #d1d5db;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animated Upload Icon inside Dropzone */
.dropzone::before {
  content: '';
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5322d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: floatUpload 3s ease-in-out infinite alternate;
}

@keyframes floatUpload {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.dropzone:hover {
  border-color: var(--red);
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(229, 50, 45, 0.12);
}

.dropzone:hover::before {
  transform: translateY(-10px) scale(1.12);
}

.dropzone.dragover {
  border-color: var(--red);
  background: #fff6f5;
  transform: scale(1.02);
  box-shadow: 0 0 0 4px var(--red-glow), 0 20px 45px rgba(229, 50, 45, 0.15);
}

.dropzone input[type=file] {
  display: none;
}

/* Make Dropzone text look like a prominent, clickable button (iLovePDF Style) */
.dropzone p:first-of-type {
  margin: 0 0 8px;
}

.dropzone p strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #e5322d 0%, #d42520 100%);
  color: #ffffff;
  padding: 16px 36px;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 50px;
  box-shadow: var(--shadow-red);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone:hover p strong {
  background: linear-gradient(135deg, #f03d38 0%, #e5322d 100%);
  transform: scale(1.04);
  box-shadow: 0 16px 32px -4px rgba(229, 50, 45, 0.45);
}

.dropzone:active p strong {
  transform: scale(0.98);
}

.dropzone p:last-of-type {
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 50px;
  padding: 14px 34px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #e5322d 0%, #d42520 100%);
  color: #fff;
  box-shadow: var(--shadow-red);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
  background: linear-gradient(135deg, #f03d38 0%, #e5322d 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px -4px rgba(229, 50, 45, 0.45);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  background: var(--bg-soft);
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  color: var(--red);
}

/* ==========================================================================
   Thumbnails & Reorder Grid
   ========================================================================== */
.thumb-grid {
  max-width: 860px;
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
  animation: fadeInUp 0.4s ease;
}

.thumb-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 10px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.thumb-card:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
  transform: translateY(-3px);
}

.thumb-card.dragging {
  opacity: 0.35;
  transform: scale(0.95);
}

.thumb-card.drag-over {
  transform: scale(1.05);
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.thumb-card .order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(24, 25, 31, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.thumb-card .remove-thumb {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-card .remove-thumb:hover {
  background: var(--red);
  transform: scale(1.15);
}

.thumb-card.selectable {
  cursor: pointer;
}

.thumb-card .select-check {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(229, 50, 45, 0.4);
}

.thumb-card.selected {
  border-color: var(--red);
  background: var(--red-light);
  box-shadow: 0 4px 14px rgba(229, 50, 45, 0.2);
  transform: translateY(-2px);
}

.thumb-card.selected .select-check {
  display: flex;
}

.thumb-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.thumb-card.drag-over {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red);
}

.thumb-card .thumb-canvas-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-soft);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.thumb-card .thumb-canvas-wrap canvas,
.thumb-card .thumb-canvas-wrap img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.thumb-card .thumb-name {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.thumb-card .rotate-controls {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 2;
}

.thumb-card:hover .rotate-controls {
  opacity: 1;
}

.thumb-card .rotate-controls button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(24, 25, 31, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.thumb-card .rotate-controls button:hover {
  background: var(--red);
  transform: scale(1.15);
}

.thumb-add {
  border: 2.5px dashed var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3/4;
  cursor: pointer;
  color: var(--ink-soft);
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 12px;
  background: var(--bg-soft);
  transition: all 0.2s ease;
}

.thumb-add:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
  transform: translateY(-2px);
}

.thumb-add .plus {
  font-size: 2rem;
  line-height: 1;
  font-weight: 300;
}

.thumb-hint {
  max-width: 860px;
  margin: 14px auto 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ==========================================================================
   File List & Settings
   ========================================================================== */
.file-list {
  max-width: 760px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.file-row:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.file-row .name {
  flex: 1;
  font-size: 0.96rem;
  font-weight: 600;
  word-break: break-all;
  color: var(--ink);
}

.file-row .size {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.file-row button.remove {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-row button.remove:hover {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
  transform: scale(1.1);
}

.actions {
  max-width: 760px;
  margin: 32px auto 0;
  text-align: center;
}

/* ==========================================================================
   Progress Bar & Results
   ========================================================================== */
.progress-wrap {
  max-width: 760px;
  margin: 28px auto 0;
  display: none;
  animation: fadeInUp 0.4s ease;
}

.progress-bar {
  height: 10px;
  border-radius: 10px;
  background: var(--border);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-bar > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e5322d 0%, #ff7675 50%, #e5322d 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.status-text {
  text-align: center;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.result-box {
  max-width: 760px;
  margin: 32px auto 0;
  text-align: center;
  padding: 36px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-lg);
  display: none;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.92) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.result-box .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 18px;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
  animation: checkPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-box h3 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.result-box p {
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-size: 1rem;
}

.continue-box {
  max-width: 760px;
  margin: 28px auto 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease;
}

.continue-box .continue-title {
  font-weight: 700;
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--ink);
  text-align: left;
}

.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.continue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--bg-soft);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.continue-item:hover {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.continue-item .continue-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.handoff-banner {
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 14px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #86efac;
  color: #166534;
  font-size: 0.95rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.15);
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.handoff-banner span:first-child {
  width: 26px;
  height: 26px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Option Grid & Option Cards (iLovePDF Style Choices)
   ========================================================================== */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.option-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.option-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.option-card input[type=radio], .option-card input[type=checkbox] {
  margin-top: 3px;
  accent-color: var(--red);
  cursor: pointer;
  transform: scale(1.15);
}

.option-card:has(input:checked) {
  border-color: var(--red);
  background: var(--red-light);
  box-shadow: 0 4px 16px rgba(229, 50, 45, 0.15);
}

.option-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.option-card:has(input:checked) .option-title {
  color: var(--red);
}

.option-desc {
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.option-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 4px;
}

@keyframes slideDown {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.privacy-note {
  max-width: 760px;
  margin: 22px auto 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.privacy-note svg {
  color: var(--green);
}

/* ==========================================================================
   Info & How-to Sections (SEO & Instructions)
   ========================================================================== */
.info-section {
  max-width: 860px;
  margin: 70px auto 0;
  padding: 36px 30px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.info-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-section h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--red);
  border-radius: 4px;
}

.info-section ol {
  padding-left: 0;
  list-style: none;
  counter-reset: steps-counter;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

.info-section ol li {
  counter-increment: steps-counter;
  position: relative;
  padding-left: 44px;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.info-section ol li::before {
  content: counter(steps-counter);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #e5322d 0%, #d42520 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(229, 50, 45, 0.3);
}

.info-section ul {
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.info-section ul li strong {
  color: var(--ink);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 30px;
  background: #f8fafc;
  margin-top: 80px;
}

.footer-bottom {
  text-align: center;
  color: var(--ink-light);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Breakpoints & iLovePDF-style Slim Mobile Cards
   ========================================================================== */
@media (max-width: 1024px) {
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 12px;
  }

  .hero {
    padding: 36px 12px 24px;
  }

  .hero h1 {
    font-size: 1.85rem;
    margin-bottom: 8px;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .tool-controls-wrap {
    margin-bottom: 20px;
    gap: 12px;
  }

  .tool-search-box input {
    padding: 10px 16px 10px 38px;
    font-size: 0.88rem;
  }

  .tool-search-box .search-icon {
    left: 12px;
  }

  .category-tabs {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
  }

  .category-tab {
    padding: 5px 11px;
    font-size: 0.78rem;
    border-radius: 20px;
    gap: 4px;
  }

  .category-tab .tab-count {
    font-size: 0.7rem;
    padding: 0 5px;
  }

  /* Slim 2-column mobile card grid like iLovePDF */
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 6px 0 40px;
  }

  .tool-card {
    padding: 14px 12px;
    border-radius: 12px;
    gap: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .tool-card:active {
    transform: scale(0.97);
    background: var(--bg-soft);
  }

  .tool-card .icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1.15rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  }

  .tool-card .icon svg {
    width: 18px;
    height: 18px;
  }

  .tool-card h3 {
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
  }

  .tool-card p {
    font-size: 0.74rem;
    line-height: 1.32;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tool-card .badge {
    top: 8px;
    right: 8px;
    font-size: 0.62rem;
    padding: 2px 6px;
  }

  .dropzone {
    padding: 32px 14px;
    border-radius: 14px;
  }

  .dropzone p strong {
    padding: 12px 22px;
    font-size: 0.96rem;
  }

  .main-nav {
    display: none;
  }

  .info-section {
    padding: 24px 16px;
    margin-top: 40px;
    border-radius: 14px;
  }

  .info-section h2 {
    font-size: 1.25rem;
  }

  .info-section ol li {
    font-size: 0.9rem;
    padding-left: 36px;
  }
}

@media (max-width: 380px) {
  .tool-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tool-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }

  .tool-card p {
    display: none;
  }
}
