* {
    box-sizing: border-box;
}

:root {
    font-family: Arial, Helvetica, sans-serif;

    --background: #f5f6f8;
    --white: #ffffff;
    --border: #e4e6ea;
    --text: #17181c;
    --muted: #777b83;
    --hover: #f0f1f3;
    --active: #e8eaed;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--background);
    color: var(--text);
}


/* TOPBAR */

.topbar {
    height: 70px;

    display: flex;
    align-items: center;

    padding: 0 28px;

    gap: 35px;

    background: var(--white);

    border-bottom: 1px solid var(--border);

    position: sticky;
    top: 0;

    z-index: 50;
}


.logo {
    color: var(--text);

    text-decoration: none;

    font-size: 22px;

    font-weight: 800;

    letter-spacing: -0.7px;

    min-width: 150px;
}


.search-container {
    width: min(650px, 100%);
}


#searchInput {
    width: 100%;

    height: 42px;

    border: 1px solid #dfe1e5;

    background: #f7f7f8;

    border-radius: 10px;

    outline: none;

    padding: 0 15px;

    font-size: 14px;

    transition: 0.15s ease;
}


#searchInput:focus {
    background: white;

    border-color: #b7bac1;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.035);
}


/* APP */

.app {
    display: flex;

    min-height: calc(100vh - 70px);
}


/* SIDEBAR */

.sidebar {
    width: 240px;

    flex-shrink: 0;

    background: white;

    border-right: 1px solid var(--border);

    padding: 25px 14px;
}


.sidebar-label {
    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.1em;

    color: #999ca3;

    padding: 0 12px 10px;
}


.category-button,
.subcategory-button {
    width: 100%;

    border: none;

    cursor: pointer;

    background: transparent;

    color: #555960;

    border-radius: 8px;

    text-align: left;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.category-button {
    height: 42px;

    padding: 0 12px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    font-size: 14px;

    font-weight: 600;
}


.category-button:hover,
.subcategory-button:hover {
    background: var(--hover);

    color: var(--text);
}


.category-button.active,
.subcategory-button.active {
    background: var(--active);

    color: var(--text);
}


.coins-button .arrow {
    font-size: 20px;

    line-height: 1;

    transition: transform 0.15s ease;
}


.coins-button.open .arrow {
    transform: rotate(90deg);
}


/* SUBCATEGORIES */

.subcategory-list {
    display: none;

    padding: 3px 0 5px 12px;
}


.subcategory-list.open {
    display: block;
}


.subcategory-button {
    height: 36px;

    padding: 0 12px;

    font-size: 13px;
}


/* MAIN */

.main {
    flex: 1;

    min-width: 0;

    padding: 35px;
}


.page-header {
    margin-bottom: 25px;
}


.page-header h1 {
    margin: 0;

    font-size: 27px;

    letter-spacing: -0.8px;
}


.page-header p {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 13px;
}


/* GRID */

.asset-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(190px, 1fr));

    gap: 18px;
}


/* CARD */

.asset-card {
    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    overflow: hidden;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}


.asset-card:hover {
    transform: translateY(-3px);

    border-color: #d3d5da;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.07);
}


.asset-image {
    width: 100%;

    aspect-ratio: 1 / 1;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 22px;

    background: #f8f9fa;
}


.asset-image img {
    width: 100%;

    height: 100%;

    object-fit: contain;

    image-rendering: auto;
}


.asset-details {
    padding: 13px 14px 15px;

    border-top: 1px solid var(--border);
}


.asset-name {
    font-size: 14px;

    font-weight: 700;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


.asset-category {
    margin-top: 5px;

    font-size: 11px;

    color: var(--muted);

    text-transform: capitalize;
}


/* EMPTY */

.empty-state {
    text-align: center;

    padding: 100px 20px;
}


.empty-state h2 {
    margin: 0;

    font-size: 20px;
}


.empty-state p {
    color: var(--muted);

    font-size: 14px;
}


.hidden {
    display: none !important;
}


/* MODAL */

.modal {
    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 25px;
}


.modal-background {
    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    backdrop-filter: blur(5px);
}


.modal-card {
    position: relative;

    z-index: 2;

    width: min(620px, 100%);

    max-height: 90vh;

    overflow: auto;

    background: white;

    border-radius: 16px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.25);
}


.close-button {
    position: absolute;

    top: 14px;

    right: 14px;

    width: 36px;

    height: 36px;

    border: none;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.9);

    cursor: pointer;

    font-size: 25px;

    line-height: 1;

    z-index: 5;
}


.close-button:hover {
    background: #eeeeef;
}


.preview-image-container {
    width: 100%;

    min-height: 350px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 45px;

    background: #f7f8f9;
}


.preview-image-container img {
    max-width: 100%;

    max-height: 420px;

    object-fit: contain;
}


.preview-info {
    padding: 22px;
}


.preview-info h2 {
    margin: 0;

    font-size: 20px;

    word-break: break-word;
}


.preview-info p {
    margin: 7px 0 18px;

    color: var(--muted);

    font-size: 12px;

    word-break: break-all;
}


.download-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    height: 42px;

    padding: 0 18px;

    background: #17181c;

    color: white;

    text-decoration: none;

    border-radius: 9px;

    font-size: 13px;

    font-weight: 700;

    transition: 0.15s ease;
}


.download-button:hover {
    background: #303238;

    transform: translateY(-1px);
}


/* MOBILE */

@media (max-width: 700px) {

    .topbar {
        height: auto;

        min-height: 70px;

        padding: 14px 18px;

        flex-direction: column;

        align-items: stretch;

        gap: 12px;
    }


    .logo {
        min-width: 0;
    }


    .app {
        display: block;
    }


    .sidebar {
        width: 100%;

        border-right: none;

        border-bottom: 1px solid var(--border);

        padding: 12px;
    }


    .main {
        padding: 22px 15px;
    }


    .asset-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }


    .asset-image {
        padding: 14px;
    }

}
/* =========================================
   COMMUNITY
========================================= */

.sidebar-section-label {
    margin-top: 28px;
    margin-bottom: 8px;
    padding: 0 12px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;

    color: #8a8f96;
}

.community-button {
    width: 100%;
}


/* =========================================
   CREATE POST
========================================= */

.create-post-button {
    height: 40px;

    padding: 0 16px;

    border: 0;
    border-radius: 9px;

    background: #17191c;
    color: #ffffff;

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}

.create-post-button:hover {
    background: #292c30;
    transform: translateY(-1px);
}

.create-post-button.hidden {
    display: none;
}


/* =========================================
   COMMUNITY GRID
========================================= */

.community-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(280px, 1fr)
        );

    gap: 18px;
}

.community-grid.hidden {
    display: none;
}


/* =========================================
   COMMUNITY CARD
========================================= */

.community-card {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e4e6e9;
    border-radius: 14px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.community-card:hover {
    transform: translateY(-3px);

    border-color: #d7dade;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.07);
}


/* =========================================
   COMMUNITY IMAGE
========================================= */

.community-image {
    height: 220px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 22px;

    background:
        linear-gradient(
            45deg,
            #f1f2f4 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #f1f2f4 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #f1f2f4 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #f1f2f4 75%
        );

    background-size: 24px 24px;
    background-position:
        0 0,
        0 12px,
        12px -12px,
        -12px 0;
}

.community-image img {
    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    filter:
        drop-shadow(
            0 8px 14px rgba(0, 0, 0, 0.08)
        );
}


/* =========================================
   COMMUNITY CONTENT
========================================= */

.community-content {
    padding: 17px;
}

.community-content h2 {
    margin-bottom: 4px;

    font-size: 16px;
    font-weight: 700;

    color: #17191c;
}

.community-author {
    margin-bottom: 12px;

    color: #888d93;

    font-size: 12px;
}

.community-content p {
    min-height: 38px;

    margin-bottom: 16px;

    color: #666b71;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================
   DOWNLOAD
========================================= */

.community-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 36px;

    padding: 0 13px;

    border-radius: 8px;

    background: #f0f1f3;
    color: #25282c;

    font-size: 12px;
    font-weight: 650;

    transition:
        background 0.18s ease;
}

.community-download:hover {
    background: #e4e6e9;
}


/* =========================================
   EMPTY / LOADING
========================================= */

.community-empty,
.community-loading {
    grid-column: 1 / -1;

    padding: 70px 20px;

    text-align: center;

    color: #777c82;
}

.community-empty h2 {
    margin-bottom: 7px;

    color: #222529;

    font-size: 20px;
}

.community-empty p {
    font-size: 13px;
}


/* =========================================
   COMMUNITY FORM
========================================= */

.community-modal-card {
    max-width: 480px;
}

.community-form {
    display: flex;
    flex-direction: column;

    gap: 9px;

    margin-top: 24px;
}

.community-form label {
    margin-top: 7px;

    color: #363a3f;

    font-size: 13px;
    font-weight: 650;
}

.community-form label:first-child {
    margin-top: 0;
}

.community-form input,
.community-form textarea {
    width: 100%;

    border: 1px solid #dfe2e6;
    border-radius: 10px;

    outline: none;

    background: #fafbfc;

    color: #17191c;

    font-size: 14px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.community-form input {
    height: 45px;

    padding: 0 13px;
}

.community-form textarea {
    min-height: 100px;

    padding: 12px 13px;

    resize: vertical;
}

.community-form input:focus,
.community-form textarea:focus {
    background: #ffffff;

    border-color: #17191c;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.06);
}

.community-form input[type="file"] {
    height: auto;

    padding: 10px;
}

.upload-hint {
    margin-top: -3px;

    color: #92969b;

    font-size: 11px;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    .community-grid {
        grid-template-columns: 1fr;
    }

    .create-post-button {
        padding: 0 12px;
    }

}