.instance-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    border: none;
    outline: none;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    cursor: pointer;
    padding-right: 1.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;

    & option {
        background-color: var(--bg-elevated);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 400;
        letter-spacing: 0;
    }

    &:focus {
        color: var(--accent);
    }
}

.top-bar {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.description {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.sub-menu {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid var(--border-subtle);

    margin-bottom: 1rem;
}

.sub-menu-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    color: var(--text-secondary);
    border-radius: 5px 5px 0 0;
    cursor: pointer;

    &.active{
        color: var(--accent);
        border-bottom: 3px solid var(--accent);
    }

    & svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }
}

.top-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.stat-card {
    background: var(--bg-elevated);
    border: var(--border-subtle) solid 0.5px;
    border-radius: var(--radius-sm);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease;

    &:hover {
        border-color: var(--border-focus);
        border-width: 0.5px;
    }

    &.top-card {
        width: 24%;
    }
}

.stat-card-value {
    font-size: 1.5rem;
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stat-card-value, .stat-card-bottom {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.stat-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.content {
    display: none;
    flex-direction: column;
    gap: 20px;
    &.active {
        display: flex;
    }
     /* par défaut, les contenus sont cachés */
}

.bottom-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: stretch; /* force même hauteur */
}

.stat-card-bot {
    width: 50%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: border-color 0.2s ease;
    height: 100%;

    & .stat-card-bot-title {
        background: var(--bg-elevated);
        border: var(--border-subtle) solid 0.5px;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    & .stat-card-bot-content{
        flex: 1;
        background: var(--bg-elevated);
        border: var(--border-subtle) solid 0.5px;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        display: flex;
        flex-direction: column;
    }
}

.stat-card-bot-title, .stat-card-bot-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    gap: 5px;
    padding: 10px 15px;

    & svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }
}

/* ─── Skeleton ───────────────────────────────────────────────── */

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.skeleton {
    display: block;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        var(--border-subtle) 50%,
        var(--bg-elevated) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
}

.skeleton-card    { pointer-events: none; }
.skeleton-mod-icon     { width: 75px; height: 75px; border-radius: 5px; flex-shrink: 0; }
.skeleton-mod-name     { width: 120px; height: 14px; margin-bottom: 0.1rem; }
.skeleton-mod-desc     { height: 11px; width: 100%; }
.skeleton-mod-desc.short { width: 70%; }
.skeleton-mod-category { width: 80px; height: 9px; margin-top: 0.15rem; }

.mods-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;

    & .mod-item {
        min-width: 0;

        background-color: var(--bg-elevated);
        border: var(--border-light) solid 0.5px;
        border-radius: var(--radius-sm);

        padding: 10px;

        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;

        & .mod-icon {
            flex-shrink: 0;
            & img {
                width: 60px;
                height: 60px;
                object-fit: cover;
                border-radius: 5px;
                display: block;
            }
        }

        & .mod-info {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
            overflow: hidden;

            & .mod-name {
                font-family: var(--font-display);
                font-weight: 700;
                letter-spacing: -0.03em;
                color: var(--accent);
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            & .mod-desc {
                font-size: 0.82rem;
                color: var(--text-secondary);
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
            }

            & .mod-category {
                font-size: 0.55rem;
                color: var(--text-muted);
                font-family: var(--font-mono);
                font-weight: 500;
                letter-spacing: 0.12em;
                text-transform: uppercase;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        &:hover .mod-actions {
            display: flex;
        }

        & .mod-actions {
            display: none;
            flex-direction: column;
            align-items: center;
            gap: 0.35rem;

            & .btn {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 35px;
                height: 35px;
                padding: 0;
                background: var(--bg-overlay);
                border: 1px solid var(--border-subtle);
                border-radius: var(--radius-sm);
                color: var(--text-muted);
                cursor: pointer;
                transition: all var(--transition);

                & svg {
                    width: 15px;
                    height: 15px;
                }

                &:hover {
                    border-color: var(--border-light);
                    color: var(--text-primary);
                }
                
                &:last-child:hover {
                    border-color: var(--danger);
                    color: var(--danger);
                    background: var(--danger-dim);
                }
            }
        }
    }
}

