
* {
    box-sizing: border-box;
}

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #6366f1;
}

body.dark {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --primary: #818cf8;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
}

.container {
    max-width: 1150px;
    margin: auto;
    padding: 0 20px;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-content {
    height: 75px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    color: var(--text);
    font-size: 25px;
    font-weight: bold;
}

.theme-button {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 20px;
    cursor: pointer;
}

.hero {
    text-align: center;
    padding: 80px 20px 60px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 55px);
    margin-bottom: 15px;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
}

.search {
    max-width: 650px;
    width: 100%;
    padding: 17px;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-top: 25px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.category {
    padding: 12px 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
}

.category.active {
    background: var(--primary);
    color: white;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    padding-bottom: 80px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 25px;
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card-icon {
    font-size: 32px;
}

.card h2 {
    font-size: 20px;
}

.card p {
    color: var(--muted);
    line-height: 1.6;
    min-height: 50px;
}

.card a,
.tool-box button {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    text-decoration: none;
    cursor: pointer;
}

.tool-page {
    max-width: 800px;
    margin: 60px auto 100px;
}

.tool-page h1 {
    font-size: 35px;
}

.tool-description {
    color: var(--muted);
    line-height: 1.8;
}

.tool-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px;
    margin-top: 30px;
}

.tool-box input,
.tool-box textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 15px;
    background: var(--bg);
    color: var(--text);
}

.tool-box textarea {
    min-height: 160px;
    resize: vertical;
}

.tool-box button {
    margin: 5px 5px 10px 0;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: var(--bg);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.footer {
    padding: 30px 0;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

[hidden] {
    display: none !important;
}

@media(max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 50px 10px;
    }

    .tool-box {
        padding: 20px;
    }
}
