:root {
    --bg-color: #0b0712; /* Deeper, richer dark */
    --card-bg: rgba(25, 18, 38, 0.6); /* Glassmorphism base */
    --card-border: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #948b9c;
    --accent-red: #ff3366;
    --accent-purple: #9d00ff;
    --gradient: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-purple) 100%);
    --hover-gradient: linear-gradient(135deg, #ff4d79 0%, #b333ff 100%);
    --font-main: 'Inter', -apple-system, sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg-color: #f4f0f8;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1325;
    --text-secondary: #5a5266;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(157, 0, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 51, 102, 0.05), transparent 25%);
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Navbar (Glassmorphism) --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(11, 7, 18, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 35px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.2);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: white !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 8px; /* Slightly softer */
    transition: var(--transition);
}

.discord-btn {
    background-color: rgba(88, 101, 242, 0.9);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
}

.discord-btn:hover {
    background-color: #5865F2;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.4);
}

.youtube-btn {
    background-color: rgba(255, 0, 0, 0.9);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}

.youtube-btn:hover {
    background-color: #FF0000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.4);
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 4px 15px rgba(220, 39, 67, 0.2);
    border: none;
}

.instagram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 39, 67, 0.4);
}

.easydonate-btn {
    background-color: rgba(46, 204, 113, 0.9);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2);
}

.easydonate-btn:hover {
    background-color: #2ECC71;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
}

.kofi-btn {
    background-color: rgba(255, 94, 91, 0.9);
    box-shadow: 0 4px 15px rgba(255, 94, 91, 0.2);
}

.kofi-btn:hover {
    background-color: #FF5E5B;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 94, 91, 0.4);
}

.nav-divider {
    width: 2px;
    height: 24px;
    background-color: var(--card-border);
    margin: 0 5px;
    border-radius: 2px;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
}

/* --- Layout --- */
.content-section {
    padding: 140px 0 80px 0;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- Controls (Search & Filters) --- */
.controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 50px;
}

.search-sort-bar {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 700px;
}

.search-input {
    flex-grow: 1;
    padding: 15px 25px;
    border-radius: 30px; /* Pill shape */
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-input:focus {
    border-color: rgba(157, 0, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(157, 0, 255, 0.2);
}

[data-theme="light"] .search-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-input:focus {
    background: white;
    border-color: rgba(157, 0, 255, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    display: inline-block;
    flex-grow: 1;
    min-width: 200px;
}

.dropdown-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 25px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.dropdown-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    stroke: var(--text-secondary);
}

.custom-dropdown.open .dropdown-btn svg {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.custom-dropdown.open .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 15px 25px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-content a.active {
    color: var(--accent-red);
    background: rgba(255, 51, 102, 0.1);
}

[data-theme="light"] .dropdown-btn {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.4);
    transform: translateY(-2px);
}

[data-theme="light"] .filter-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .filter-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .filter-btn.active {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
    color: white;
    box-shadow: 0 8px 20px rgba(255, 51, 102, 0.3);
}

/* --- Content Grid & Cards --- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    opacity: 0; /* For entry animation */
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animation delays added via JS later, but default to simple */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.card.show {
    opacity: 1;
    transform: scale(1);
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(157, 0, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(157, 0, 255, 0.15);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.placeholder-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.2rem;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    backdrop-filter: blur(4px);
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.placeholder-overlay.lg {
    font-size: 2.5rem;
    padding: 15px 30px;
}

.card:hover .card-img {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.status-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.status-development {
    background: linear-gradient(135deg, #f39c12, #d35400);
}
.status-testing {
    background: linear-gradient(135deg, #3498db, #2980b9);
}
.status-release {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.status-beta {
    background: linear-gradient(135deg, #1abc9c, #16a085); /* Teal */
}
.status-pre-release, .status-prerelease {
    background: linear-gradient(135deg, #9b59b6, #8e44ad); /* Purple */
}
.status-alpha {
    background: linear-gradient(135deg, #e74c3c, #c0392b); /* Red */
}
.status-concept {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d); /* Gray */
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 25px;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.card-btn {
    display: block;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-btn:hover {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}

/* --- Details Page Upgrades --- */
.details-page {
    padding-top: 100px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--text-primary);
    transform: translateX(-5px);
}

.details-header {
    margin-bottom: 50px;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.details-hero-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}

.details-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
    pointer-events: none;
}

.details-title-box {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.details-title-box h1 {
    font-size: 4rem;
    margin-bottom: 15px;
}

.details-meta {
    display: flex;
    gap: 25px;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    font-weight: 600;
}

.details-body {
    display: block;
    max-width: 900px;
    margin: 0 auto;
}

.details-main {
    width: 100%;
}

.long-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Custom Spoilers */
details.custom-spoiler {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin: 20px 0;
    overflow: hidden;
}

details.custom-spoiler summary {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none; /* Hide default arrow */
}

details.custom-spoiler summary::-webkit-details-marker {
    display: none;
}

details.custom-spoiler summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

details.custom-spoiler summary::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" stroke="%23ffffff" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
}

[data-theme="light"] details.custom-spoiler summary::after {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" stroke="%23111827" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="6 9 12 15 18 9"></polyline></svg>');
}

details.custom-spoiler[open] summary::after {
    transform: rotate(180deg);
}

details.custom-spoiler .spoiler-content {
    padding: 15px 20px;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    text-align: left;
}

/* Tweak nested spoilers */
details.custom-spoiler details.custom-spoiler {
    margin: 15px 0 0 0;
}

.long-description h2, .long-description h3 {
    margin-top: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 2rem;
}

.long-description p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.long-description ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.long-description li {
    margin-bottom: 10px;
}

.content-card {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    margin-bottom: 30px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}



.gallery-section h3, .installation-section h3 {
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.gallery-item-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.gallery-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.gallery-img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.install-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.download-section h3 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
}

.download-btn, .showcase-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.download-btn {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
    color: white;
    box-shadow: 0 10px 20px rgba(255, 51, 102, 0.3);
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 51, 102, 0.4);
}

.showcase-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.showcase-btn:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .showcase-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .showcase-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.showcase-btn.locked, .download-btn.locked {
    background: rgba(128, 128, 128, 0.15);
    color: var(--text-secondary);
    opacity: 0.6;
    border-color: transparent;
    cursor: not-allowed;
    box-shadow: none;
}

.showcase-btn.locked:hover, .download-btn.locked:hover {
    transform: none;
    background: rgba(128, 128, 128, 0.15);
    box-shadow: none;
}

[data-theme="light"] .showcase-btn.locked, [data-theme="light"] .download-btn.locked {
    background: rgba(128, 128, 128, 0.2);
}

[data-theme="light"] .showcase-btn.locked:hover, [data-theme="light"] .download-btn.locked:hover {
    background: rgba(128, 128, 128, 0.2);
}

.download-btn:active {
    transform: translateY(0);
}

.external-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: white !important;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}

.curseforge-btn {
    background: #F16436;
    box-shadow: 0 4px 15px rgba(241, 100, 54, 0.2);
}
.curseforge-btn:hover {
    background: #FF7744;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(241, 100, 54, 0.4);
}

.mcpedl-btn {
    background: #107C10;
    box-shadow: 0 4px 15px rgba(16, 124, 16, 0.2);
}
.mcpedl-btn:hover {
    background: #149914;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 124, 16, 0.4);
}

.modbay-btn {
    background: #0078D7;
    box-shadow: 0 4px 15px rgba(0, 120, 215, 0.2);
}
.modbay-btn:hover {
    background: #008DFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 120, 215, 0.4);
}

.download-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.6;
    margin-top: 20px;
}

/* Footer */
footer {
    background: rgba(11, 7, 18, 0.8);
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 80px;
}

[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-content .brand {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    /* Navbar */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: var(--card-bg);
        padding: 30px 20px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--card-border);
        box-shadow: 0 20px 40px rgba(0,0,0,0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: var(--transition);
        gap: 20px;
    }

    .nav-links.nav-active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-btn {
        width: 100%;
        text-align: center;
        padding: 15px;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Layout */
    .content-section {
        padding-top: 100px;
    }
    .section-header h2 {
        font-size: 2.2rem;
    }
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Search & Filters */
    .controls-container {
        flex-direction: column;
        width: 100%;
    }
    .search-sort-bar {
        width: 100%;
        flex-direction: column;
    }
    .search-input, .custom-dropdown {
        width: 100%;
    }
    .filters {
        gap: 10px;
    }
    .filter-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        flex: 1 1 calc(50% - 5px);
        text-align: center;
    }
    
    /* Details Page */
    .details-page {
        padding-top: 80px;
    }
    .details-body {
        flex-direction: column;
        gap: 30px;
    }
    .details-header {
        margin-bottom: 30px;
    }
    .details-hero-img {
        height: 300px; /* Much smaller for phones */
    }
    .details-title-box {
        left: 20px;
        bottom: 20px;
        right: 20px;
    }
    .details-title-box h1 {
        font-size: 2rem;
    }
    .details-meta {
        flex-direction: column;
        gap: 5px;
        font-size: 0.85rem;
    }
    .long-description h2 {
        font-size: 1.5rem;
    }
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
    .action-buttons {
        flex-direction: column;
    }
    
    .download-section {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    /* Even smaller phones */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* --- New Features Styles --- */

/* Theme Toggle Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(25, 18, 38, 0.8);
    transition: .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
    overflow: hidden;
}

.theme-switch .slider::before,
.theme-switch .slider::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    z-index: 1;
    transition: .4s ease;
}

.theme-switch .slider::before {
    content: "🌙";
    right: 8px;
    opacity: 1;
}

.theme-switch .slider::after {
    content: "☀️";
    left: 8px;
    opacity: 0;
}

.theme-switch .slider-knob {
    position: absolute;
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
    transition: .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(255, 51, 102, 0.4);
}

.theme-switch input:checked + .slider {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

.theme-switch input:checked + .slider::before {
    opacity: 0;
}

.theme-switch input:checked + .slider::after {
    opacity: 1;
}

.theme-switch input:checked + .slider .slider-knob {
    transform: translateX(30px);
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Scroll to Top */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(157, 0, 255, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(255, 51, 102, 0.4);
}

/* Featured Badge */
.card.featured {
    border-color: rgba(157, 0, 255, 0.5);
    box-shadow: 0 0 20px rgba(157, 0, 255, 0.15);
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.4s ease;
}

[data-theme="light"] .view-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.view-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--accent-red), var(--accent-purple));
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.4);
}

.view-btn:active {
    transform: scale(0.95);
}

.featured-label {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2;
}

/* Share Button */
.share-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Related Content */
.related-section {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid var(--card-border);
}

.related-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-header h2, .details-title-box h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        z-index: 1001;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: 0.3s ease-in-out;
        z-index: 1000;
        gap: 20px;
    }
    
    .nav-links.nav-active {
        right: 0;
    }
    
    .nav-divider {
        width: 50%;
        height: 2px;
        margin: 10px 0;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 5px 0 15px 0; /* Add top padding to prevent clipping when active/hovering */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filters::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        flex: 0 0 auto;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .search-sort-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .custom-dropdown {
        min-width: unset;
        flex: 1 1 calc(50% - 5px); /* Take half width on second row */
    }
    
    .dropdown-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .search-input {
        padding: 12px 15px;
        font-size: 0.9rem;
        flex: 1 1 100%; /* Take full width on first row */
        width: 100%;
    }
    
    .details-title-box h1 {
        font-size: 2rem;
    }
    
    .details-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .details-header {
        height: 350px;
    }
    
    .details-title-box {
        bottom: 20px;
        left: 20px;
    }
}


/* --- Toast Notification --- */
.toast-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(46, 204, 113, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.4);
    backdrop-filter: blur(10px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* --- Image Gallery --- */
.details-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0 20px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.details-gallery::-webkit-scrollbar {
    height: 8px;
}

.details-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.details-gallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.gallery-img-container {
    flex: 0 0 calc(80% - 15px); /* Show one large image and a peek of the next */
    scroll-snap-align: center;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 1px solid var(--card-border);
}

.gallery-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-img-container:hover img {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .gallery-img-container {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (min-width: 1024px) {
    .gallery-img-container {
        flex: 0 0 calc(33.333% - 15px);
    }
}


/* --- Tags System --- */
.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 10px 0; /* Reduced top margin so it sits closer to title */
}

.tag-badge {
    background: rgba(157, 0, 255, 0.15);
    color: var(--accent-purple);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(157, 0, 255, 0.3);
    transition: var(--transition);
}

[data-theme="light"] .tag-badge {
    background: rgba(157, 0, 255, 0.08);
}

.tag-badge:hover {
    background: rgba(157, 0, 255, 0.25);
}

.tag-badge.special-tag {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.3);
}
[data-theme="light"] .tag-badge.special-tag {
    background: rgba(255, 153, 0, 0.1);
    color: #e68a00;
    border: 1px solid rgba(255, 153, 0, 0.3);
}
.tag-badge.special-tag:hover {
    background: rgba(255, 170, 0, 0.25);
}

.sidebar-tag-btn.special-filter {
    color: #ffaa00;
}
.sidebar-tag-btn.special-filter svg {
    color: #ffaa00;
}
[data-theme="light"] .sidebar-tag-btn.special-filter {
    color: #e68a00;
}
[data-theme="light"] .sidebar-tag-btn.special-filter svg {
    color: #e68a00;
}
.sidebar-tag-btn.special-filter.active {
    background: rgba(255, 170, 0, 0.15);
    border-color: rgba(255, 170, 0, 0.3);
}


/* --- Floating Download Button --- */
.floating-download-btn {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981, #059669); /* Modern Emerald Green */
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    z-index: 900;
    transition: all 0.3s ease;
}

.floating-download-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.5);
    color: white;
}

@media (max-width: 768px) {
    .floating-download-btn {
        top: 150px; /* Push down a bit more on mobile so it doesn't block search/navbar if present */
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}


/* --- CurseForge Style Layout --- */
.browse-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    align-items: start;
}

.sidebar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

.sidebar-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-filter-btn, .sidebar-tag-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 15px;
    border-radius: 12px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-filter-btn:hover, .sidebar-tag-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-filter-btn.active, .sidebar-tag-btn.active {
    background: rgba(157, 0, 255, 0.15);
    color: var(--accent-purple);
    font-weight: 700;
}

/* Icons */
.sidebar-filter-btn svg {
    stroke: var(--text-secondary);
    transition: var(--transition);
}
.sidebar-filter-btn.active svg {
    stroke: var(--accent-purple);
}

.sidebar-tag-btn svg {
    opacity: 0;
    transform: scale(0.5) translateX(-10px);
    transition: var(--transition);
    stroke: var(--accent-purple);
    width: 0;
    margin-right: -12px;
}
.sidebar-tag-btn.active svg {
    opacity: 1;
    transform: scale(1) translateX(0);
    width: 16px;
    margin-right: 0;
}

.search-sort-bar.cf-style {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
}

.search-wrapper {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
}

#sort-dropdown {
    flex: 0 0 200px;
    min-width: unset;
}

.search-wrapper svg {
    position: absolute;
    left: 15px;
    z-index: 5;
}

.search-input.cf-search {
    padding-left: 45px;
    width: 100%;
}

.mobile-only {
    display: none;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}
.icon-btn:hover {
    color: var(--text-primary);
}

@media (max-width: 900px) {
    .mobile-only {
        display: flex;
    }
    
    .browse-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 999;
        margin-bottom: 0;
        border-radius: 0;
        background: var(--bg-dark);
        border: none;
        border-right: 1px solid var(--card-border);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 30px 20px;
    }
    
    .sidebar.open {
        transform: translateX(320px);
    }
    
    .sidebar-header {
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--card-border);
    }
    
    .sidebar-header h2 {
        margin: 0;
        font-size: 1.5rem;
    }
    
    .mobile-filter-btn {
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px 15px;
        border-radius: 30px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-primary);
        font-family: var(--font-main);
        font-size: 1rem;
        cursor: pointer;
        backdrop-filter: blur(10px);
        transition: var(--transition);
    }
    
    .mobile-filter-btn:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .search-sort-bar.cf-style {
        flex-direction: column;
        gap: 15px;
    }
    
    .mobile-controls-row {
        display: flex;
        gap: 10px;
        width: 100%;
        align-items: stretch;
    }
    
    .search-wrapper { 
        width: 100%; 
    }
    .search-input.cf-search {
        padding: 12px 15px 12px 35px;
        font-size: 0.95rem;
        width: 100%;
    }
    .search-wrapper svg {
        left: 10px;
        width: 16px;
        height: 16px;
    }
    
    .mobile-filter-btn, #sort-dropdown {
        flex: 1 1 50%;
        width: auto;
    }
    
    .mobile-filter-btn {
        font-size: 0.95rem;
        padding: 10px 15px;
    }
    
    .dropdown-btn {
        padding: 10px 15px;
        font-size: 0.95rem;
        height: 100%;
        justify-content: center;
        gap: 6px;
    }
}

@media (min-width: 901px) {
    .mobile-controls-row { 
        display: contents; 
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 50px 20px;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
}
.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    animation: zoomIn 0.3s ease;
}
@keyframes zoomIn {
    from {transform:scale(0.8); opacity:0;}
    to {transform:scale(1); opacity:1;}
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}
.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-purple);
    text-decoration: none;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    user-select: none;
    transition: 0.3s;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.lightbox-prev {
    left: 20px;
}
.lightbox-next {
    right: 20px;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--accent-purple);
}
