:root {
    --primary-color: #2563eb;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --border-color: #e5e7eb;
    --hover-bg: #f9fafb;
    --code-bg: #f3f4f6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    margin-bottom: 3rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b7280;
}

.tools-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tool-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.tool-card:hover {
    background-color: var(--hover-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tool-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-card h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

.tool-card h2 a:hover {
    text-decoration: underline;
}

.tool-description {
    color: #4b5563;
    margin-bottom: 0.75rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--code-bg);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: #6b7280;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Tool page styles */
.tool-page {
    max-width: 1200px;
}

.tool-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.tool-interface {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.output-preview {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--code-bg);
    overflow: auto;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #1d4ed8;
}

button.secondary {
    background-color: #6b7280;
}

button.secondary:hover {
    background-color: #4b5563;
}

.info-box {
    background-color: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.info-box h3 {
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .tool-interface {
        grid-template-columns: 1fr 1fr;
    }
}
