@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --accent: #06B6D4;
  --accent-warm: #F59E0B;
  --success: #10B981;
  --danger: #EF4444;
  --text-dark: #0F172A;
  --text-mid: #334155;
  --text-light: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-focus: #93C5FD;
  --bg: #FAFBFC;
  --bg-white: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-lg: 0 16px 48px rgba(15,23,42,0.10), 0 6px 18px rgba(15,23,42,0.06);
  --shadow-glow: 0 0 0 4px rgba(37,99,235,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1.5rem;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.4rem;
  color: var(--primary);
  text-decoration: none; letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 18px; height: 18px; color: white; }
.logo span { color: var(--text-dark); }

.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  padding: 6px 14px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-links a:hover { background: var(--bg-subtle); color: var(--primary); }

.nav-cta {
  background: var(--primary) !important; color: white !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--primary-dark) !important; color: white !important; }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 6px; border: none; background: none;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text-mid); border-radius: 2px;
  transition: var(--transition);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(160deg, #EFF6FF 0%, #F0F9FF 40%, #ECFDF5 100%);
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(37,99,235,0.08), transparent);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; border: 1px solid var(--border);
  border-radius: 100px; padding: 5px 14px 5px 8px;
  font-size: 0.8rem; font-weight: 600; color: var(--primary);
  margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
}
.hero-badge-dot {
  width: 8px; height: 8px;
  background: var(--success); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.5; }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text-dark);
  max-width: 700px; margin: 0 auto 1.25rem;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.15rem; color: var(--text-light);
  max-width: 520px; margin: 0 auto 2.5rem;
  font-weight: 400;
}
.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem;
  flex-wrap: wrap; margin-top: 3rem; padding-top: 2.5rem;
  border-top: 1px solid rgba(37,99,235,0.1);
}
.hero-stat { text-align: center; }
.hero-stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800;
  color: var(--text-dark); display: block;
}
.hero-stat-label {
  font-size: 0.82rem; color: var(--text-muted); font-weight: 500;
}

/* ===== SEARCH ===== */
.search-bar-wrap {
  max-width: 520px; margin: 0 auto 1.5rem;
  display: flex; gap: 0; position: relative;
}
.search-bar {
  width: 100%; padding: 14px 20px 14px 48px;
  border: 2px solid var(--border); border-radius: 100px;
  font-size: 0.95rem; font-family: var(--font-body);
  background: white; outline: none; transition: var(--transition);
  box-shadow: var(--shadow-md);
}
.search-bar:focus { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ===== CATEGORIES ===== */
.section { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-header { margin-bottom: 2.5rem; }
.section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light);
  color: var(--primary); font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 4px 12px; border-radius: 100px; margin-bottom: 0.75rem;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800; letter-spacing: -0.5px; color: var(--text-dark);
}
.section-header p { color: var(--text-light); margin-top: 0.4rem; font-size: 1rem; }

.category-tabs {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.cat-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 100px;
  border: 1.5px solid var(--border);
  background: white; cursor: pointer; transition: var(--transition);
  font-size: 0.88rem; font-weight: 600; color: var(--text-mid);
  font-family: var(--font-body);
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.cat-tab svg { width: 16px; height: 16px; }

/* ===== TOOL CARDS ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none; color: inherit;
  transition: var(--transition);
  display: flex; flex-direction: column; gap: 0.75rem;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0; transition: var(--transition);
}
.tool-card:hover::after { opacity: 1; }

.tool-icon-wrap {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tool-icon-wrap svg { width: 24px; height: 24px; }

.icon-pdf { background: #FEF2F2; color: #EF4444; }
.icon-image { background: #ECFDF5; color: #10B981; }
.icon-text { background: #FFFBEB; color: #F59E0B; }
.icon-utility { background: #F5F3FF; color: #7C3AED; }
.icon-blue { background: #EFF6FF; color: #2563EB; }

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 0.98rem; font-weight: 700; color: var(--text-dark);
}
.tool-card p { font-size: 0.84rem; color: var(--text-light); line-height: 1.5; }
.tool-card .arrow {
  margin-top: auto; align-self: flex-start;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-subtle); display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.tool-card:hover .arrow { background: var(--primary); color: white; }
.tool-card .arrow svg { width: 14px; height: 14px; }

.tag-new {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent-warm); color: white;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 100px;
}
.tag-hot {
  position: absolute; top: 12px; right: 12px;
  background: var(--danger); color: white;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 100px;
}

/* ===== WHY SECTION ===== */
.why-section {
  background: linear-gradient(135deg, var(--text-dark) 0%, #1E293B 100%);
  padding: 5rem 1.5rem;
}
.why-inner { max-width: 1200px; margin: 0 auto; }
.why-section .section-tag { background: rgba(37,99,235,0.3); color: #93C5FD; }
.why-section h2 { color: white; }
.why-section .section-header p { color: #94A3B8; }
.why-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem; margin-top: 2.5rem;
}
.why-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius); padding: 1.5rem;
  transition: var(--transition);
}
.why-card:hover { background: rgba(255,255,255,0.08); border-color: rgba(37,99,235,0.5); }
.why-card .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.why-card h3 { color: white; font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 0.4rem; }
.why-card p { color: #94A3B8; font-size: 0.88rem; line-height: 1.6; }

/* ===== FOOTER ===== */
footer {
  background: var(--text-dark); color: #94A3B8;
  padding: 3.5rem 1.5rem 2rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem; margin-bottom: 3rem;
}
.footer-brand .logo { color: white; margin-bottom: 0.75rem; display: flex; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; max-width: 260px; }
.footer-col h4 {
  font-family: var(--font-display); font-weight: 700;
  color: white; font-size: 0.9rem; margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { color: #94A3B8; text-decoration: none; font-size: 0.87rem; transition: var(--transition); }
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.footer-bottom p { font-size: 0.84rem; }

/* ===== TOOL PAGE LAYOUT ===== */
.tool-page { max-width: 860px; margin: 0 auto; padding: 3rem 1.5rem; }
.tool-page-header {
  display: flex; align-items: flex-start; gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.tool-page-icon {
  width: 60px; height: 60px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tool-page-icon svg { width: 30px; height: 30px; }
.tool-page-header h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 1.8rem;
  letter-spacing: -0.5px; color: var(--text-dark); margin-bottom: 0.3rem;
}
.tool-page-header p { color: var(--text-light); font-size: 0.95rem; }

/* ===== UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center; cursor: pointer;
  transition: var(--transition);
  background: white;
  position: relative;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-icon {
  width: 56px; height: 56px; border-radius: var(--radius);
  background: var(--primary-light); display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto 1rem; color: var(--primary);
}
.upload-icon svg { width: 28px; height: 28px; }
.upload-area h3 { font-family: var(--font-display); font-weight: 700; color: var(--text-dark); margin-bottom: 0.4rem; }
.upload-area p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1.25rem; }
.upload-area .formats { font-size: 0.8rem; color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,0.4); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-mid); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: white; box-shadow: 0 4px 14px rgba(16,185,129,0.3); }
.btn-success:hover { background: #059669; }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn svg { width: 18px; height: 18px; }

/* ===== FILE LIST ===== */
.file-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }
.file-item {
  display: flex; align-items: center; gap: 0.75rem;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  font-size: 0.88rem;
}
.file-item-icon { color: var(--primary); flex-shrink: 0; }
.file-item-name { flex: 1; font-weight: 500; color: var(--text-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-muted); font-size: 0.82rem; flex-shrink: 0; }
.file-item-remove {
  color: var(--text-muted); cursor: pointer; padding: 4px;
  border-radius: 4px; transition: var(--transition); border: none; background: none;
}
.file-item-remove:hover { color: var(--danger); background: #FEF2F2; }

/* ===== CONTROLS ===== */
.tool-controls {
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-top: 1.25rem;
}
.control-group { margin-bottom: 1.25rem; }
.control-group:last-child { margin-bottom: 0; }
.control-label {
  display: block; font-size: 0.88rem; font-weight: 600;
  color: var(--text-mid); margin-bottom: 0.5rem;
}
.control-input, .control-select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.92rem; color: var(--text-dark);
  background: var(--bg); outline: none; transition: var(--transition);
}
.control-input:focus, .control-select:focus { border-color: var(--primary); background: white; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== OUTPUT ===== */
.output-section {
  margin-top: 1.5rem; background: white;
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
}
.output-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.output-header h3 { font-family: var(--font-display); font-weight: 700; color: var(--text-dark); font-size: 1rem; }
.output-preview { display: flex; justify-content: center; padding: 1.5rem; background: var(--bg-subtle); border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.output-preview img { max-width: 100%; max-height: 300px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.output-textarea {
  width: 100%; min-height: 200px; padding: 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace; font-size: 0.88rem;
  line-height: 1.7; color: var(--text-dark); background: var(--bg-subtle);
  resize: vertical; outline: none;
}

/* ===== HOW TO USE ===== */
.how-to { margin-top: 3rem; }
.how-to h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--text-dark); margin-bottom: 1.5rem; }
.steps { display: flex; flex-direction: column; gap: 1rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  font-family: var(--font-display); font-weight: 700; font-size: 0.88rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-content h3 { font-weight: 600; color: var(--text-dark); font-size: 0.95rem; margin-bottom: 0.2rem; }
.step-content p { color: var(--text-light); font-size: 0.88rem; line-height: 1.6; }

/* ===== FAQ ===== */
.faq { margin-top: 3rem; }
.faq h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--text-dark); margin-bottom: 1.5rem; }
.faq-item { border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.75rem; overflow: hidden; }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; background: white; border: none;
  font-family: var(--font-body); font-weight: 600; font-size: 0.93rem;
  color: var(--text-dark); cursor: pointer; text-align: left; transition: var(--transition);
}
.faq-question:hover { background: var(--bg-subtle); }
.faq-question .chevron { transition: transform 0.22s ease; flex-shrink: 0; }
.faq-answer { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: all 0.3s ease; }
.faq-answer p { color: var(--text-light); font-size: 0.9rem; line-height: 1.7; padding-bottom: 1rem; }
.faq-item.open .faq-question { background: var(--primary-light); color: var(--primary); }
.faq-item.open .faq-question .chevron { transform: rotate(180deg); }
.faq-item.open .faq-answer { max-height: 300px; }

/* ===== PROGRESS ===== */
.progress-bar-wrap { margin-top: 1rem; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--text-light); margin-bottom: 0.5rem; }
.progress-bar { height: 6px; background: var(--bg-subtle); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 100px; transition: width 0.4s ease; width: 0%; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.6rem; }
.toast {
  background: var(--text-dark); color: white;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: slideIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== STATS CHIPS ===== */
.stat-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.stat-chip {
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 14px;
  font-size: 0.85rem; font-weight: 600; color: var(--text-mid);
}
.stat-chip span { color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: white; padding: 1.5rem;
    border-top: 1px solid var(--border); gap: 0.25rem; z-index: 99;
    overflow-y: auto;
  }
  .nav-links.open a { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 1rem; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .control-row { grid-template-columns: 1fr; }
  .hero { padding: 4rem 1.5rem 3.5rem; }
  .hero-stats { gap: 1.5rem; }
  .tool-page-header { flex-direction: column; gap: 1rem; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
}
