:root {
  --primary: #6366f1;
  --secondary: #a855f7;
  --accent: #ec4899;
  
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

[data-theme="dark"] {
  --bg-color: #020617;
  --surface-color: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 1rem 0; transition: all 0.3s;
}
.header.scrolled {
  padding: 0.75rem 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.25rem; }
.logo-icon { 
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center; color: white;
}
.nav-links { display: flex; gap: 2rem; }
.nav-link { font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.nav-link:hover { color: var(--text-main); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md);
  font-weight: 600; transition: all 0.2s; gap: 0.5rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.btn-secondary {
  background: var(--surface-color); color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { border-color: var(--primary); }
.btn-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-muted); transition: 0.2s;
}
.btn-icon:hover { background: var(--surface-color); color: var(--text-main); }

/* Hero */
.hero { padding: 10rem 0 6rem; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  z-index: -1; pointer-events: none;
}
.hero h1 { font-size: clamp(3rem, 6vw, 5.5rem); line-height: 1.1; margin-bottom: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-badges { display: flex; justify-content: center; gap: 1.5rem; margin-top: 3rem; flex-wrap: wrap; }
.badge { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); background: var(--surface-color); padding: 0.5rem 1rem; border-radius: 99px; border: 1px solid var(--border-color); }

/* Sections */
.section { padding: 8rem 0; }
.section-header { text-align: center; margin-bottom: 4rem; max-width: 700px; margin-inline: auto; }
.section-header h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.section-header p { font-size: 1.125rem; color: var(--text-muted); }

/* Grid */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.card {
  background: var(--surface-color); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); padding: 2.5rem; transition: 0.3s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,0.3); }
.card-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: rgba(99,102,241,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem;
}
.card h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.card p { color: var(--text-muted); }

/* Content Grid */
.content-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.content-layout.reverse { direction: rtl; }
.content-layout.reverse > * { direction: ltr; }

/* Tool Layout */
.tool-grid { display: grid; grid-template-columns: 350px 1fr; gap: 2rem; margin-top: 4rem; min-height: 70vh;}
.tool-sidebar { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-xl); padding: 1.5rem; height: max-content; position: sticky; top: 6rem; }
.tool-main { display: flex; flex-direction: column; gap: 2rem; }

.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--text-main); }
.form-control { width: 100%; padding: 0.75rem 1rem; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-main); transition: 0.2s; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
textarea.form-control { min-height: 120px; resize: vertical; }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.option-btn { padding: 0.5rem; text-align: center; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 0.875rem; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.option-btn:hover { border-color: var(--primary); color: var(--text-main); }
.option-btn.active { background: rgba(99,102,241,0.1); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.output-card { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius-xl); padding: 2rem; position: relative; transition: 0.3s; margin-bottom: 1.5rem; }
.output-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.output-content { font-size: 1.125rem; line-height: 1.6; white-space: pre-wrap; margin-bottom: 1.5rem; color: var(--text-main); }
.stats-row { display: flex; gap: 1.5rem; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap;}
.stat-item { display: flex; align-items: center; gap: 0.25rem; }
.stat-item span { color: var(--text-main); font-weight: 600; }

.loader { width: 24px; height: 24px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer { background: var(--surface-color); border-top: 1px solid var(--border-color); padding: 6rem 0 2rem; margin-top: 4rem;}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer h4 { font-weight: 600; margin-bottom: 1.5rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links a { color: var(--text-muted); transition: 0.2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { padding-top: 2rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.875rem; }
.trust-badge { font-size: 0.75rem; padding: 0.25rem 0.75rem; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 99px; }

/* Content Pages */
.page-header { padding: 10rem 0 4rem; text-align: center; background: var(--surface-color); border-bottom: 1px solid var(--border-color); margin-bottom: 4rem; }
.page-header h1 { font-size: 3.5rem; letter-spacing: -0.02em; margin-bottom: 1rem; }
.content-container { max-width: 800px; margin: 0 auto; padding-bottom: 8rem; }
.content-container h2 { font-size: 2rem; margin: 3rem 0 1.5rem; letter-spacing: -0.02em; }
.content-container h3 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.content-container ul { list-style: disc; padding-left: 2rem; margin-bottom: 1.5rem; color: var(--text-muted); }

/* FAQ */
.faq-item { border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 1rem; background: var(--surface-color); overflow: hidden; }
.faq-q { padding: 1.5rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text-main); }
.faq-a { padding: 0 1.5rem; max-height: 0; overflow: hidden; transition: 0.3s; color: var(--text-muted); }
.faq-item.active .faq-a { padding-bottom: 1.5rem; max-height: 500px; }
.faq-icon { transition: transform 0.3s; }
.faq-item.active .faq-icon { transform: rotate(180deg); }

/* Blog */
.blog-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.blog-img { height: 200px; background: linear-gradient(135deg, var(--bg-color), var(--border-color)); }
.blog-content { padding: 2rem; display: flex; flex-direction: column; flex: 1; }
.blog-meta { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; display: flex; gap: 1rem; }
.blog-title { font-size: 1.25rem; margin-bottom: 1rem; font-weight: 700; line-height: 1.4; }
.blog-excerpt { color: var(--text-muted); margin-bottom: 1.5rem; flex: 1; }
.blog-link { color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }

/* Responsive */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 2.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}