/* ============================================================
   ONIONSEARCH — Stylesheet
   Design: dark, minimalista, leggibile su entrambe le reti
   ============================================================ */

:root {
    --bg:           #0d0f14;
    --bg-card:      #161922;
    --bg-input:     #1e2230;
    --border:       #2a2f42;
    --accent:       #7c5cfc;
    --accent-hover: #9b82fd;
    --accent-dim:   rgba(124, 92, 252, 0.12);
    --text:         #e2e4ef;
    --text-muted:   #7a7f99;
    --text-dim:     #4a4f66;
    --green:        #3ecf8e;
    --red:          #f66;
    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 2px 16px rgba(0,0,0,.45);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---- LAYOUT ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---- HEADER ---- */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    background: rgba(13,15,20,.95);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.site-logo span { color: var(--accent); }

.header-search {
    flex: 1;
    min-width: 200px;
}

.header-search form {
    display: flex;
    gap: 0.5rem;
}

.header-search input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    outline: none;
    transition: border-color .2s;
}

.header-search input:focus { border-color: var(--accent); }

.header-nav {
    display: flex;
    gap: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.header-nav a { color: var(--text-muted); }
.header-nav a:hover { color: var(--text); }

/* ---- HERO (homepage) ---- */
.hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
}

.hero-logo {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.hero-logo span { color: var(--accent); }

.hero-tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto 1rem;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1.5px solid var(--border);
    transition: border-color .2s;
}

.search-bar:focus-within { border-color: var(--accent); }

.search-bar input {
    flex: 1;
    background: var(--bg-input);
    border: none;
    color: var(--text);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    outline: none;
}

.search-bar button {
    background: var(--accent);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.4rem;
    transition: background .2s;
}

.search-bar button:hover { background: var(--accent-hover); }

.search-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ---- STATS BAR ---- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem 0 2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.stats-bar strong { color: var(--green); }

/* ---- CATEGORIE GRID ---- */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    display: block;
    color: var(--text);
}

.cat-card:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text);
}

.cat-card__icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.cat-card__label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cat-card__desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.cat-card__count {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

/* ---- RISULTATI RECENTI ---- */
.results-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 3rem; }

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: border-color .2s;
}

.result-card:hover { border-color: var(--accent); }

.result-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.result-card__title:hover { color: var(--accent-hover); }

.result-card__url {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 0.4rem;
}

.result-card__desc {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.result-card__meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: 0.03em;
}

.badge--green { background: rgba(62,207,142,.1); color: var(--green); }
.badge--muted { background: rgba(122,127,153,.1); color: var(--text-muted); }

/* ---- PAGINAZIONE ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.5rem 0 3rem;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    text-decoration: none;
    transition: all .15s;
}

.page-btn:hover, .page-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ---- SIDEBAR FILTRI ---- */
.search-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
    padding: 2rem 0;
}

@media (max-width: 700px) {
    .search-layout { grid-template-columns: 1fr; }
}

.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    position: sticky;
    top: 72px;
}

.sidebar-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.filter-list { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }

.filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all .15s;
}

.filter-list a:hover, .filter-list a.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.filter-count {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* ---- FOOTER ---- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
}

.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text-muted); }

/* ---- TOR BANNER ---- */
.tor-banner {
    background: var(--accent-dim);
    border-bottom: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent);
}

.clearnet-notice {
    background: rgba(62,207,142,.08);
    border: 1px solid rgba(62,207,142,.25);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    color: var(--green);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ---- UTILITY ---- */
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
