:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --text-light: #9ca3af;
    --bg-main: #ffffff;
    --bg-alt: #f3f4f6;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

img, svg {
    max-width: 100%;
    height: auto;
}

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

/* Header & Nav */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.brand svg {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.9375rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn svg {
    stroke: var(--text-main);
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    text-align: center;
    background-color: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

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

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Content Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.prose {
    max-width: 800px;
    margin: 0 auto;
}

.prose h2 {
    font-size: 1.875rem;
    margin: 2.5rem 0 1rem;
}

.prose h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose pre {
    background-color: var(--bg-alt);
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.prose code {
    font-family: monospace;
    font-size: 0.875em;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

/* Tool Interface */
.tool-container {
    max-width: 1000px;
    margin: 3rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tool-header {
    background: var(--bg-alt);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.tool-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
    font-family: monospace;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.tool-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: 1rem;
    height: 1rem;
}

.tool-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.output-panel {
    display: flex;
    flex-direction: column;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.output-stats {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.xml-output {
    flex: 1;
    background-color: var(--bg-alt);
    color: var(--text-main);
    padding: 1rem;
    font-family: monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    min-height: 300px;
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.output-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.status-message {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    display: none;
    font-weight: 500;
}

.status-message.show {
    display: block;
}

.status-message.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* FAQ Accordion */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.25rem;
    background: none;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-muted);
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--text-muted);
}

.faq-item.active .faq-answer {
    padding: 0 1.25rem 1.25rem;
    max-height: 500px;
}

/* Footer */
.site-footer {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-about p {
    color: var(--text-muted);
    margin-top: 1rem;
}

.footer-links h4 {
    font-weight: 600;
    margin-bottom: 1.25rem;
}

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

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-8 { margin-top: 2rem; }
.text-muted { color: var(--text-muted); }

/* Blog specific */
.article-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
.tag {
    background: var(--bg-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .tool-body {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2.25rem;
    }
    .hero-actions {
        flex-direction: column;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 4rem;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    }
    .nav-links.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
}

/* Accessibility: Skip to Content */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}
