:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px 0 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);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; font-size: 16px; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.logo span { color: var(--primary); }

.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a { color: var(--text-main); font-weight: 500; }
.nav-links a:hover { color: var(--primary); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); }

/* Hero Section */
.hero { text-align: center; padding: 60px 20px; background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%); border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 2.5rem; margin-bottom: 15px; color: var(--text-main); }
.hero p { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* Grid Layout */
.section { padding: 50px 0; }
.section-title { font-size: 2rem; margin-bottom: 30px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { font-size: 1.25rem; margin-bottom: 10px; color: var(--text-main); }
.card p { color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; }
.card-btn { display: inline-block; padding: 10px 16px; background: var(--bg-body); color: var(--primary); font-weight: 600; border-radius: var(--radius-md); text-align: center; border: 1px solid var(--border); transition: all 0.2s; }
.card-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Breadcrumb */
.breadcrumb { padding: 20px 0; color: var(--text-muted); font-size: 0.9rem; }
.breadcrumb a { color: var(--primary); }
.breadcrumb span { margin: 0 8px; }

/* Tool Page Layout */
.tool-page-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; margin-top: 20px; }
.main-content { background: var(--bg-card); padding: 30px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.sidebar { }

/* Forms & Tools */
.tool-box { margin: 30px 0; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-control { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); font-family: inherit; font-size: 1rem; transition: border-color 0.2s; resize: vertical; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
textarea.form-control { min-height: 120px; }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn { padding: 10px 20px; border: none; border-radius: var(--radius-md); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #e2e8f0; color: var(--text-main); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-success { background: var(--success); color: white; }

.output-box { margin-top: 30px; padding: 20px; background: var(--bg-body); border: 1px solid var(--border); border-radius: var(--radius-md); position: relative; }
.output-content { white-space: pre-wrap; word-break: break-all; min-height: 60px; }
.output-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 5px; }

/* Content Formatting */
.content-section { margin-top: 50px; }
.content-section h2 { margin: 30px 0 15px; font-size: 1.75rem; }
.content-section h3 { margin: 20px 0 10px; font-size: 1.25rem; }
.content-section p { margin-bottom: 15px; }
.content-section ul, .content-section ol { margin-bottom: 15px; padding-left: 20px; }
.content-section li { margin-bottom: 8px; }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 15px; overflow: hidden; }
.faq-question { padding: 15px 20px; background: var(--bg-card); cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.faq-question:after { content: '+'; font-size: 1.2rem; transition: transform 0.3s; }
.faq-item.active .faq-question:after { transform: rotate(45deg); }
.faq-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; background: var(--bg-body); }
.faq-item.active .faq-answer { padding: 15px 20px; max-height: 500px; }

/* Ads */
.ad-container { background: #f1f5f9; border: 1px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.875rem; margin: 20px 0; overflow: hidden; }
.ad-horizontal { width: 100%; height: 90px; }
.ad-rectangle { width: 300px; height: 250px; margin: 20px auto; }

/* Footer */
footer { background: #0f172a; color: #f8fafc; padding: 60px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { font-size: 1.25rem; margin-bottom: 20px; color: #fff; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid #334155; color: #94a3b8; font-size: 0.875rem; }

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.d-none { display: none !important; }

/* Responsive */
@media (max-width: 992px) {
  .tool-page-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .nav-links.active { display: flex; }
  .mobile-menu-btn { display: block; }
  .hero h1 { font-size: 2rem; }
}
