:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #1e293b;
  --bg-color: #f8fafc;
  --text-color: #334155;
  --border-color: #e2e8f0;
  --success: #10b981;
  --error: #ef4444;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --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-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

/* Header & Nav */
header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo a:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 5rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--bg-color) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 3.5rem;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  line-height: 1.2;
  font-weight: 800;
}

.hero p {
  font-size: 1.25rem;
  color: #475569;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: white;
  color: var(--secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--secondary);
}

.btn-danger {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Container & Sections */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.content-section {
  background: white;
  padding: 2.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-color);
}

.content-section h2 {
  color: var(--secondary);
  font-size: 2rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.content-section h2:first-child {
  margin-top: 0;
}

.content-section h3 {
  color: var(--secondary);
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
}

.content-section p {
  margin-bottom: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75;
}

.content-section ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.content-section li {
  margin-bottom: 0.5rem;
}

.content-section pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.content-section code {
  font-family: var(--font-mono);
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  color: var(--error);
  font-size: 0.9em;
}
.content-section pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Tool Grid & Cards */
.tool-grid, .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.tool-card, .blog-card {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.tool-card:hover, .blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tool-card h3, .blog-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.tool-card p, .blog-card p {
  color: #475569;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Tool Interface */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  min-height: 600px;
}

.tool-panel {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--secondary);
}

.editor-area {
  flex: 1;
  width: 100%;
  padding: 1rem;
  border: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
  background: #ffffff;
}

.output-area {
  flex: 1;
  padding: 1rem;
  overflow: auto;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.toolbar {
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

#status-msg {
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  display: none;
  margin-bottom: 1.5rem;
  text-align: center;
}
.status-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
  display: block !important;
}
.status-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
  display: block !important;
}

/* Footer */
footer {
  background: var(--secondary);
  color: #f1f5f9;
  padding: 4rem 1rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h4 {
  margin-bottom: 1.25rem;
  color: white;
  font-size: 1.125rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.75rem;
}

.footer-section a {
  color: #94a3b8;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #334155;
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Syntax Highlighting */
.json-key { color: #9cdcfe; }
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-boolean { color: #569cd6; }
.json-null { color: #569cd6; font-weight: bold; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.125rem; }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links li {
    width: 100%;
    text-align: center;
  }
  
  .tool-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .tool-panel {
    min-height: 400px;
  }
  
  .toolbar {
    justify-content: center;
  }
  
  .toolbar .btn {
    flex: 1 1 45%;
  }
  .toolbar #btn-clear {
    margin-left: 0 !important;
    width: 100%;
  }
}

@media (max-width: 414px) {
  .content-section {
    padding: 1.5rem;
  }
  .toolbar .btn {
    flex: 1 1 100%;
  }
}
