@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --bg-color: #f8fafc;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-solid: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: rgba(226, 232, 240, 0.8);
    --focus-ring: rgba(99, 102, 241, 0.4);
    --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.03) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

header { padding: 3rem 2rem 1rem; text-align: center; }
header h1 { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.03em; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; }
header p { color: var(--text-muted); font-size: 1.1rem; font-weight: 500; }

.site-nav { text-align: center; padding: 0.5rem 1rem 0; font-size: 0.85rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0; }
.site-nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; padding: 0.25rem 0.4rem; transition: color 0.2s; }
.site-nav a:hover { color: var(--primary); }
.site-nav a.active { color: var(--primary); }
.site-nav .sep { color: #cbd5e1; margin: 0 0.15rem; }

.tool-section { max-width: 720px; margin: 2rem auto; padding: 0 1.5rem; animation: fadeIn 0.8s ease-out forwards; }
.tool-container { background: var(--surface); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 2.5rem; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05); }
.form-group { margin-bottom: 1.5rem; }
label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-main); font-size: 0.95rem; }
label svg { width: 18px; height: 18px; color: var(--primary); }

.category-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.category-btn { flex: 0 1 auto; padding: 0.55rem 0.9rem; background: var(--surface-solid); border: 2px solid #e2e8f0; border-radius: 10px; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-align: center; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; text-transform: capitalize; }
.category-btn.all-btn { font-weight: 700; }
.cat-count { font-size: 0.7rem; font-weight: 500; color: #94a3b8; }
.category-btn:hover { border-color: var(--primary); color: var(--text-main); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }
.category-btn.active { background: var(--primary-gradient); color: white; border-color: transparent; box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.4); transform: translateY(-2px); }
.category-btn.active .cat-count { color: rgba(255, 255, 255, 0.9); }

.input-wrapper { position: relative; }
select, input[type="number"] { width: 100%; padding: 1rem; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 1rem; font-family: inherit; background-color: var(--surface-solid); color: var(--text-main); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); appearance: none; cursor: pointer; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1.2rem; }
select:focus, input[type="number"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus-ring); transform: translateY(-1px); }

.btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; background: var(--text-main); color: white; border: none; padding: 1.1rem; font-size: 1.1rem; font-weight: 700; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 10px 20px -10px rgba(15, 23, 42, 0.5); margin-top: 1.5rem; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 15px 25px -10px rgba(15, 23, 42, 0.6); background: #1e293b; }
.btn:active { transform: translateY(0); }

.output-wrapper { margin-top: 2.5rem; position: relative; }
.output-box { background: #0f172a; color: #f8fafc; border-radius: 16px; padding: 1.75rem 1.75rem 3.5rem; min-height: 160px; font-size: 1.25rem; font-weight: 500; line-height: 1.8; word-wrap: break-word; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); transition: all 0.3s ease; }
.output-box.updating { opacity: 0.5; transform: scale(0.98); }
.output-actions { position: absolute; bottom: 0.75rem; right: 0.75rem; display: flex; gap: 0.4rem; }
.btn-secondary { background-color: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.15); padding: 0.45rem 0.75rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: all 0.2s; display: flex; align-items: center; gap: 0.35rem; }
.btn-secondary:hover { background-color: rgba(255, 255, 255, 0.15); color: white; }
.stats-line { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.75rem; min-height: 1.2em; }

.content-section { max-width: 900px; margin: 0 auto 4rem; padding: 0 1.5rem; display: flex; flex-direction: column; gap: 2rem; animation: fadeIn 0.8s ease-out 0.15s both; }
.content-card { background: var(--surface-solid); padding: 2rem; border-radius: var(--radius); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02); border: 1px solid var(--border); transition: transform 0.3s ease; }
.content-card:hover { transform: translateY(-3px); }
.content-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; color: var(--text-main); }
.content-card p { color: var(--text-muted); margin-bottom: 1rem; }
.content-card p:last-child { margin-bottom: 0; }
.content-card a { color: var(--primary); text-decoration: none; font-weight: 600; }
.content-card a:hover { text-decoration: underline; }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; margin-top: 0.75rem; }
.category-pill { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.1rem; transition: all 0.2s ease; }
.category-pill:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(99, 102, 241, 0.08); }
.category-pill-name { font-weight: 700; color: var(--text-main); font-size: 0.9rem; text-transform: capitalize; }
.category-pill-count { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

.cross-link-box { background: linear-gradient(135deg, #f0f0ff 0%, #fdf2f8 100%); border: 1px solid rgba(99, 102, 241, 0.15); border-radius: 16px; padding: 1.5rem 2rem; margin-top: 0.5rem; }
.cross-link-box h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.75rem; }
.cross-link-box p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.cross-links-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cross-link { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1rem; background: white; border: 2px solid #e2e8f0; border-radius: 10px; font-weight: 600; font-size: 0.85rem; color: var(--text-main); text-decoration: none; transition: all 0.2s; }
.cross-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1); }

.faq-list { display: flex; flex-direction: column; gap: 0; margin-top: 0.25rem; }
.faq-item { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-item h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.4rem; }
.faq-item p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 0; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 20px); background: #10b981; color: white; padding: 0.75rem 2rem; border-radius: 99px; font-weight: 600; opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); pointer-events: none; box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3); display: flex; align-items: center; gap: 0.5rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer { text-align: center; padding: 3rem 2rem; color: var(--text-muted); font-size: 0.9rem; }
footer a { color: var(--text-muted); font-weight: 600; text-decoration: none; }
footer a:hover { color: var(--primary); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
