:root {
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --primary-light: #C4B5FD;
  --bg: #F5F3FF;
  --bg-card: #FFFFFF;
  --bg-input: #F1F0FB;
  --text: #1E1B4B;
  --text-dim: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.header { background: white; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.2rem; }
.logo-icon { font-size: 1.4rem; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text-dim); text-decoration: none; font-size: 0.82rem; font-weight: 500; padding: 4px 8px; border-radius: 6px; transition: all 0.2s; }
.nav a:hover, .nav a.active { color: var(--primary); background: #F5F3FF; }
.lang-switch { font-size: 0.8rem; font-weight: 600; }
.lang-switch a { padding: 2px 4px; }
.lang-switch a.active { background: var(--primary); color: white; border-radius: 4px; }

.hero { text-align: center; padding: 50px 0 30px; background: linear-gradient(135deg, #F5F3FF, #EDE9FE); }
.hero-title { font-size: 2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 8px; }
.hero-subtitle { color: var(--text-dim); }

.tools-grid-section { padding: 40px 0; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text); transition: all 0.2s; display: flex; flex-direction: column; }
.tool-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(124,58,237,0.12); transform: translateY(-2px); }
.tool-icon { font-size: 2rem; margin-bottom: 10px; }
.tool-card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.tool-card p { font-size: 0.85rem; color: var(--text-dim); }

.tool-page { padding: 30px 0; }
.tool-header { text-align: center; margin-bottom: 24px; }
.tool-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.tool-header p { color: var(--text-dim); font-size: 0.9rem; }

.convert-form { max-width: 700px; margin: 0 auto; }

.options-bar {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
  padding: 16px; background: white; border-radius: var(--radius); border: 1px solid var(--border);
}
.option-group { flex: 1; min-width: 140px; }
.option-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; color: var(--text-dim); }
.option-group select, .option-group input[type="number"], .text-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; background: var(--bg-input); font-family: inherit;
}
.option-group select:focus, .text-input:focus { outline: none; border-color: var(--primary); }
.option-group input[type="range"] { width: 100%; }
.resize-inputs { display: flex; align-items: center; gap: 6px; }
.resize-inputs input { width: 80px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; background: var(--bg-input); }
.resize-inputs span { color: var(--text-dim); }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center;
  cursor: pointer; transition: all 0.2s; background: white;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: #F5F3FF; }
.drop-content p { color: var(--text-dim); margin: 8px 0; }
.drop-icon { font-size: 2.5rem; }

.btn-primary { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.2s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-full { width: 100%; margin-top: 16px; padding: 14px; }

.results-header { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 12px; }
.results-header h3 { font-size: 1rem; }

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: white; border-radius: 8px; border: 1px solid var(--border);
}
.file-item-info { display: flex; flex-direction: column; }
.file-item-name { font-weight: 600; font-size: 0.9rem; }
.file-item-meta { font-size: 0.8rem; color: var(--text-dim); }
.file-item-savings { font-weight: 600; color: var(--success); font-size: 0.9rem; }

.pdf-file-list { margin-top: 12px; }
.pdf-file-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: white; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 6px;
}
.pdf-file-item .file-name { font-size: 0.9rem; font-weight: 500; }
.pdf-file-item .file-size { font-size: 0.8rem; color: var(--text-dim); }
.remove-btn { background: #FEE2E2; color: #DC2626; border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 0.8rem; }

.result-card { background: white; border-radius: var(--radius); padding: 20px; text-align: center; border: 1px solid var(--border); margin-top: 16px; }
.result-card p { margin-bottom: 12px; color: var(--text-dim); }

.form-group { margin: 16px 0; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }

.ad-slot { text-align: center; padding: 12px 0; min-height: 90px; }

.features { padding: 40px 0; background: linear-gradient(135deg, #F5F3FF, #EDE9FE); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.feature-card { background: white; border-radius: var(--radius); padding: 20px; text-align: center; border: 1px solid var(--border); }
.feature-icon { font-size: 1.6rem; margin-bottom: 6px; }
.feature-card h3 { font-size: 0.9rem; margin-bottom: 4px; }
.feature-card p { font-size: 0.8rem; color: var(--text-dim); }

.faq { padding: 40px 0; }
.section-title { text-align: center; font-size: 1.3rem; margin-bottom: 20px; }
.faq-list { max-width: 650px; margin: 0 auto; }
.faq-item { margin-bottom: 6px; background: white; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.faq-q { width: 100%; padding: 12px 16px; background: transparent; border: none; color: var(--text); font-size: 0.9rem; font-weight: 600; text-align: left; cursor: pointer; font-family: inherit; display: flex; justify-content: space-between; }
.faq-q::after { content: '+'; color: var(--primary); font-size: 1.2rem; transition: transform 0.2s; }
.faq-q.open::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s; }
.faq-a p { padding: 0 16px 12px; font-size: 0.85rem; color: var(--text-dim); }

.footer { padding: 20px 0; text-align: center; border-top: 1px solid var(--border); background: white; }
.footer-text { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 4px; }
.footer-disclaimer { font-size: 0.7rem; color: var(--text-dim); opacity: 0.7; }

@media (max-width: 640px) {
  .nav { gap: 8px; }
  .nav a { font-size: 0.75rem; }
  .options-bar { flex-direction: column; }
  .hero-title { font-size: 1.5rem; }
}
