/* ═══════════════════════════════════════════════════════════════
   MODHUB — Homepage Styles (index.php)
   Extracted from inline <style> for performance (caching)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-root: #050507;
    --bg-surface: #0a0a0f;
    --bg-elevated: #111118;
    --bg-card: #12121a;
    --bg-card-hover: #18182a;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --accent: #4ade80;
    --accent-dim: rgba(74,222,128,0.12);
    --accent-glow: rgba(74,222,128,0.25);
    --gold: #f59e0b;
    --gold-dim: rgba(245,158,11,0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #7c7c8a;
    --text-muted: #52525b;
    --sidebar-w: 260px;
    --header-h: 64px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

* { box-sizing: border-box; }
body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg-root);
    color: var(--text-primary);
    padding-top: var(--header-h);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,.brand,.section-title { font-family: 'Geist', sans-serif; letter-spacing: -0.02em; }
a { text-decoration: none; color: inherit; }
.no-scroll { overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
    position: fixed; top: var(--header-h); bottom: 0; left: 0;
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 16px 8px;
    overflow-y: auto; overflow-x: hidden;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.nav-cat {
    color: var(--text-muted); font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; margin: 28px 0 8px 14px;
}
.nav-link-c {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 12px; margin: 1px 4px;
    color: var(--text-secondary); border-radius: var(--radius-sm);
    transition: all 0.15s ease; font-size: 0.88rem; font-weight: 500;
    border: 1px solid transparent;
}
.nav-link-c:hover { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.nav-link-c.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(16,185,129,0.15); }
.badge-n {
    background: rgba(255,255,255,0.06); color: var(--text-secondary);
    font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 6px;
}
.nav-link-c.active .badge-n { background: var(--accent-dim); color: var(--accent); }

.lang-pill a {
    display: inline-block; padding: 4px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.04); color: var(--text-muted);
    font-weight: 700; font-size: 0.72rem; transition: all 0.15s; border: 1px solid transparent;
}
.lang-pill a:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.lang-pill a.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(16,185,129,0.2); }

/* ── MAIN ── */
.main-content { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); padding: 28px 32px 60px; transition: margin 0.3s; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); box-shadow: 10px 0 40px rgba(0,0,0,0.6); }
    .main-content { margin-left: 0; width: 100%; padding: 16px 16px 50px; }
}

/* ── GAME TABS ── */
.game-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.game-tab {
    padding: 8px 18px; border-radius: 50px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-secondary); font-weight: 600; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.game-tab:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-hover); }
.game-tab.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(74,222,128,0.3); }

/* ── SECTION HEADERS ── */
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.section-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.section-icon.green { background: var(--accent-dim); color: var(--accent); }
.section-icon.amber { background: var(--gold-dim); color: var(--gold); }
.section-icon.sky { background: rgba(56,189,248,0.12); color: #38bdf8; }
.section-icon.indigo { background: rgba(129,140,248,0.12); color: #818cf8; }
.section-title { font-weight: 800; font-size: 1.3rem; margin: 0; color: #fff; }
.section-link { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); transition: color 0.2s; }
.section-link:hover { color: var(--accent); }

/* ── MOD CARDS ── */
.mod-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; height: 100%;
    display: flex; flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    contain: layout style;
}
.mod-card:hover {
    transform: translateY(-5px); border-color: var(--border-hover);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35); background: var(--bg-card-hover);
}
.card-thumb {
    aspect-ratio: 16/9; background: var(--bg-elevated);
    position: relative; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }
.mod-card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 40%);
    pointer-events: none;
}
.tag-game {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); color: #fff;
    font-size: 0.68rem; font-weight: 700; padding: 4px 10px;
    border-radius: 6px; border: 1px solid rgba(255,255,255,0.08); z-index: 2;
}
.rec-card { border-color: rgba(245,158,11,0.25); }
.rec-card:hover { border-color: rgba(245,158,11,0.45); }
.rec-badge {
    position: absolute; bottom: 10px; right: 10px;
    background: var(--gold); color: #000; font-weight: 800;
    font-size: 0.65rem; padding: 3px 8px; border-radius: 5px;
    z-index: 2; letter-spacing: 0.5px;
}
.rank-badge {
    position: absolute; top: 10px; left: 10px;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 0.85rem; z-index: 2;
    font-family: 'Geist', sans-serif;
}
.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; box-shadow: 0 0 15px rgba(245,158,11,0.4); }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }
.rank-other { background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); color: var(--text-secondary); font-size: 0.75rem; }

.card-info { padding: 16px; flex-grow: 1; display: flex; flex-direction: column; }
.mod-title {
    font-family: 'Geist', sans-serif; font-weight: 700; font-size: 0.95rem;
    line-height: 1.35; margin-bottom: 8px; color: #fff;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mod-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 14px; margin-bottom: 14px; }
.mod-meta span { display: flex; align-items: center; gap: 4px; }
.mod-meta i { font-size: 0.85rem; }
.card-btn {
    margin-top: auto; border-top: 1px solid var(--border);
    padding-top: 12px; display: flex; justify-content: space-between; align-items: center;
}
.btn-dl {
    background: rgba(255,255,255,0.05); color: var(--text-secondary);
    font-size: 0.78rem; font-weight: 600; padding: 6px 16px;
    border-radius: 50px; transition: all 0.25s; border: 1px solid var(--border);
}
.mod-card:hover .btn-dl { background: var(--accent); color: #fff; border-color: var(--accent); }
.rec-card:hover .btn-dl { background: var(--gold); color: #000; border-color: var(--gold); }

/* ── CATEGORY TILES ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cat-tile {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px;
    position: relative; overflow: hidden;
    transition: all 0.25s ease;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.cat-tile::before {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 100px; height: 100px;
    background: radial-gradient(circle, var(--accent-dim), transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.cat-tile:hover::before { opacity: 1; }
.cat-tile:hover {
    transform: translateY(-3px); border-color: var(--border-hover);
    background: var(--bg-card-hover); box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.cat-tile.active { border-color: rgba(16,185,129,0.4); background: linear-gradient(135deg, rgba(16,185,129,0.06), var(--bg-card)); }
.cat-ico {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); flex-shrink: 0;
}
.cat-name { font-family: 'Geist', sans-serif; font-weight: 700; color: #fff; font-size: 0.92rem; line-height: 1.25; margin-bottom: 4px; }
.cat-sub { color: var(--text-muted); font-size: 0.73rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
    border-radius: 50px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border); color: var(--text-secondary); font-weight: 600; font-size: 0.7rem;
}

/* ── GAME SECTION ── */
.game-section { margin-bottom: 48px; padding: 24px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); }
.game-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.game-section-title {
    font-family: 'Geist', sans-serif; font-weight: 800; font-size: 1.15rem;
    color: #fff; display: flex; align-items: center; gap: 10px;
}
.game-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.game-section-link {
    font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
    padding: 6px 16px; border-radius: 50px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); transition: all 0.2s;
}
.game-section-link:hover { color: var(--accent); border-color: rgba(74,222,128,0.3); background: var(--accent-dim); }

/* ── CAROUSEL ── */
.carousel-wrap {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 4px;
}
.carousel-wrap::-webkit-scrollbar { display: none; }
.carousel-item-card { flex: 0 0 calc(25% - 12px); scroll-snap-align: start; min-width: 220px; }
@media (max-width: 991px) { .carousel-item-card { flex: 0 0 calc(50% - 8px); min-width: 180px; } }
@media (max-width: 575px) { .carousel-item-card { flex: 0 0 80%; min-width: 240px; } }
.carousel-btn {
    width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1); color: #fff; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 0.2s; font-size: 1.1rem;
}
.carousel-btn:hover { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.3); color: var(--accent); }

/* ── GUIDES ── */
.guide-item {
    display: flex; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden; transition: all 0.2s ease; height: 82px;
}
.guide-item:hover { border-color: var(--accent); transform: translateX(4px); background: var(--bg-card-hover); }
.guide-thumb { width: 100px; flex-shrink: 0; background: var(--bg-elevated); }
.guide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.guide-content { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; }

/* ── SEARCH ── */
.search-wrap { position: relative; max-width: 480px; margin-top: 24px; }
.search-wrap i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.95rem; pointer-events: none; transition: color 0.2s;
}
.search-input {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border);
    color: #fff; padding: 10px 16px 10px 38px; border-radius: var(--radius-sm);
    font-size: 0.85rem; transition: all 0.25s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
    outline: none; background: var(--bg-card-hover); border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}
.search-input:focus + i, .search-wrap:focus-within i { color: var(--accent); }

.search-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 6px;
    min-width: 380px; width: max-content; max-width: 500px;
    background: #111118; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5); z-index: 1060; display: none;
    max-height: 400px; overflow-y: auto;
}
.search-dropdown.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; transition: background .15s; color: #e4e4e7; }
.sr-item:hover, .sr-item.active { background: rgba(255,255,255,0.04); color: #fff; }
.sr-thumb { width: 48px; height: 32px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: rgba(255,255,255,0.04); }
.sr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-info { flex: 1; min-width: 0; }
.sr-title { font-weight: 700; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.sr-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }
.sr-loading { padding: 16px; text-align: center; color: var(--text-muted); }
.sr-viewall { position: sticky; bottom: 0; background: #111118;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; color: var(--accent); font-size: 0.82rem; font-weight: 600;
    border-top: 1px solid rgba(255,255,255,0.06); transition: background .15s;
}
.sr-viewall:hover { background: rgba(255,255,255,0.04); color: #fff; }

/* ── PAGINATION ── */
.pagination .page-link {
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
    margin: 0 2px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85rem;
    padding: 8px 14px; transition: all 0.15s;
}
.pagination .page-link:hover { background: var(--bg-card-hover); color: #fff; }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ── FILTER BAR ── */
.filter-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap;
}
.filter-title { font-family: 'Geist', sans-serif; font-weight: 800; font-size: 1.4rem; color: #fff; letter-spacing: -0.02em; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; display: block; opacity: 0.5; }

/* ── MOBILE BTN ── */
.mobile-menu-btn {
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
    padding: 10px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.88rem; transition: all 0.15s;
}
.mobile-menu-btn:hover { background: var(--bg-card-hover); color: #fff; border-color: var(--border-hover); }

.sidebar-footer {
    margin-top: 40px; padding: 16px; text-align: center;
    color: var(--text-muted); font-size: 0.72rem; line-height: 1.5; opacity: 0.6;
}

/* ── ANIMATIONS ── */
.scroll-fade { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.scroll-fade.visible { opacity: 1; transform: translateY(0); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeUp 0.4s ease forwards; }
.delay-1 { animation-delay: 0.05s; opacity: 0; }
.delay-2 { animation-delay: 0.1s; opacity: 0; }
.delay-3 { animation-delay: 0.15s; opacity: 0; }
.delay-4 { animation-delay: 0.2s; opacity: 0; }

@media (max-width: 575px) { .cat-grid { grid-template-columns: 1fr 1fr; } }

/* ── GAME CARDS GRID ── */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 48px; }
.game-card-big {
    position: relative; border-radius: var(--radius-xl); overflow: hidden;
    border: 1px solid var(--border); height: 180px;
    display: flex; align-items: flex-end; cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}
.game-card-big:hover { transform: translateY(-6px); border-color: var(--border-hover); box-shadow: 0 20px 50px rgba(0,0,0,0.45); }
.game-card-bg { position: absolute; inset: 0; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }
.game-card-big:hover .game-card-bg { transform: scale(1.05); }
.game-card-pattern {
    position: absolute; inset: 0; opacity: 0.07;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.3) 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(255,255,255,0.2) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255,255,255,0.15) 2px, transparent 2px);
    background-size: 60px 60px, 80px 80px, 100px 100px;
}
.game-card-emoji {
    position: absolute; top: 20px; right: 24px; font-size: 3rem;
    opacity: 0.2; transition: all 0.4s; filter: grayscale(0.3);
}
.game-card-big:hover .game-card-emoji { opacity: 0.5; transform: scale(1.15) rotate(-5deg); filter: grayscale(0); }
.game-card-content {
    position: relative; z-index: 2; padding: 24px; width: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}
.game-card-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: #fff; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.1);
}
.game-card-name {
    font-family: 'Geist', sans-serif; font-weight: 800; font-size: 1.15rem;
    color: #fff; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 6px;
}
.game-card-count { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 6px; }
.game-card-count i { font-size: 0.85rem; }
.game-card-arrow {
    position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.4); font-size: 1rem; opacity: 0; transform: translateX(-8px); transition: all 0.3s;
}
.game-card-big:hover .game-card-arrow { opacity: 1; transform: translateX(0); }

/* First card bigger */
.games-grid .game-card-big:first-child { grid-column: span 2; height: 220px; }
.games-grid .game-card-big:first-child .game-card-name { font-size: 1.5rem; }
.games-grid .game-card-big:first-child .game-card-emoji { font-size: 4.5rem; }

@media (max-width: 767px) {
    .games-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .games-grid .game-card-big:first-child { grid-column: span 2; height: 180px; }
    .game-card-big { height: 150px; }
    .game-card-content { padding: 16px; }
    .game-card-name { font-size: 0.95rem; }
    .games-grid .game-card-big:first-child .game-card-name { font-size: 1.2rem; }
    .game-card-emoji { font-size: 2.2rem; top: 12px; right: 14px; }
    .games-grid .game-card-big:first-child .game-card-emoji { font-size: 3rem; }
    .game-card-icon { width: 32px; height: 32px; font-size: 1rem; margin-bottom: 8px; }
}
@media (max-width: 400px) {
    .games-grid { grid-template-columns: 1fr; }
    .games-grid .game-card-big:first-child { grid-column: span 1; }
}
