/* --- Global Styles & Variables (DARK MODE ONLY) --- */
:root {
    /* Core Palette */
    --primary-color: #1bd96a;
    --background-color: #121212;
    --section-bg-color: #1e1e1e;
    --prominent-text-color: #e0e0e0;
    --general-text-color: #c9c9c9;
    --subtle-text-color: #888888;

    /* Shadows & Glows */
    --card-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
    --card-hover-darker: rgba(0, 0, 0, 0.2);
    --section-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    --btn-shadow-color: rgba(27, 217, 106, 0.3);
    --btn-hover-shadow-color: rgba(27, 217, 106, 0.4);

    /* Inputs */
    --input-bg: #2a2a2a;
    --input-border: #444;
    --input-focus-shadow: rgba(27, 217, 106, 0.35);

    /* Transitions */
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease;
}

/* --- [NEW] Modal Navigation Arrows --- */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    padding: 15px 12px;
    z-index: 2001;
    /* Above the image, below the close button */
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border-radius: 8px;
    display: none;
    /* Hidden by default, shown by JS */
}

.modal-nav:hover {
    background-color: rgba(27, 217, 106, 0.8);
    border-color: rgba(27, 217, 106, 0.9);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

/* --- [NEW] Styles for Tag Modal & Button --- */
.open-tags-btn {
    background-color: #333;
    color: #ccc;
    height: 29px;
    width: 29px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border: none;

    /* Perfect centering for the + symbol */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;

    /* Fine-tune vertical alignment */
    padding-top: 1px;
}

.open-tags-btn:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

.tags-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2001;
    /* Above screenshot modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeInModal 0.3s ease;
}

.tags-modal-content {
    background-color: var(--section-bg-color);
    margin: 15% auto;
    padding: 25px 30px;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tags-modal-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--input-border);
    padding-bottom: 15px;
    font-size: 1.4rem;
}

.tags-modal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 50vh;
    /* This makes the container scrollable if content overflows */
    overflow-y: auto;
    padding-right: 10px;
    /* Space for scrollbar */
}

/* --- [NEW] System Requirement Toggle --- */
.req-toggle-container {
    display: flex;
    background-color: var(--input-bg);
    border-radius: 20px;
    padding: 4px;
    margin-bottom: 25px;
    width: fit-content;
    border: 1px solid var(--input-border);
}

.req-toggle-btn {
    background-color: transparent;
    border: none;
    color: var(--subtle-text-color);
    padding: 8px 20px;
    border-radius: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.req-toggle-btn.active {
    background-color: var(--primary-color);
    color: var(--background-color);
    box-shadow: 0 2px 8px var(--btn-shadow-color);
}

/* Custom Scrollbar for the Tag List */
.tags-modal-list::-webkit-scrollbar {
    width: 8px;
}

.tags-modal-list::-webkit-scrollbar-track {
    background: transparent;
}

.tags-modal-list::-webkit-scrollbar-thumb {
    background-color: var(--input-border);
    border-radius: 10px;
    border: 2px solid var(--section-bg-color);
}

.tags-modal-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--subtle-text-color);
}

/* Align tags and button in the main view */
.detail-tags-container {
    align-items: center;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--general-text-color);
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 0;
    animation: fadeInPage 0.8s ease-out forwards;
}

@keyframes fadeInPage {
    to {
        opacity: 1;
    }
}

.container {
    width: 90%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 15px;
}

h1,
h2,
h3,
h4 {
    color: var(--prominent-text-color);
    margin-bottom: 0.8em;
}

h1 {
    font-size: 2.8rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease, filter 0.3s ease;
}

a:hover {
    filter: brightness(0.85);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Header --- */
header {
    background-color: var(--background-color);
    padding: 20px 0;
    box-shadow: 0 2px 10px var(--section-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

header nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 1;
    min-width: 0;
    gap: 15px;
}

header nav a.back-button {
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

header nav a.back-button:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

/* --- Category Dropdown Styles --- */
.category-nav-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-static-label {
    font-weight: 600;
    color: var(--general-text-color);
    font-size: 1rem;
}

.category-dropdown-btn {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--prominent-text-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.category-dropdown-btn:hover,
.category-nav-container.active .category-dropdown-btn {
    border-color: var(--primary-color);
    background-color: var(--section-bg-color);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

.category-dropdown-btn .dropdown-arrow {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.category-nav-container.active .category-dropdown-btn .dropdown-arrow {
    transform: rotate(180deg);
}

.category-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background-color: var(--section-bg-color);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    box-shadow: 0 8px 25px var(--section-shadow);
    z-index: 1100;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    opacity: 0;
    padding: 8px;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-nav-container.active .category-dropdown-list {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.category-dropdown-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    margin-bottom: 2px;
    color: var(--general-text-color);
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.category-dropdown-list a:hover {
    background-color: var(--input-bg);
    color: var(--primary-color);
    filter: none;
}

.category-dropdown-list a.active {
    background-color: var(--primary-color);
    color: var(--background-color) !important;
    font-weight: 600;
}

.category-dropdown-list a.active svg {
    fill: var(--background-color);
}

.category-dropdown-list a svg {
    width: 20px;
    height: 20px;
    fill: var(--subtle-text-color);
    transition: fill 0.2s;
    flex-shrink: 0;
}

.category-dropdown-list a:hover svg {
    fill: var(--primary-color);
}

.category-dropdown-list::-webkit-scrollbar {
    width: 8px;
}

.category-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-dropdown-list::-webkit-scrollbar-thumb {
    background-color: var(--input-border);
    border-radius: 10px;
    border: 2px solid var(--section-bg-color);
}

.category-dropdown-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--subtle-text-color);
}

/* --- Dynamic Search Bar (Used on Both Pages) --- */
.search-toggle-container-dynamic {
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 0;
    background-color: var(--input-bg);
    transition: padding 0.4s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.detail-search-input-dynamic {
    width: 0;
    opacity: 0;
    padding: 9px 0;
    border: none;
    border-radius: 20px 0 0 20px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    background-color: transparent;
    color: var(--general-text-color);
    pointer-events: none;
    transition: width 0.4s ease-in-out, opacity 0.3s ease-in-out 0.1s, padding 0.4s ease-in-out;
    flex-grow: 0;
    flex-shrink: 0;
    min-width: 0;
    outline: none;
}

.detail-search-input-dynamic::placeholder {
    color: var(--subtle-text-color);
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
}

.search-icon-dynamic {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    cursor: pointer;
    transition: fill 0.3s ease;
    padding: 8px;
    box-sizing: content-box;
    flex-shrink: 0;
    z-index: 1;
}

.search-toggle-container-dynamic.search-active {
    border-color: var(--primary-color);
    background-color: var(--section-bg-color);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

.search-toggle-container-dynamic.search-active .detail-search-input-dynamic {
    width: 180px;
    opacity: 1;
    pointer-events: auto;
    padding: 9px 10px 9px 15px;
}

.search-toggle-container-dynamic.search-active .detail-search-input-dynamic::placeholder {
    opacity: 1;
}

/* --- App Gallery & Category Sections --- */
.app-gallery {
    padding: 60px 0;
}

.app-category-section {
    margin-bottom: 60px;
}

.app-category-header {
    margin-bottom: 25px;
}

.app-category-header h2 {
    margin-bottom: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--prominent-text-color);
    position: relative;
    padding-bottom: 10px;
    display: inline-block;
}

.app-category-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 70px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.show-more-container {
    text-align: center;
    margin-top: 30px;
}

.show-more-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--btn-shadow-color);
}

.show-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--subtle-text-color);
    border-color: var(--subtle-text-color);
    transform: none;
    box-shadow: none;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: var(--subtle-text-color);
    padding: 40px 20px;
    margin-top: 20px;
}

/* --- App Card Styles --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
}

.app-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 290px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--section-bg-color);
    opacity: 0;
    transform: translateY(20px);
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--card-hover-darker);
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3;
    opacity: 0;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.badge-category {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.badge-version {
    background-color: var(--primary-color);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 20px;
    pointer-events: none;
}

.app-card:hover .card-overlay,
.app-card:hover .card-badges {
    opacity: 1;
    transform: translateY(0);
}

.card-info {
    text-align: center;
    color: #fff;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease 0.1s, opacity 0.3s ease 0.1s;
}

.app-card:hover .card-info {
    transform: translateY(0);
    opacity: 1;
}

.card-info-name {
    font-size: 1.15rem;
    /* MODIFIED */
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.card-info-meta {
    display: flex;
    flex-wrap: wrap;
    /* Allows items to drop to the next line */
    justify-content: center;
    /* Centers the items horizontally on each line */
    align-items: center;
    gap: 10px;
    /* A slightly smaller gap helps with wrapping */
    font-size: 0.8rem;
    color: #e0e0e0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    /* MODIFIED */
}

.meta-item svg {
    width: 12px;
    /* MODIFIED */
    height: 12px;
    /* MODIFIED */
    fill: #e0e0e0;
}

/* === APP DETAIL PAGE === */
.app-detail-page {
    padding: 40px 0;
    opacity: 0;
    animation: fadeInContent 0.5s 0.2s forwards;
}

@keyframes fadeInContent {
    to {
        opacity: 1;
    }
}

.detail-header-container {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    background-color: var(--section-bg-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--section-shadow);
}

.detail-header-left-col {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
}

.detail-header-image {
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.detail-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.detail-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 10px 0;
    color: var(--prominent-text-color);
}

.detail-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    color: var(--subtle-text-color);
    font-size: 0.9rem;
}

.detail-meta-bar span {
    font-weight: 600;
    color: var(--general-text-color);
}

.view-steam-btn {
    display: block;
    background-color: #1a2a41;
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 15px;
    text-align: center;
    box-sizing: border-box;
}

.view-steam-btn:hover {
    background-color: #2c4464;
    color: #fff;
}

.detail-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--general-text-color);
}

.detail-info-list li {
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    font-size: 0.95rem;
}

.detail-info-list li:last-child {
    padding-bottom: 0;
}

.detail-info-list strong {
    color: var(--prominent-text-color);
    font-weight: 600;
    width: 170px;
    flex-shrink: 0;
    margin-right: 20px;
    display: inline-block;
}

.detail-tags-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    background-color: #333;
    color: #ccc;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
}

.detail-tag:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

.app-detail-section {
    background-color: var(--section-bg-color);
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--section-shadow);
}

.app-detail-section h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--input-border);
    position: relative;
}

.app-detail-section h3::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.app-detail-section p {
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--subtle-text-color);
}

.app-detail-section .description-section p:last-of-type {
    margin-bottom: 0;
}

.app-detail-section ol li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--subtle-text-color);
    font-size: 0.95rem;
}

.app-detail-section ol li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

.download-package {
    padding: 20px 0;
    border-bottom: 1px dashed var(--input-border);
}

.download-package:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.download-package:first-child {
    padding-top: 10px;
}

.download-package-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--prominent-text-color);
    margin-bottom: 8px;
}

.download-package-info {
    font-size: 0.9rem;
    color: var(--subtle-text-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.download-buttons-container {
    text-align: center;
}

.download-package .download-buttons-container {
    text-align: left;
    margin-top: 10px;
}

.download-btn {
    display: inline-block;
    background-image: linear-gradient(135deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color) 80%, black 20%) 100%);
    color: var(--background-color);
    padding: 14px 28px;
    margin: 10px 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 15px var(--btn-shadow-color);
    transition: all 0.3s ease;
    border: none;
}

.download-package .download-btn {
    margin: 8px 8px 8px 0;
}

.download-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 20px var(--btn-hover-shadow-color);
    color: var(--background-color);
}

.download-btn:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--btn-hover-shadow-color) 70%, transparent);
}

/* --- Installation Guide Section (Reverted to Inspired Design) --- */
.installation-guide-section {
    background-color: var(--section-bg-color);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--section-shadow);
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.guide-header:not(:first-of-type) {
    margin-top: 40px;
}

.guide-header svg {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
    flex-shrink: 0;
}

.guide-header-text h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--prominent-text-color);
}

.guide-header-text p {
    margin: 0;
    color: var(--subtle-text-color);
    font-size: 0.9rem;
}

.guide-steps {
    list-style: none;
    padding-left: 16px;
    /* Space for the number and line */
    counter-reset: step-counter;
    margin-bottom: 30px;
}

.guide-steps li {
    position: relative;
    margin-bottom: 20px;
    padding-left: 45px;
    font-size: 0.95rem;
    line-height: 1.7;
    min-height: 32px;
}

.guide-steps li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background-color: var(--input-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--general-text-color);
    z-index: 2;
}

.guide-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 38px;
    bottom: -18px;
    width: 2px;
    background-color: var(--input-border);
    opacity: 0.5;
    z-index: 1;
}

.guide-path {
    color: #79C0FF;
    font-style: italic;
    word-break: break-word;
    margin: 0 4px;
}

.guide-executable {
    background-color: rgba(27, 217, 106, 0.1);
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 500;
    color: var(--primary-color);
    border: 1px solid rgba(27, 217, 106, 0.4);
    white-space: nowrap;
    margin: 0 4px;
}

.important-notes ul {
    list-style: none;
    padding: 0;
}

.important-notes li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.important-notes li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 1.5rem;
    line-height: 1;
    color: #f0ad4e;
    /* Warning color */
}

/* --- System Requirements Section (Remastered) --- */
.requirements-section .requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 30px;
    padding-top: 10px;
}

.requirements-section .requirement-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.requirements-section .requirement-item svg {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
    flex-shrink: 0;
    margin-top: 5px;
    opacity: 0.8;
}

.requirements-section .req-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--subtle-text-color);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.requirements-section .req-value {
    display: block;
    font-size: 0.95rem;
    color: var(--prominent-text-color);
    line-height: 1.5;
}

/* --- Screenshot Gallery --- */
.screenshot-gallery-wrapper {
    position: relative;
    margin: 0 -10px;
}

.screenshot-gallery {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px;
    gap: 20px;
}

.screenshot-gallery::-webkit-scrollbar {
    display: none;
}

.screenshot-item {
    flex: 0 0 calc((100% / 3) - 20px);
    min-width: calc((100% / 3.15) - 20px);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
}

.screenshot-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.screenshot-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    border: none;
    opacity: 0;
    pointer-events: none;
}

.screenshot-gallery-wrapper:hover .screenshot-nav,
.screenshot-gallery-wrapper.has-scroll .screenshot-nav {
    opacity: 1;
    pointer-events: auto;
}

.screenshot-nav:hover {
    background-color: var(--primary-color);
}

.screenshot-nav svg path {
    stroke: #ffffff;
}

#prevScreenshot {
    left: -24px;
}

#nextScreenshot {
    right: -24px;
}

.screenshot-nav svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* --- Modals --- */
.screenshot-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeInModal 0.3s ease;
}

.modal-content {
    margin: auto;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90vh;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Utility & Placeholders --- */
.loading-placeholder {
    text-align: center;
    font-size: 1.5rem;
    color: var(--general-text-color);
    padding: 50px;
}

.error-message {
    text-align: center;
    font-size: 1.2rem;
    color: #f8d7da;
    padding: 30px;
    background-color: #2c1a1f;
    border: 1px solid #843534;
    border-radius: 8px;
}

.error-message a {
    color: #f5c6cb;
    font-weight: 600;
}

/* --- Footer --- */
footer {
    background-color: #101010;
    color: var(--subtle-text-color);
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    font-size: 0.9rem;
}

/* Card Animation */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-card.visible {
    animation-name: cardAppear;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-out;
}

/* --- Featured Carousel --- */
.featured-carousel {
    height: 550px;
    position: relative;
    overflow: hidden;
    background-color: #111;
    color: #fff;
}

.featured-carousel .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding-left: 15vw;
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(18, 18, 18, 0.9) 0%, rgba(18, 18, 18, 0.7) 35%, rgba(18, 18, 18, 0.1) 100%);
    z-index: 1;
}

.carousel-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    box-sizing: border-box;
}

/* The container for the logo image - FIXED */
.carousel-logo {
    max-width: 400px;
    margin-bottom: 15px;
    /* Establish a fixed-height container for the logo */
    height: 140px;
    /* Use flexbox to vertically center the image within this container */
    display: flex;
    align-items: center;
}

/* The logo image itself - FIXED */
.carousel-logo img {
    width: auto;
    max-width: 100%;
    max-height: 140px;
    /* Set max-height directly on the image */
    height: auto;
    /* Allow height to scale naturally */
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    display: block;
    /* Remove any inline spacing */
}

.carousel-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--general-text-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.carousel-meta .meta-item {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 500;
}

.carousel-meta .meta-item.version {
    background-color: var(--primary-color);
    color: #111;
    font-weight: 600;
}

.carousel-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-download-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--background-color);
    padding: 14px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 5px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.carousel-download-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 217, 106, 0.3);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(5px);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav:hover {
    background-color: var(--primary-color);
}

.carousel-nav svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.carousel-dot.active {
    background-color: #fff;
    transform: scale(1.2);
}

/* --- Media Queries --- */
@media (max-width: 1200px) {
    .container {
        width: 95%;
    }

    .app-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}


@media (max-width: 992px) {
    header nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 10px 5px;
    }

    .category-nav-container {
        order: 1;
    }

    .search-toggle-container-dynamic {
        order: 2;
    }

    .app-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .detail-header-container {
        flex-direction: column;
    }

    .detail-header-image {
        width: 100%;
        height: 250px;
        flex-basis: auto;
    }

    .screenshot-item {
        flex: 0 0 calc((100% / 2.15) - 20px);
        min-width: calc((100% / 2.15) - 20px);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .app-category-header h2 {
        font-size: 1.6rem;
    }

    header nav {
        gap: 10px;
    }

    header nav a.back-button {
        padding: 7px 10px;
        font-size: 0.9rem;
    }

    .search-toggle-container-dynamic.search-active .detail-search-input-dynamic {
        width: 130px;
        padding: 7px 8px 7px 12px;
        font-size: 0.85rem;
    }

    .detail-title {
        font-size: 2.2rem;
    }

    .search-icon-dynamic {
        width: 22px;
        height: 22px;
        padding: 7px;
    }

    .container {
        width: 95%;
    }

    .app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .app-detail-section {
        padding: 20px;
    }

    .app-detail-section h3 {
        font-size: 1.4rem;
    }

    .download-package-name {
        font-size: 1.2rem;
    }

    .detail-info-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-info-list strong {
        width: auto;
        margin-bottom: 3px;
    }

    .requirements-section .requirements-grid {
        grid-template-columns: 1fr;
    }

    .screenshot-item {
        flex: 0 0 calc((100% / 1.15) - 20px);
        min-width: calc((100% / 1.15) - 20px);
    }

    .screenshot-nav {
        width: 42px;
        height: 42px;
    }

    #prevScreenshot {
        left: -15px;
    }

    #nextScreenshot {
        right: -15px;
    }

    .featured-carousel {
        height: 450px;
    }

    .carousel-content {
        max-width: 90%;
        padding: 0 5%;
        text-align: center;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .carousel-logo {
        max-width: 250px;
        height: 120px;
        /* Add a fixed height for mobile view */
    }

    .carousel-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }

    header nav {
        flex-wrap: nowrap;
    }

    header nav a.back-button {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .category-nav-container {
        display: none;
    }

    .search-toggle-container-dynamic {
        flex-grow: 1;
    }

    .search-toggle-container-dynamic.search-active .detail-search-input-dynamic {
        width: 100%;
        max-width: 250px;
    }

    .search-icon-dynamic {
        width: 20px;
        height: 20px;
        padding: 6px;
    }

    .app-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .app-category-header h2 {
        font-size: 1.5rem;
    }

    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-card {
        height: 280px;
    }

    .detail-title {
        font-size: 1.8rem;
    }

    .detail-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .download-btn {
        display: block;
        width: 90%;
        margin: 10px auto !important;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .download-package .download-buttons-container {
        text-align: center;
    }

    .app-detail-section ol li {
        font-size: 0.9rem;
    }

    .download-package-name {
        font-size: 1.1rem;
    }

    .download-package-info {
        font-size: 0.85rem;
    }

    .screenshot-item {
        flex: 0 0 90%;
        min-width: 90%;
    }

    .screenshot-gallery-wrapper {
        margin: 0;
    }

    .screenshot-gallery-wrapper .screenshot-nav {
        display: none !important;
    }
}

/* --- Search Modal Redesign --- */
.search-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2002;
    /* Highest z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeInModal 0.3s ease;
    align-items: flex-start;
    justify-content: center;
}

.search-modal-content {
    background-color: #212121;
    margin: 8% auto;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    width: 90%;
    max-width: 620px;
    position: relative;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    padding: 0;
    overflow: hidden;
}

.search-modal-input-container {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--input-border);
    position: relative;
}

.search-modal-input-container .search-icon-dynamic {
    width: 22px;
    height: 22px;
    fill: var(--subtle-text-color);
    margin-right: 15px;
    flex-shrink: 0;
}

#modalSearchInput {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--prominent-text-color);
    font-size: 1.1rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    /* REMOVED: No longer need padding-right */
    padding-right: 0;
}

#modalSearchInput::placeholder {
    color: var(--subtle-text-color);
    font-weight: 400;
}

.close-modal-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    z-index: 10;
    /* This lifts the button above other elements */
    background: none;
    border: none;
    color: var(--subtle-text-color);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    opacity: 1;
    color: var(--prominent-text-color);
}

.search-modal-results-header {
    padding: 15px 20px 5px 20px;
}

.search-modal-results-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--subtle-text-color);
    font-weight: 500;
}

.search-modal-results-header span {
    color: var(--prominent-text-color);
    font-weight: 600;
}

.search-modal-results-container {
    padding: 0 10px 10px 10px;
    max-height: 50vh;
    overflow-y: auto;
}

.search-modal-result-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    gap: 15px;
    color: var(--general-text-color);
}

.search-modal-result-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--prominent-text-color);
    filter: none;
}

.search-modal-result-item img {
    width: 45px;
    height: 67px;
    /* 2:3 aspect ratio */
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background-color: var(--input-bg);
}

.search-modal-result-info {
    overflow: hidden;
}

.search-modal-result-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-modal-result-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--subtle-text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-modal-result-item::after {
    content: '→';
    font-size: 1.5rem;
    color: var(--subtle-text-color);
    margin-left: auto;
    font-weight: 400;
    transition: color 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateX(-5px);
}

.search-modal-result-item:hover::after {
    color: var(--primary-color);
    opacity: 1;
    transform: translateX(0);
}

.search-modal-footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid var(--input-border);
    background-color: rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
}

.search-modal-footer.visible {
    display: block;
}

.search-modal-view-all-btn {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

.search-modal-view-all-btn:hover {
    text-decoration: underline;
    filter: brightness(1.1);
}

/* Custom scrollbar for results */
.search-modal-results-container::-webkit-scrollbar {
    width: 8px;
}

.search-modal-results-container::-webkit-scrollbar-track {
    background: transparent;
}

.search-modal-results-container::-webkit-scrollbar-thumb {
    background-color: var(--input-border);
    border-radius: 10px;
}

.search-modal-results-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--subtle-text-color);
}

.app-detail-section.description-section p {
    color: var(--general-text-color);
}