/* ================================================================
   Payta — Premium Software Distribution
   Modern Dark UI / Glassmorphism / Vibrant Accents
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    /* --- COLOR PALETTE --- */
    --bg-body: #0a0a0a;
    --bg-surface: #141414;
    --bg-surface-hover: #1f1f1f;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    /* --- ACCENTS --- */
    --primary: #ff5e00;
    --primary-hover: #ff7b00;
    --primary-glow: rgba(255, 94, 0, 0.3);

    --secondary: #9d4edd;
    --accent-blue: #00b4d8;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;

    /* Legacy compat aliases */
    --orange: #ff5e00;
    --green: #2ecc71;
    --red: #e74c3c;
    --white: #f0f0f0;
    --grey: #a0a0a0;

    /* --- TEXT --- */
    --text-main: #f0f0f0;
    --text-muted: #a0a0a0;
    --text-dim: #666666;

    /* --- BORDERS & LINES --- */
    --border: #2a2a2a;
    --border-light: #333333;

    /* --- GLASS --- */
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);

    /* --- FONTS --- */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* --- EFFECTS --- */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 94, 0, 0.03), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(157, 78, 221, 0.03), transparent 25%);
    animation: pageFadeIn 0.5s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::selection {
    background: var(--primary);
    color: #fff;
    text-shadow: none;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-body);
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

ul {
    list-style: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

/* ================================================================
   UTILITIES
   ================================================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.text-primary {
    color: var(--primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.font-mono {
    font-family: var(--font-mono);
}

.font-bold {
    font-weight: 700;
}

.hidden {
    display: none !important;
}

/* ================================================================
   HEADER & NAVIGATION
   ================================================================ */
.site-header {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    flex-shrink: 0;
}

.logo span {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.logo svg {
    width: 28px;
    height: 28px;
    fill: var(--primary);
}

.logo:hover {
    color: #fff;
}

/* --- Search --- */
.header-search {
    position: relative;
    max-width: 400px;
    width: 100%;
    flex: 1;
}

.header-search input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    transition: var(--transition);
}

.header-search input::placeholder {
    color: var(--text-dim);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.15), 0 0 20px rgba(255, 94, 0, 0.05);
    background: var(--bg-surface-hover);
}

.header-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.header-search button:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

.header-search button svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

/* Keyboard hint badge */
.search-kbd {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    pointer-events: none;
    transition: opacity 0.2s;
    line-height: 1.4;
}

/* --- Search Autocomplete --- */
.search-autocomplete {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-height: 320px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: var(--transition);
    z-index: 200;
}

.search-autocomplete.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ac-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

.ac-item:last-child {
    border-bottom: none;
}

.ac-item:hover {
    background: var(--bg-surface-hover);
    color: var(--primary);
}

.ac-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.ac-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.ac-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* --- Nav Links --- */
.main-nav ul {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(255, 94, 0, 0.08);
}

/* --- Hamburger (Mobile) --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 89;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================================================================
   HERO / PAGE HEADER
   ================================================================ */
.page-header {
    padding: 2.5rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    position: relative;
    overflow: hidden;
}

/* Background glow */
.page-header::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(255, 94, 0, 0.08), transparent 70%);
    pointer-events: none;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, #ff9500 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradientShift 6s ease infinite;
    position: relative;
    z-index: 1;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.page-subtitle {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* ================================================================
   CONTENT AREA
   ================================================================ */
.content-wrap {
    flex: 1;
    padding: 2rem 0;
}

/* Homepage: main content FIRST in HTML, sidebar SECOND */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 2rem;
    align-items: start;
}

/* Browse/Detail: sidebar FIRST in HTML, main SECOND */
.grid-layout.reversed {
    grid-template-columns: 240px 1fr;
}

/* Legacy alias from old templates */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2rem;
    align-items: start;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    position: relative;
    z-index: 1;
}

.sidebar-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.sidebar-box:hover {
    border-color: var(--border-light);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    /* Also support the old non-header usage */
    padding: 0;
    background: none;
}

/* When sidebar-title is used WITHOUT sidebar-header wrapper (legacy) */
.sidebar-box>.sidebar-title {
    padding: 0.8rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    color: var(--primary);
    font-weight: 800;
}

.sidebar-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-list li:last-child a {
    border-bottom: none;
}

.sidebar-list li a:hover {
    background: var(--bg-surface-hover);
    color: #fff;
    padding-left: 1.25rem;
}

.sidebar-list li a.active {
    color: var(--primary);
    font-weight: 700;
    background: rgba(255, 94, 0, 0.06);
}

/* Category Icons */
.cat-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.c1 {
    background: #27ae60;
}

.c2 {
    background: #e74c3c;
}

.c3 {
    background: #2980b9;
}

.c4 {
    background: #8e44ad;
}

.c5 {
    background: #d35400;
}

.c6 {
    background: #16a085;
}

.c7 {
    background: #c0392b;
}

.c8 {
    background: #2c3e50;
}

/* ================================================================
   GLASS PANELS & SECTION BOXES
   ================================================================ */
.glass-panel,
.section-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

.panel-header,
.section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header .sec-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.section-header .sec-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    stroke: #fff;
    stroke-width: 0;
}

/* ================================================================
   TABLES
   ================================================================ */
.torrent-table {
    width: 100%;
    border-collapse: collapse;
}

.torrent-table thead th {
    background: var(--bg-card);
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.torrent-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.9rem;
    vertical-align: middle;
}

.torrent-table tbody tr:last-child td {
    border-bottom: none;
}

.torrent-table tbody tr {
    transition: background 0.15s;
}

.torrent-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

/* Table Columns */
.col-small {
    width: 80px;
    text-align: center;
}

.col-medium {
    width: 120px;
}

.item-title {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.3;
    display: block;
    margin-bottom: 0.2rem;
}

.item-title:hover {
    color: var(--primary);
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-outline {
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    line-height: 1;
    color: #fff;
    text-decoration: none;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 94, 0, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 94, 0, 0.35);
}

.btn-secondary {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: #fff;
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--primary);
    background: rgba(255, 94, 0, 0.05);
}

.btn-lg {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* --- Loading State --- */
.btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.15), 0 0 20px rgba(255, 94, 0, 0.05);
    background: var(--bg-surface-hover);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.form-submit {
    margin-top: 1.5rem;
}

/* ================================================================
   FOCUS STATES (Accessibility)
   ================================================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.4);
}

.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ================================================================
   FLASH MESSAGES
   ================================================================ */
.flash {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid;
    background: var(--bg-surface);
}

.flash-success {
    border-left-color: var(--accent-green);
    color: var(--accent-green);
}

.flash-error {
    border-left-color: var(--accent-red);
    color: var(--accent-red);
}

.flash-warning {
    border-left-color: #f39c12;
    color: #f39c12;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .lbl {
    font-size: 2rem;
    opacity: 0.2;
    margin-bottom: 0.5rem;
}

/* ================================================================
   DETAILS PAGE
   ================================================================ */
.detail-header-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    transition: var(--transition);
}

.detail-header-card:hover {
    border-color: var(--border-light);
}

.detail-main h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 200px;
}

.detail-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: var(--text-main);
}

.detail-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================================================================
   BACK TO TOP
   ================================================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 94, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: var(--transition-slow);
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 94, 0, 0.4);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

/* ================================================================
   SKELETON LOADING STATES
   ================================================================ */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.04) 40%,
            rgba(255, 255, 255, 0.06) 50%,
            rgba(255, 255, 255, 0.04) 60%,
            transparent 100%);
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: var(--bg-surface-hover);
}

.skeleton-line.w-full {
    width: 100%;
}

.skeleton-line.w-3-4 {
    width: 75%;
}

.skeleton-line.w-1-2 {
    width: 50%;
}

.skeleton-line.w-1-4 {
    width: 25%;
}

.skeleton-line.w-1-3 {
    width: 33%;
}

.skeleton-line.h-lg {
    height: 20px;
}

.skeleton-circle {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg-surface-hover);
    flex-shrink: 0;
}

/* ================================================================
   CARDS WITH HOVER LIFT + BORDER GLOW
   ================================================================ */
.related-card,
.stat-card,
.sidebar-box {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.25s ease,
        box-shadow 0.35s ease;
}

.related-card:hover,
.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(255, 94, 0, 0.12), 0 0 0 1px rgba(255, 94, 0, 0.15);
}

/* ================================================================
   RESPONSIVE — MOBILE
   ================================================================ */
@media (max-width: 900px) {

    .grid-layout,
    .grid-layout.reversed,
    .page-layout {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }

    /* Show hamburger */
    .hamburger {
        display: flex;
    }

    /* Nav becomes mobile slide-in */
    .main-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-surface);
        border-left: 1px solid var(--border);
        z-index: 105;
        padding: 5rem 1.5rem 2rem;
        transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }

    .main-nav.open {
        right: 0;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.25rem;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    /* Lang switch in mobile nav */
    .lang-switch {
        order: 4;
        display: none;
    }

    .detail-header-card {
        flex-direction: column;
    }

    .detail-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.6rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .torrent-table {
        font-size: 0.85rem;
    }

    .torrent-table td {
        padding: 0.6rem 0.5rem;
    }

    .col-small,
    .col-medium {
        width: auto;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .search-kbd {
        display: none;
    }
}

/* ================================================================
   ADMIN BACKOFFICE
   ================================================================ */

/* --- Admin Badge --- */
.admin-badge {
    font-size: 0.55rem;
    color: #fff;
    background: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    vertical-align: middle;
    letter-spacing: 0.06em;
    font-weight: 800;
}

/* --- Admin Sub-Navigation --- */
.admin-nav {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.admin-nav ul {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.admin-nav .nav-link {
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
}

/* --- Dashboard Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.4rem;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* --- Section Titles --- */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.section-title .highlight {
    color: var(--primary);
    font-weight: 800;
    margin-right: 0.3rem;
}

/* --- Admin Tables --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table thead th {
    background: var(--bg-card);
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.9rem;
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

.admin-table td a {
    color: var(--primary);
}

.admin-table td a:hover {
    text-decoration: underline;
}

/* --- Admin Page Titles --- */
.content-wrap h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* ================================================================
   BUTTON VARIANTS (Shared across admin & public)
   ================================================================ */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-surface-hover);
    color: #fff;
    border-color: var(--text-dim);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

.btn-submit {
    background: var(--accent-green);
    color: #fff;
}

.btn-submit:hover {
    background: #27ae60;
    color: #fff;
}

/* ================================================================
   UTILITY EXTRAS
   ================================================================ */
.text-sm {
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

input[type="file"].form-control {
    padding: 0.5rem 0.7rem;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: var(--transition);
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--primary-hover);
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}

.pagination-dots {
    color: var(--text-dim);
    padding: 0 0.3rem;
    font-size: 0.9rem;
}

/* ================================================================
   SORT BAR
   ================================================================ */
.sort-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ================================================================
   BREADCRUMBS
   ================================================================ */
.breadcrumb-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb li::after {
    content: '/';
    margin-left: 0.4rem;
    color: var(--text-dim);
}

.breadcrumb li:last-child::after {
    display: none;
}

.breadcrumb li a {
    color: var(--text-muted);
}

.breadcrumb li a:hover {
    color: var(--primary);
}

.breadcrumb li.active {
    color: var(--text-main);
    font-weight: 600;
}

/* ================================================================
   RELATED SOFTWARE GRID
   ================================================================ */
.related-section {
    margin-top: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.related-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: block;
}

.related-card:hover {
    color: inherit;
}

.related-card-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.related-card-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.related-card-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================================================
   LANGUAGE SWITCHER
   ================================================================ */
.lang-switch {
    display: flex;
    gap: 0.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
    flex-shrink: 0;
}

.lang-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
}

.lang-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s ease-out;
    color: var(--text-main);
    font-size: 0.9rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast-success {
    border-left: 4px solid var(--accent-green);
}

.toast-error {
    border-left: 4px solid var(--accent-red);
}

.toast-icon {
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--accent-green);
}

.toast-error .toast-icon {
    color: var(--accent-red);
}

.toast-msg {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.toast-close:hover {
    color: #fff;
}

.toast-fade {
    animation: toastOut 0.4s ease-in forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

@media (max-width: 480px) {
    .toast-container {
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }

    .lang-switch {
        display: none;
    }
}

/* ================================================================
   LEGAL PAGES (Terms, Privacy, DMCA)
   ================================================================ */
.legal-page {
    max-width: 780px;
}

.legal-page h2 {
    color: var(--primary);
    font-size: 1.15rem;
    margin-top: 2.2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.legal-page p {
    color: var(--text-muted);
    line-height: 1.85;
    margin-bottom: 1rem;
}

.legal-list {
    padding-left: 1.5rem;
    margin: 0.75rem 0 1rem;
}

.legal-list li {
    color: var(--text-muted);
    line-height: 1.85;
    margin-bottom: 0.5rem;
    position: relative;
}

.legal-list li::marker {
    color: var(--primary);
}