@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.back-link {
    display: table;
    margin: 0 auto 1.5rem auto;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.back-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.description {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tool-card:hover {
    box-shadow: 0 8px 24px 0 rgba(79, 70, 229, 0.12);
    transform: translateY(-2px) scale(1.01);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tool-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.tool-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.tool-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.feature {
    background: #f1f5f9;
    color: var(--primary-color);
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

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

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 900px) {
    .tools-grid {
        flex-direction: column;
        align-items: center;
    }

    .tool-card {
        width: 100%;
        max-width: 400px;
    }
}

/* --- Tool Page Specific Styles --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    outline: none;
    background-color: #fafafa;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

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

.btn-success {
    background-color: var(--success-color) !important;
}

.error-msg {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.ads-placeholder {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    margin: 2rem 0;
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .card {
        padding: 1.25rem;
    }

    .btn-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}