/* ============================================ */
/* Reset and Base */
/* ============================================ */

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================ */
/* Header */
/* ============================================ */

header {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 30px 20px;
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content h1 {
    font-size: 42px;
    font-weight: 700;
    color: #f0f6fc;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.header-content .subtitle {
    color: #8b949e;
    font-size: 18px;
    margin-top: 5px;
    font-weight: 300;
    transition: color 0.3s ease;
}

/* ============================================ */
/* Navigation */
/* ============================================ */

nav {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 0 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 0;
    align-items: center;
    flex-wrap: wrap;
}

nav ul li a {
    color: #8b949e;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 4px;
    transition: color 0.2s;
}

nav ul li a:hover {
    color: #f0f6fc;
}

nav ul li a.active {
    color: #f0f6fc;
    border-bottom: 1px solid #f0f6fc;
    padding-bottom: 6px;
}

/* ============================================ */
/* Theme Toggle Button */
/* ============================================ */

.theme-toggle-btn {
    background: none;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 14px;
    border-radius: 1px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.theme-toggle-btn:hover {
    background-color: #21262d;
    border-color: #58a6ff;
}

/* ============================================ */
/* Main Content */
/* ============================================ */

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

section {
    margin-bottom: 60px;
}

section h2 {
    font-size: 28px;
    color: #f0f6fc;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.section-description {
    color: #8b949e;
    font-size: 16px;
    margin-bottom: 24px;
    transition: color 0.3s ease;
}

/* ============================================ */
/* Stats Section */
/* ============================================ */

#stats {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 1px;
    padding: 24px;
    margin-bottom: 40px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.stats-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 8px 16px;
}

.stat-item img {
    height: 28px;
}

/* ============================================ */
/* Search Bar */
/* ============================================ */

#mod-search {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 1px;
    color: #c9d1d9;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.3s ease, color 0.3s ease;
    margin-bottom: 20px;
}

#mod-search:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

#mod-search::placeholder {
    color: #484f58;
}

/* ============================================ */
/* Mods List View */
/* ============================================ */

.mods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mod-list-item {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 1px;
    transition: background-color 0.2s, border-color 0.2s;
}

.mod-list-item:hover {
    background-color: #1c2128;
    border-color: #58a6ff;
}

.mod-list-item a {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    text-decoration: none;
    color: #c9d1d9;
}

.mod-list-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.mod-list-icon img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 13px;
}

.mod-list-info {
    flex: 1;
}

.mod-list-info h3 {
    color: #f0f6fc;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.mod-list-info p {
    color: #8b949e;
    font-size: 14px;
    margin: 0 0 8px 0;
    transition: color 0.3s ease;
}

.mod-list-info .badges {
    margin: 0;
}

.mod-list-status {
    flex-shrink: 0;
    text-align: right;
}

/* ============================================ */
/* Badges */
/* ============================================ */

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px 0;
}

.badges img {
    height: 20px;
}

/* ============================================ */
/* Mod Status */
/* ============================================ */

.mod-status {
    display: inline-block;
    padding: 2px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 1px;
}

.mod-status.available {
    background-color: #0d4425;
    color: #3fb950;
    border: 1px solid #238636;
}

.mod-status.coming {
    background-color: #1f3a6b;
    color: #58a6ff;
    border: 1px solid #1f6feb;
}

/* ============================================ */
/* About Section */
/* ============================================ */

#about {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 1px;
    padding: 32px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#about p {
    color: #8b949e;
    margin-bottom: 12px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.about-list {
    color: #8b949e;
    padding-left: 24px;
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.about-list li {
    margin-bottom: 4px;
}

/* ============================================ */
/* Contributors Section */
/* ============================================ */

#contributors {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 1px;
    padding: 32px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contributors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.contributor-card {
    text-align: center;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 1px;
    padding: 12px;
    transition: background-color 0.2s;
}

.contributor-card:hover {
    background-color: #30363d;
}

.contributor-card a {
    text-decoration: none;
    color: #c9d1d9;
}

.contributor-card img {
    display: block;
    margin: 0 auto 8px;
    border: 1px solid #30363d;
    border-radius: 1px;
}

.contributor-card span {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.contributor-card small {
    display: block;
    color: #8b949e;
    font-size: 12px;
}

/* ============================================ */
/* FAQ Section */
/* ============================================ */

#faq {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 1px;
    padding: 32px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.faq-item {
    padding: 16px 0;
    border-bottom: 1px solid #30363d;
    transition: border-color 0.3s ease;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: #f0f6fc;
    font-size: 18px;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.faq-item p {
    color: #8b949e;
    font-size: 15px;
    transition: color 0.3s ease;
}

.faq-item a {
    color: #58a6ff;
    text-decoration: none;
}

.faq-item a:hover {
    text-decoration: underline;
}

/* ============================================ */
/* Footer */
/* ============================================ */

footer {
    background-color: #161b22;
    border-top: 1px solid #30363d;
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-content p {
    color: #8b949e;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-content p:first-child {
    margin-bottom: 4px;
}

.footer-content a {
    color: #58a6ff;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* ============================================ */
/* Back to Top Button */
/* ============================================ */

#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #238636;
    color: #ffffff;
    border: none;
    border-radius: 1px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
    z-index: 1000;
}

#back-to-top:hover {
    background-color: #2ea043;
    transform: translateY(-2px);
}

#back-to-top:active {
    transform: scale(0.95);
}

/* ============================================ */
/* Scrollbar Styling */
/* ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: #0d1117;
}

::-webkit-scrollbar-thumb {
    background-color: #30363d;
    border-radius: 1px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #484f58;
}

/* ============================================ */
/* Mod Detail Page */
/* ============================================ */

.mod-detail {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 1px;
    padding: 32px;
    margin-bottom: 40px;
}

.back-link {
    margin-bottom: 24px;
}

.back-link a {
    color: #8b949e;
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    color: #f0f6fc;
}

.mod-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #30363d;
}

.mod-icon-large {
    width: 80px;
    height: 80px;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.mod-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
}

.mod-info {
    flex: 1;
}

.mod-info h1 {
    font-size: 32px;
    color: #f0f6fc;
    margin-bottom: 6px;
    font-weight: 700;
}

.mod-tagline {
    font-size: 18px;
    color: #8b949e;
    margin-bottom: 12px;
}

.mod-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.meta-item {
    font-size: 14px;
    color: #8b949e;
}

.meta-item strong {
    color: #c9d1d9;
}

.meta-item .available {
    color: #3fb950;
}

.mod-content h2 {
    font-size: 22px;
    color: #f0f6fc;
    margin-top: 30px;
    margin-bottom: 12px;
    font-weight: 600;
}

.mod-content p {
    color: #c9d1d9;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.7;
}

.mod-content ul,
.mod-content ol {
    color: #c9d1d9;
    padding-left: 24px;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.8;
}

.mod-content li {
    margin-bottom: 4px;
}

.mod-content a {
    color: #58a6ff;
    text-decoration: none;
}

.mod-content a:hover {
    text-decoration: underline;
}

/* ============================================ */
/* Download Buttons - FIX */
/* ============================================ */

.download-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.download-btn,
.github-btn {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.download-btn:hover,
.github-btn:hover {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.download-btn:focus,
.github-btn:focus {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.download-btn:active,
.github-btn:active {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.download-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    background-color: #238636;
    color: #ffffff !important;
    border: none !important;
    border-radius: 1px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: #2ea043;
    color: #ffffff !important;
}

.github-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    background-color: #21262d;
    color: #f0f6fc !important;
    border: 1px solid #30363d !important;
    border-radius: 1px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.github-btn:hover {
    background-color: #30363d;
    color: #f0f6fc !important;
}

/* ============================================ */
/* Light Theme */
/* ============================================ */

body.light-theme {
    background-color: #f6f8fa;
    color: #24292f;
}

body.light-theme header,
body.light-theme nav,
body.light-theme footer,
body.light-theme #stats,
body.light-theme #about,
body.light-theme #contributors,
body.light-theme #faq,
body.light-theme .mod-list-item,
body.light-theme .mod-detail {
    background-color: #ffffff;
    border-color: #d0d7de;
}

body.light-theme .header-content h1 {
    color: #24292f;
}

body.light-theme .header-content .subtitle,
body.light-theme .section-description,
body.light-theme .mod-list-info p,
body.light-theme #about p,
body.light-theme .faq-item p,
body.light-theme .footer-content p,
body.light-theme .mod-tagline,
body.light-theme .meta-item,
body.light-theme .back-link a {
    color: #57606a;
}

body.light-theme section h2,
body.light-theme .mod-list-info h3,
body.light-theme .faq-item h3,
body.light-theme .mod-info h1,
body.light-theme .mod-content h2 {
    color: #24292f;
}

body.light-theme nav ul li a {
    color: #57606a;
}

body.light-theme nav ul li a:hover,
body.light-theme nav ul li a.active {
    color: #24292f;
}

body.light-theme .mod-list-icon,
body.light-theme .mod-icon-large {
    background-color: #f6f8fa;
    border-color: #d0d7de;
}

body.light-theme #mod-search {
    background-color: #ffffff;
    border-color: #d0d7de;
    color: #24292f;
}

body.light-theme #mod-search:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
}

body.light-theme .mod-list-item:hover {
    background-color: #f6f8fa;
}

body.light-theme .mod-status.available {
    background-color: #dafbe1;
    color: #116329;
    border-color: #238636;
}

body.light-theme .mod-status.coming {
    background-color: #ddf4ff;
    color: #0550ae;
    border-color: #1f6feb;
}

body.light-theme .theme-toggle-btn {
    border-color: #d0d7de;
    color: #24292f;
}

body.light-theme .theme-toggle-btn:hover {
    background-color: #f6f8fa;
    border-color: #0969da;
}

body.light-theme .contributor-card {
    background-color: #f6f8fa;
    border-color: #d0d7de;
}

body.light-theme .contributor-card:hover {
    background-color: #eaeef2;
}

body.light-theme #back-to-top {
    background-color: #0969da;
}

body.light-theme #back-to-top:hover {
    background-color: #0550ae;
}

body.light-theme .faq-item {
    border-bottom-color: #d0d7de;
}

body.light-theme .mod-header {
    border-bottom-color: #d0d7de;
}

body.light-theme .mod-content a {
    color: #0969da;
}

body.light-theme .github-btn {
    background-color: #f6f8fa;
    color: #24292f !important;
    border-color: #d0d7de !important;
}

body.light-theme .github-btn:hover {
    background-color: #eaeef2;
    color: #24292f !important;
}

body.light-theme .meta-item strong {
    color: #24292f;
}

body.light-theme .mod-content p,
body.light-theme .mod-content ul,
body.light-theme .mod-content ol {
    color: #24292f;
}

body.light-theme .back-link a:hover {
    color: #24292f;
}

/* ============================================ */
/* Responsive Design */
/* ============================================ */

@media (max-width: 768px) {
    header .header-content h1 {
        font-size: 30px;
    }

    .header-content .subtitle {
        font-size: 16px;
    }

    nav ul {
        justify-content: center;
        gap: 16px;
    }

    nav ul li:last-child {
        margin-left: 0 !important;
        width: 100%;
        text-align: center;
        margin-top: 4px;
    }

    .mod-list-item a {
        flex-wrap: wrap;
        gap: 12px;
    }

    .mod-list-status {
        text-align: left;
        width: 100%;
        padding-left: 68px;
    }

    .stats-grid {
        gap: 12px;
    }

    #about,
    #contributors,
    #faq,
    #stats {
        padding: 20px;
    }

    section h2 {
        font-size: 22px;
    }

    .mod-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mod-meta {
        justify-content: center;
    }

    .download-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px 12px;
    }

    .mod-list-item a {
        padding: 12px 16px;
    }

    .mod-list-info h3 {
        font-size: 16px;
    }

    .mod-list-info p {
        font-size: 13px;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 4px 8px;
    }

    .stat-item img {
        height: 22px;
    }

    #mod-search {
        max-width: 100%;
        font-size: 14px;
        padding: 10px 14px;
    }

    .header-content h1 {
        font-size: 24px;
    }

    section h2 {
        font-size: 20px;
    }

    .mod-list-icon {
        width: 40px;
        height: 40px;
    }

    .mod-list-icon img {
        width: 40px;
        height: 40px;
    }

    .mod-detail {
        padding: 20px 16px;
    }

    .mod-info h1 {
        font-size: 26px;
    }

    .mod-icon-large {
        width: 60px;
        height: 60px;
    }

    .mod-icon-large img {
        width: 60px;
        height: 60px;
    }
}
