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

:root {
    --bg: #0a0a0b;
    --panel: #111214;
    --border: #222326;
    --text: #e4e4e7;
    --muted: #71717a;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --font: 'Inter', system-ui, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
header {
    border-bottom: 1px solid var(--border);
    background: rgba(10,10,11,0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.logo { font-size: 1.2rem; font-weight: 700; }
.logo span { color: var(--accent); }
.logo a { color: var(--text); text-decoration: none; }
.onion-badge {
    font-size: 0.85rem;
    margin-left: 0.4rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    vertical-align: middle;
}
.onion-badge:hover { opacity: 1; }
.nav-links { display: flex; gap: 1rem; align-items: center; list-style: none; }
.nav-links a {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.logout-link { color: var(--danger) !important; }
.btn-register {
    background: var(--accent) !important;
    color: #fff !important;
    padding: 0.4rem 1rem;
    border-radius: 6px;
}

/* Search Hero */
.search-hero { padding: 5rem 1rem 3rem; text-align: center; }
.search-hero-small { padding: 2rem 1rem; }
.search-hero h1 { font-size: 2.75rem; font-weight: 700; margin-bottom: 0.5rem; }

/* Popular search tags */
.popular-tags {
    max-width: 640px;
    margin: 1rem auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}
.popular-tags-label {
    font-size: 0.8rem;
    color: var(--warning);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 0.25rem;
}
.popular-tag {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.popular-tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}
.subtitle { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }

.search-form { max-width: 640px; margin: 0 auto; }
.search-box {
    display: flex;
    align-items: center;
    background: var(--panel);
    border: 2px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.search-box:focus-within .search-icon {
    color: var(--accent);
}
.search-box .search-icon {
    color: var(--muted);
    font-size: 1rem;
    padding: 0 0.5rem 0 1.25rem;
    flex-shrink: 0;
}
.search-box input {
    flex: 1;
    background: none;
    border: none;
    padding: 0.85rem 0.5rem;
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    min-width: 0;
}
.btn-search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.85rem 1.5rem;
    margin: 3px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    flex-shrink: 0;
    border-radius: 11px;
    transition: background 0.15s;
}
.btn-search:hover { background: #1d4ed8; }

/* Features Grid (homepage) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    padding: 2rem 0 4rem;
}
.feature-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
}
.feature-card i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    background: rgba(59,130,246,0.08);
    border-radius: 10px;
    margin-left: auto;
    margin-right: auto;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

/* *Arr integration promo */
.arr-promo {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 1.75rem 0;
    overflow: hidden;
}
.arr-promo-content {
    padding: 2rem;
    text-align: center;
}
.arr-promo-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    border: none;
    padding: 0;
}
.arr-promo-content h2 i { color: var(--accent); }
.arr-promo-content p {
    color: var(--muted);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}
.arr-icons {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.arr-icons span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    transition: transform 0.2s;
}
.arr-icons span:hover { transform: scale(1.15); }
.arr-icons img { width: 36px; height: 36px; object-fit: contain; }
.arr-promo-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Results */
.results-header {
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.results-header h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0; }

.torrent-list { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 2rem; }

.torrent-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.torrent-card:hover { border-color: #333; }

.torrent-card-body { display: flex; gap: 1rem; padding: 1rem; align-items: flex-start; overflow: hidden; }

.torrent-poster-link {
    flex-shrink: 0;
    width: 55px;
    height: 82px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}
.torrent-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.torrent-info { flex: 1; min-width: 0; overflow: hidden; }
.torrent-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.torrent-title a { color: var(--text); text-decoration: none; }
.torrent-title a:hover { color: var(--accent); }

.torrent-meta { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.5rem; overflow: hidden; }
.tag {
    display: inline-block;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}
.tag-type { color: var(--warning); border-color: rgba(245,158,11,0.3); }
.tag-quality { color: var(--success); border-color: rgba(34,197,94,0.3); }
.tag-lang { color: var(--accent); border-color: rgba(59,130,246,0.3); }
.tag-adult { background: rgba(239,68,68,0.1); color: var(--danger); }

.torrent-stats {
    display: flex;
    gap: 1.25rem;
    font-size: 0.82rem;
    color: var(--muted);
    align-items: center;
    flex-wrap: wrap;
}
.torrent-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.torrent-stats i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}
.torrent-stats code { font-size: 0.72rem; color: #555; }

.torrent-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: flex-start;
    padding-top: 0.15rem;
}
.btn-magnet, .btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none !important;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    color: var(--muted);
    font-family: var(--font);
    line-height: 1;
}
.btn-magnet:hover, .btn-copy:hover {
    text-decoration: none !important;
}
.btn-magnet i, .btn-copy i {
    font-size: 0.9rem;
}
.btn-magnet:hover, .btn-copy:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Empty & Error */
.empty-state { text-align: center; padding: 4rem; color: var(--muted); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; }
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-danger { background: rgba(239,68,68,0.08); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(34,197,94,0.08); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}
.pagination .btn {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}
.pagination .btn:hover { border-color: var(--accent); text-decoration: none; }
.page-info { color: var(--muted); font-size: 0.9rem; }

/* Auth Pages */
.auth-container { max-width: 420px; margin: 4rem auto; }
.auth-container .logo { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-group input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
}
.form-group input:focus { outline: none; border-color: var(--accent); }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    text-decoration: none;
    text-align: center;
}
.btn:hover { background: #2563eb; text-decoration: none; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
td { font-size: 0.9rem; }
td code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(34,197,94,0.1); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--warning); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { text-align: center; }
.stat-val { font-size: 2rem; font-weight: 700; color: var(--accent); }

/* API Info */
.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text);
}

/* Footer */
main {
    flex: 1;
    padding-bottom: 2rem;
}

footer {
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
    margin-top: auto;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.footer-brand {
    max-width: 380px;
    min-width: 240px;
}
.footer-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: block;
}
.footer-logo span { color: var(--accent); }
.footer-brand p {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 160px;
}
.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-links a i { font-size: 0.8rem; width: 18px; text-align: center; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.03);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.footer-bottom p { margin: 0; }

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--panel);
    border-top: 1px solid var(--accent);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    z-index: 999;
    padding: 1rem;
}
.cookie-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.cookie-text {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    flex: 1;
    min-width: 200px;
}
.cookie-text i { color: var(--warning); }
.cookie-text a { color: var(--accent); }

/* Expandable File List */
.toggle-files {
    cursor: pointer;
    color: var(--accent);
    transition: color 0.15s;
}
.toggle-files:hover { color: #fff; }

.torrent-files {
    display: none;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    flex-shrink: 0;
}
.torrent-card.show-files .torrent-files { display: block; }
.torrent-card.show-files .toggle-files { color: #fff; }
.torrent-card.show-files .toggle-files i { transform: rotate(90deg); }

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.file-row:last-child { border-bottom: none; }
.file-name {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 1rem;
}
.file-size {
    color: var(--muted);
    flex-shrink: 0;
    font-size: 0.75rem;
}

/* Advertisements */
.ad-container {
    background: rgba(255,255,255,0.01);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-container::before {
    content: 'SPONSORED';
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    opacity: 0.6;
}
.ad-inner { width: 100%; }
.ad-inner img { max-width: 100%; height: auto; }

/* API Test Section */
.api-test {
    background: rgba(59,130,246,0.03);
    border: 1px dashed rgba(59,130,246,0.2);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}
.api-test h3 { margin-bottom: 1rem; }

/* Light Mode */
body.light {
    --bg: #f8fafc;
    --panel: #fff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-glow: rgba(37,99,235,0.15);
}
body.light .card { box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
body.light .card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
body.light header { background: rgba(255,255,255,0.9); }
body.light footer { background: rgba(0,0,0,0.02); }
body.light .code-block { background: #f1f5f9; color: #334155; }
body.light input, body.light select { background: #fff; }
body.light .btn-search { color: #fff; }
body.light .torrent-stats code { color: #94a3b8; }
body.light .badge-success { background: rgba(34,197,94,0.08); }
body.light .badge-danger { background: rgba(239,68,68,0.08); }
body.light .cookie-banner { background: var(--panel); }
body.light #nav-menu { background: var(--panel); }

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.15s;
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }


/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 200;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    #nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 1rem;
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.6);
        z-index: 150;
        padding: 0.75rem;
        min-width: 180px;
    }
    #nav-menu.open {
        display: block;
    }

    #nav-menu .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    #nav-menu .nav-links a {
        display: block;
        padding: 0.6rem 1rem;
        border-radius: 6px;
        font-size: 0.95rem;
    }
    #nav-menu .nav-links a:hover {
        background: rgba(255,255,255,0.03);
    }
    #nav-menu .btn-register {
        text-align: center;
    }
    #nav-menu .logout-link {
        color: var(--danger) !important;
    }
    #nav-menu .theme-toggle {
        margin-top: 0.5rem;
        width: 100%;
        padding: 0.5rem;
    }

    .hamburger {
        position: relative;
        z-index: 201;
    }
    .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-links {
        gap: 0.6rem;
        flex-wrap: wrap;
    }
    .nav-links a {
        font-size: 0.8rem;
    }

    .search-hero {
        padding: 2.5rem 0.5rem 1.5rem;
    }
    .search-hero h1 {
        font-size: 1.75rem;
    }
    .subtitle {
        font-size: 0.95rem;
    }

    .search-box input {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    .btn-search {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .torrent-card-body {
        flex-direction: column;
        gap: 0.5rem;
        min-width: 0;
    }

    .torrent-info {
        max-width: 100%;
    }

    .torrent-actions {
        align-self: flex-end;
    }

    .torrent-stats {
        gap: 0.75rem;
        font-size: 0.75rem;
    }

    .torrent-title {
        font-size: 0.9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .popular-tags { gap: 0.3rem; }
    .popular-tag { font-size: 0.72rem; padding: 0.2rem 0.5rem; }

    .arr-promo-content { padding: 1.25rem; }
    .arr-promo-content h2 { font-size: 1.25rem; }
    .arr-promo-content p { font-size: 0.9rem; }
    .arr-icons { gap: 0.75rem; }
    .arr-icons span { width: 44px; height: 44px; }
    .arr-icons img { width: 28px; height: 28px; }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-val {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.8rem !important;
    }

    .card {
        padding: 1rem;
    }

    table {
        font-size: 0.75rem;
    }
    th, td {
        padding: 0.5rem 0.35rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .auth-container {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    footer {
        padding: 1.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Copy toast */
.copy-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.1rem;
    }

    .nav-links a {
        font-size: 0.75rem;
    }

    .search-hero h1 {
        font-size: 1.4rem;
    }

    .search-box .search-icon {
        padding-left: 0.75rem;
    }

    .popular-tags-label { font-size: 0.7rem; }
    .popular-tag { font-size: 0.68rem; padding: 0.18rem 0.4rem; }

    .torrent-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .torrent-meta {
        gap: 0.2rem;
    }
    .tag {
        font-size: 0.68rem;
        padding: 0.1rem 0.35rem;
    }

    .torrent-actions {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn-magnet, .btn-copy {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .file-row {
        font-size: 0.72rem;
        padding: 0.3rem 0.75rem;
    }

    .code-block {
        font-size: 0.72rem;
        padding: 0.75rem;
    }
}

/* ================================================================
   PRICING PAGE (donate.php)
   ================================================================ */

.pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 560px;
    margin: 0 auto 3rem;
}
.pricing-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    position: relative;
}
.pricing-card-pro {
    border-color: var(--warning);
    box-shadow: 0 0 20px rgba(251,191,36,0.1);
}
.pricing-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: #000;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 1rem;
    border-radius: 0 0 8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pricing-header {
    padding: 2rem 1.5rem 1.25rem;
}
.pricing-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}
.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.pricing-sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}
.pricing-body {
    padding: 0 1.5rem 1.75rem;
}

/* Comparison table */
.compare-table-wrap {
    max-width: 800px;
    margin: 0 auto;
    overflow-x: auto;
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
}
.compare-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
}
.compare-table .col-plan {
    text-align: center;
    width: 100px;
}
.compare-table .col-pro {
    color: var(--warning);
}
.compare-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}
.compare-table tbody td:first-child {
    line-height: 1.4;
}
.compare-table tbody td:nth-child(2),
.compare-table tbody td:nth-child(3) {
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}
.compare-table .feature-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0.15rem 0 0;
    font-weight: 400;
    line-height: 1.5;
}
.compare-highlight td {
    background: rgba(251,191,36,0.03);
}
.compare-yes {
    color: var(--success);
    font-size: 1rem;
}
.compare-no {
    color: #555;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .pricing-cards {
        grid-template-columns: 1fr;
        max-width: 380px;
    }
    .compare-table-wrap {
        font-size: 0.8rem;
    }
    .compare-table tbody td {
        padding: 0.7rem 0.5rem;
        font-size: 0.78rem;
    }
    .compare-table tbody td:nth-child(2),
    .compare-table tbody td:nth-child(3) {
        font-size: 0.8rem;
    }
    .compare-table .col-plan {
        width: 65px;
    }
    .compare-table .feature-desc {
        font-size: 0.7rem;
    }
}
